Platon Technologies
neprihlásený Prihlásiť Registrácia
SlovakEnglish
open source software development oslavujeme 10 rokov vývoja otvoreného softvéru! Utorok, 24. november 2026
O nás
Magazín
Otvorený softvér
CVS
Služby
Index  »  Projekty  »  phpMyEdit  »  Zoznam chýb  »  Chyba #94

Rozšírené detaily chyby [ Preskočiť na poznámky k chybám ] [ História chýb ] [ Vytlačiť ]
ID Kategória Dôležitosť Reprodukovateľnosť Dátum vloženia Posledná zmena
0000094 core / field option veľká vždy 2003-05-04 16:40 2007-04-15 18:26
 
Autor anonymous Zobraziť status verejný  
Priradené michal
Priorita normálna Riešenie otvorený Platforma PHP 4.3.1 and MySQL 4.0.12
Stav priradený Duplicitné ID OS Windows
Projection žiadny Verzia 98
ETA žiadny Verzia produktu
  Build produktu
  Hlasy 1
 
Zhrnutie Can't handle table names
Popis Works fine with tables with only alphanumeric characters but it doesn't work with tables such as 'sat1-fixtures' which have other characters
Kroky k vyvolaniu Generate a table with a dash in the name and try to make a PHP file using it. Setup works but when the PHP file is run it crashes.
Dalšie informácie Maybe you need to add ` delimiters to table names and ' to field names
Pripojené súbory bq.diff (7,190 bytes) 2004-04-16 11:52

Poznámky k chybe
anonymous
2003-05-04 20:07

SOLUTION : in function phpMyEdit($opts) the line reading:-
$this->tb = $opts['tb'];
must be changed to:-
$this->tb = '`'.$opts['tb'].'`';
 
nepto
2003-05-07 15:45

OK, but my question is: if I add ` delimiters, will it work also with old versions of MySQL database server?
 
nepto
2003-08-12 12:57

This was resubmitted in #124:

Cannot handle database with - (dash) character
 
hbernard
2003-08-12 16:58

anonymous :

Why not writing directly
$opts['tb'] = '`my-table`';
for tables whose names are problematic ???

After some test, this workaround seems okay

edited on: 2003-12-21 12:26
 
nepto
2004-01-23 17:01

A workaround was posted in duplicated entry:

http://platon.sk/projects/bug_view_advanced_page.php?f_bug_id=146
 
hbernard
2004-01-23 17:50

But the workaround will fail in case of js validation.
Fix for making workaround work everytime was uploaded in #146
 
nepto
2004-04-16 10:40

Michal pointed me on this:

http://www.mysql.com/doc/en/Legal_names.html
 
hbernard
2004-04-16 11:53

uploaded bq.diff

which make all the table and field's names backquoted.

I certainly missed some SQL operation, but this is a start.

Comments ?
 
nepto
2004-04-20 13:47

Problem is, that old MySQL server does not support these backquotes...

We have two cases:

1. Makes phpMyEdit to work only with new MySQL servers.
2. Detects which version is used and according to this quote or not to quote table/field names.
 
hbernard
2004-04-20 13:54

2b. make a configurable sql_enclosing_delimiter option and use it.
 
nepto
2004-04-20 14:40

Yes, but we can detect this automatically.

Basically I will agree with mentioned approach, but try to read this:

http://www.catb.org/~esr/writings/cups-horror.html

I'm not ESR fan, nor I agree with everything in that article, but in some paragraphs he is certainly right.
 
hbernard
2004-04-20 15:53

OK, So way to solve is :
1. have a $this->enclosing_sql var declared in the class
2. if this is user configurable, test in the constructor
3a. if set, set $this->enclosing_sql = $opts['enclosing_sql']
3b. if not, do autodetection and set $this->enclosing_sql
4. use it in all the querys (but don't enclose 'sql' and 'sqlw' statements.

Two issues :
A) should it be user configurable ?
B) for autodetection, we need to make connection in constructor in place of execute, is it good ?
 
michal
2007-04-13 12:37

partially fixed in cvs (v 1.193).

old versions of MySQL are now _very_ old, so imho no need for configuration. but class allows customization, just need to add child class which will edit function sql_delimiter();
 
nepto
2007-04-15 18:08

Good solution. What else needs to be done, to have this resolved?
 
michal
2007-04-15 18:26

probably just test a little bit. maybe some queries are forgotten....
 

História chýb
Dátum poslednej úpravy Používateľské meno Pole Zmeniť
2003-05-04 16:40 anonymous Nová chyba
2003-05-04 20:07 anonymous Poznámka k chybe pridaná: 0000237
2003-05-07 15:45 nepto status nový => reakcia
2003-05-07 15:45 nepto Poznámka k chybe pridaná: 0000240
2003-08-12 12:57 nepto Poznámka k chybe pridaná: 0000361
2003-08-12 16:58 hbernard Poznámka k chybe pridaná: 0000363
2003-08-14 16:22 nepto status reakcia => schválený
2003-08-14 16:22 nepto version 5.3 =>
2003-12-21 12:26 hbernard Poznámka k chybe upravená: 363
2004-01-23 17:01 nepto Poznámka k chybe pridaná: 0000659
2004-01-23 17:50 hbernard Poznámka k chybe pridaná: 0000662
2004-01-23 17:51 hbernard Chyba monitorovaná: hbernard
2004-04-16 10:40 nepto Poznámka k chybe pridaná: 0000948
2004-04-16 11:52 hbernard Pridaný súbor: : bq.diff
2004-04-16 11:53 hbernard Poznámka k chybe pridaná: 0000949
2004-04-20 13:47 nepto Poznámka k chybe pridaná: 0001017
2004-04-20 13:54 hbernard Poznámka k chybe pridaná: 0001019
2004-04-20 14:40 nepto Poznámka k chybe pridaná: 0001024
2004-04-20 15:53 hbernard Poznámka k chybe pridaná: 0001027
2007-04-13 12:37 michal Poznámka k chybe pridaná: 0001864
2007-04-13 12:39 michal handler_id => michal
2007-04-13 12:39 michal status schválený => priradený
2007-04-15 18:08 nepto Poznámka k chybe pridaná: 0001874
2007-04-15 18:26 michal Poznámka k chybe pridaná: 0001875

Copyright © 2002-2006 Platon Group
Stránka používa redakčný systém Metafox
Na začiatok · Odkazový formulár · Prihláška
Upozorniť na chybu na PLATON.SK webstránke · Podmienky použitia · Ochrana osobných údajov