mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-31 09:06:17 +00:00
Using an explicit fetch mode in all calls to PDOStatement::fetch, this also reduces the memory usage
This commit is contained in:
parent
fa99b58622
commit
e5c312f4b5
1 changed files with 3 additions and 3 deletions
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue