From ff21f653c985e3de1062bd26e4cbdbba3a92dc9e Mon Sep 17 00:00:00 2001 From: mark_story Date: Mon, 7 Oct 2013 00:06:44 -0300 Subject: [PATCH] Use quoted identifiers instead of bound parameters. Schema reflection required quoted identifiers on certain MySQL versions. Using bound parameters results in queries that cause SQL errors. --- Cake/Database/Schema/MysqlSchema.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Cake/Database/Schema/MysqlSchema.php b/Cake/Database/Schema/MysqlSchema.php index 6757b8bd0c5..69aad3551a5 100644 --- a/Cake/Database/Schema/MysqlSchema.php +++ b/Cake/Database/Schema/MysqlSchema.php @@ -20,7 +20,7 @@ use Cake\Database\Schema\Table; /** - * Schema management/reflection features for MySQL + * Schema generation/reflection features for MySQL * */ class MysqlSchema extends BaseSchema { @@ -30,7 +30,7 @@ class MysqlSchema extends BaseSchema { * */ public function listTablesSql($config) { - return ['SHOW TABLES FROM ?', [$config['database']]]; + return ['SHOW TABLES FROM ' . $this->_driver->quoteIdentifier($config['database']), []]; } /** @@ -38,7 +38,7 @@ public function listTablesSql($config) { * */ public function describeTableSql($name, $config) { - return ['SHOW FULL COLUMNS FROM ?', [$name]]; + return ['SHOW FULL COLUMNS FROM ' . $this->_driver->quoteIdentifier($name), []]; } /** @@ -46,7 +46,7 @@ public function describeTableSql($name, $config) { * */ public function describeIndexSql($table, $config) { - return ['SHOW INDEXES FROM ?', [$table]]; + return ['SHOW INDEXES FROM ' . $this->_driver->quoteIdentifier($table), []]; } /**