diff --git a/lib/Cake/Model/Datasource/Database/Mysql.php b/lib/Cake/Model/Datasource/Database/Mysql.php index 7b38ff5ce..a839fd059 100644 --- a/lib/Cake/Model/Datasource/Database/Mysql.php +++ b/lib/Cake/Model/Datasource/Database/Mysql.php @@ -196,7 +196,7 @@ class Mysql extends DboSource { } else { $tables = array(); - while ($line = $result->fetch()) { + while ($line = $result->fetch(PDO::FETCH_NUM)) { $tables[] = $line[0]; } @@ -280,7 +280,7 @@ class Mysql extends DboSource { public function getCharsetName($name) { if ((bool)version_compare($this->getVersion(), "5", ">=")) { $r = $this->_execute('SELECT CHARACTER_SET_NAME FROM INFORMATION_SCHEMA.COLLATIONS WHERE COLLATION_NAME = ?', array($name)); - $cols = $r->fetch(); + $cols = $r->fetch(PDO::FETCH_ASSOC); if (isset($cols['CHARACTER_SET_NAME'])) { return $cols['CHARACTER_SET_NAME']; @@ -442,7 +442,7 @@ class Mysql extends DboSource { $old = version_compare($this->getVersion(), '4.1', '<='); if ($table) { $indices = $this->_execute('SHOW INDEX FROM ' . $table); - while ($idx = $indices->fetch()) { + while ($idx = $indices->fetch(PDO::FETCH_OBJ)) { if ($old) { $idx = (object) current((array)$idx); }