Skip to content
Permalink
Browse files

Add table name quoting to UPDATE queries

  • Loading branch information...
HavokInspiration committed Jun 16, 2015
1 parent 97d8902 commit e67599835044fb7d1b073ac5480b9f1987c2ea0d
Showing with 14 additions and 0 deletions.
  1. +14 −0 src/Database/IdentifierQuoter.php
@@ -58,6 +58,8 @@ public function quote(Query $query)
if ($query->type() === 'insert') {
$this->_quoteInsert($query);
} elseif ($query->type() === 'update') {
$this->_quoteUpdate($query);
} else {
$this->_quoteParts($query);
}
@@ -181,6 +183,18 @@ protected function _quoteInsert($query)
$query->insert($columns)->into($table);
}
/**
* Quotes the table name for an update query
*
* @param \Cake\Database\Query $query The update query to quote.
* @return void
*/
protected function _quoteUpdate($query)
{
$table = $query->clause('update')[0];
$query->update($this->_driver->quoteIdentifier($table));
}
/**
* Quotes identifiers in expression objects implementing the field interface
*

0 comments on commit e675998

Please sign in to comment.
You can’t perform that action at this time.