Adjusted quoteIdentifier in update and delete when executing a SQL query (also fixes #807)
This commit is contained in:
parent
9ee6158ffc
commit
139febaed6
@ -584,7 +584,7 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun
|
|||||||
{
|
{
|
||||||
$criteria = array();
|
$criteria = array();
|
||||||
foreach (array_keys($identifier) as $id) {
|
foreach (array_keys($identifier) as $id) {
|
||||||
$criteria[] = $id . ' = ?';
|
$criteria[] = $this->quoteIdentifier($id) . ' = ?';
|
||||||
}
|
}
|
||||||
|
|
||||||
$query = 'DELETE FROM '
|
$query = 'DELETE FROM '
|
||||||
@ -612,10 +612,10 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun
|
|||||||
$set = array();
|
$set = array();
|
||||||
foreach ($data as $columnName => $value) {
|
foreach ($data as $columnName => $value) {
|
||||||
if ($value instanceof Doctrine_Expression) {
|
if ($value instanceof Doctrine_Expression) {
|
||||||
$set[] = $columnName . ' = ' . $value->getSql();
|
$set[] = $this->quoteIdentifier($columnName) . ' = ' . $value->getSql();
|
||||||
unset($data[$columnName]);
|
unset($data[$columnName]);
|
||||||
} else {
|
} else {
|
||||||
$set[] = $columnName . ' = ?';
|
$set[] = $this->quoteIdentifier($columnName) . ' = ?';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user