Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 0.8.5

Bug #10195 Identifiers quoting problem
Submitted: 2007-02-26 13:19 UTC Modified: 2007-02-27 18:26 UTC
From: ioz at ionosfera dot com Assigned: ifeghali
Status: Closed Package: MDB2_Schema (version CVS)
PHP Version: Irrelevant OS:
Roadmaps: (Not assigned)    
Subscription  


 [2007-02-26 13:19 UTC] ioz at ionosfera dot com (IoZ)
Description: ------------ In most functions table names are quoted, but it must be necesary to quote column names also, because errors can appear when using DBMS reserved words as column names. For example, the function dumpDatabase fails when using 'value' as the column name of a table with MySQL.

Comments

 [2007-02-26 21:48 UTC] ifeghali (Igor Feghali)
Which MySQL server version are you running? I have dumped the following table: CREATE TABLE `Packages` ( `id` int(10) unsigned NOT NULL auto_increment, `value` varchar(128) NOT NULL, `summary` varchar(255) default NULL, `creation` datetime default NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=5 ; with MySQL 5.0.27 successfully. Have you tried dumping your table with the example.php that sits in doc/MDB2_Schema/docs/examples/ ? (default options)
 [2007-02-27 07:31 UTC] ioz at ionosfera dot com
Sorry, the column name that failed was 'option', and not 'value'. You can reproduce the error using the following table: CREATE TABLE `Packages` ( `id` int(10) unsigned NOT NULL auto_increment, `option` varchar(128) NOT NULL, `summary` varchar(255) default NULL, `creation` datetime default NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=5; INSERT INTO `packages` VALUES (5, 'test1', 'summary1', '2007-02-15 13:11:32'); I have MySQL version 5.0.20 and when I dump that table with the "example.php" file, I get the following error: * MDB2 Error: syntax error _doQuery: [Error message: Could not execute statement] [Last executed query: SELECT id, option, summary, creation FROM `packages`] [Native code: 1064] [Native message: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'option, summary, creation FROM `packages`' at line 1]
 [2007-02-27 18:26 UTC] ifeghali (Igor Feghali)
This bug has been fixed in CVS. If this was a documentation problem, the fix will appear on pear.php.net by the end of next Sunday (CET). If this was a problem with the pear.php.net website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better.