|
Bug Notes |
|
|
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'].'`'; |
|
|
|
|
|
OK, but my question is: if I add ` delimiters, will it work also with old versions of MySQL database server? |
|
|
|
|
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 |
|
|
|
|
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 |
|
|
|
|
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 ? |
|
|
|
|
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. |
|
|
|
|
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 ? |
|
|
|
|
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(); |
|
|
|
|
|
Good solution. What else needs to be done, to have this resolved? |
|
|
|
|
|
probably just test a little bit. maybe some queries are forgotten.... |
|