PEAR is discontinued

This is a static archive preserving historical releases and metadata. No new packages or updates will be published. For updates to existing packages, or to publish new packages, please use Composer and Packagist.

Home » Database » MDB2 » Bug #8838

tableInfo does not escape table name

Details

Submitted2006-10-03 11:17 UTC
Frommatty at magicnumber dot co dot uk
StatusBogus
PackageMDB2
PHP Version5.1.3
OSDebian
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