Platon Technologies
not logged in Login Registration
EnglishSlovak
open source software development celebrating 10 years of open source development! Wednesday, November 11, 2026
About Us
Magazine
Open Source
CVS
Services
Index  »  Projects  »  phpMyEdit  »  Bug list  »  Bug #94

Viewing Bug Advanced Details [ Jump to Bugnotes ] [ Bug History ] [ Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0000094 core / field option major always 2003-05-04 16:40 2007-04-15 18:26
 
Reporter anonymous View Status public  
Assigned To michal
Priority normal Resolution open Platform PHP 4.3.1 and MySQL 4.0.12
Status assigned Duplicate ID OS Windows
Projection none Version 98
ETA none Product Version
  Product Build
  Votes 1
 
Summary Can't handle table names
Description Works fine with tables with only alphanumeric characters but it doesn't work with tables such as 'sat1-fixtures' which have other characters
Steps To Reproduce 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.
Additional Information / Solution Maybe you need to add ` delimiters to table names and ' to field names
Attached Files bq.diff (7,190 bytes) 2004-04-16 11:52

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'].'`';
 
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....
 

Copyright © 2002-2006 Platon Group
Site powered by Metafox CMS
Go to Top · Feedback form · Application form
Report bug on PLATON.SK website · Terms of use · Privacy policy