Home » Database » MDB2_Schema » Bug #10195
Identifiers quoting problem
Details
| Submitted | 2007-02-26 18:19 UTC |
|---|---|
| From | ioz at ionosfera dot com |
| Assigned | ifeghali |
| Status | Closed |
| Package | MDB2_Schema |
| PHP Version | Irrelevant |
| Roadmaps | (Not assigned) |
Comments
[2007-02-26 18:19 UTC] ioz at ionosfera dot com
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.
[2007-02-27 12: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]