Skip to content

Commit

Permalink
Use quoted identifiers instead of bound parameters.
Browse files Browse the repository at this point in the history
Schema reflection required quoted identifiers on certain MySQL versions.
Using bound parameters results in queries that cause SQL errors.
  • Loading branch information
markstory committed Oct 7, 2013
1 parent 3d03d5b commit ff21f65
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Cake/Database/Schema/MysqlSchema.php
Expand Up @@ -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 {
Expand All @@ -30,23 +30,23 @@ class MysqlSchema extends BaseSchema {
*
*/
public function listTablesSql($config) {
return ['SHOW TABLES FROM ?', [$config['database']]];
return ['SHOW TABLES FROM ' . $this->_driver->quoteIdentifier($config['database']), []];
}

/**
* {@inheritdoc}
*
*/
public function describeTableSql($name, $config) {
return ['SHOW FULL COLUMNS FROM ?', [$name]];
return ['SHOW FULL COLUMNS FROM ' . $this->_driver->quoteIdentifier($name), []];
}

/**
* {@inheritdoc}
*
*/
public function describeIndexSql($table, $config) {
return ['SHOW INDEXES FROM ?', [$table]];
return ['SHOW INDEXES FROM ' . $this->_driver->quoteIdentifier($table), []];
}

/**
Expand Down

0 comments on commit ff21f65

Please sign in to comment.