Commit 7556bfcb authored by zYne's avatar zYne

Fixed DELETE handling, fixes #236

parent 57fee969
...@@ -445,11 +445,20 @@ class Doctrine_Query extends Doctrine_Hydrate implements Countable { ...@@ -445,11 +445,20 @@ class Doctrine_Query extends Doctrine_Hydrate implements Countable {
public function isLimitSubqueryUsed() { public function isLimitSubqueryUsed() {
return $this->limitSubqueryUsed; return $this->limitSubqueryUsed;
} }
/**
* getQueryBase
* returns the base of the generated sql query
* On mysql driver special strategy has to be used for DELETE statements
*
* @return string the base of the generated sql query
*/
public function getQueryBase() { public function getQueryBase() {
switch($this->type) { switch($this->type) {
case self::DELETE: case self::DELETE:
$q = 'DELETE FROM '; if($this->conn->getName() == 'mysql')
$q = 'DELETE '.end($this->tableAliases).' FROM ';
else
$q = 'DELETE FROM ';
break; break;
case self::UPDATE: case self::UPDATE:
$q = 'UPDATE '; $q = 'UPDATE ';
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment