mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
* Fixed bug where select query in deleteAll could return wrong table name.
PDOStatement::getColumnMeta (in mysql.php) sometimes returns the actual table name when using a MySQL view with the distinct select query, and not the alias table name. By returning the actual table name the records could not be removed. By the way PDOStatement::getColumnMeta is an experimental function, perhaps it's better to avoid it.
This commit is contained in:
parent
7b2ac816c6
commit
5035613157
1 changed files with 2 additions and 1 deletions
|
@ -2703,8 +2703,9 @@ class Model extends Object implements CakeEventListener {
|
||||||
}
|
}
|
||||||
|
|
||||||
$ids = $this->find('all', array_merge(array(
|
$ids = $this->find('all', array_merge(array(
|
||||||
'fields' => "DISTINCT {$this->alias}.{$this->primaryKey}",
|
'fields' => "{$this->alias}.{$this->primaryKey}",
|
||||||
'order' => false,
|
'order' => false,
|
||||||
|
'group' => "{$this->alias}.{$this->primaryKey}",
|
||||||
'recursive' => 0), compact('conditions'))
|
'recursive' => 0), compact('conditions'))
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue