Home » Database » MDB2 » Bug #8838
tableInfo does not escape table name
Details
| Submitted | 2006-10-03 11:17 UTC |
|---|---|
| From | matty at magicnumber dot co dot uk |
| Status | Bogus |
| Package | MDB2 |
| PHP Version | 5.1.3 |
| OS | Debian |
| Roadmaps | (Not assigned) |
Comments
[2006-10-03 11:17 UTC] matty at magicnumber dot co dot uk
Description:
------------
Using:
MDB2
MDB2_DRIVER_MYSQLI
Reverse Module
When calling tableInfo() using a table who's name is also a reserved word in mysql an error occurs.
The SQL generated is:
"SHOW COLUMNS FROM order"
You can work around this issue by passing the table name pre-escaped into tableInfo()
Test script:
---------------
$info = $db->tableInfo( "order" );
Expected result:
----------------
The table name to be properly escaped and tableInfo to return the table information.
"SHOW COLUMNS FROM `order`"
Actual result:
--------------
MDB2 Error: Array
Error message: Could not execute statement