Commit 14464471 authored by romanb's avatar romanb

Fixed #673.

parent 79b79909
...@@ -757,11 +757,11 @@ class Doctrine_Query extends Doctrine_Query_Abstract implements Countable, Seria ...@@ -757,11 +757,11 @@ class Doctrine_Query extends Doctrine_Query_Abstract implements Countable, Seria
. $this->_conn->quoteIdentifier($field); . $this->_conn->quoteIdentifier($field);
} else { } else {
// build sql expression // build sql expression
$field = $this->getRoot()->getColumnName($field);
$term[0] = $this->_conn->quoteIdentifier($field); $term[0] = $this->_conn->quoteIdentifier($field);
} }
} }
} else { } else {
if ( ! empty($term[0]) && if ( ! empty($term[0]) &&
! in_array(strtoupper($term[0]), self::$_keywords) && ! in_array(strtoupper($term[0]), self::$_keywords) &&
! is_numeric($term[0])) { ! is_numeric($term[0])) {
...@@ -775,13 +775,12 @@ class Doctrine_Query extends Doctrine_Query_Abstract implements Countable, Seria ...@@ -775,13 +775,12 @@ class Doctrine_Query extends Doctrine_Query_Abstract implements Countable, Seria
$table = $this->_queryComponents[$componentAlias]['table']; $table = $this->_queryComponents[$componentAlias]['table'];
// check column existence // check column existence
if ($table->hasColumn($term[0])) { if ($table->hasField($term[0])) {
$found = true; $found = true;
$def = $table->getDefinitionOf($term[0]); $def = $table->getDefinitionOf($term[0]);
// get the actual column name from alias // get the actual column name from field name
$term[0] = $table->getColumnName($term[0]); $term[0] = $table->getColumnName($term[0]);
......
...@@ -77,7 +77,7 @@ class Doctrine_Query_Where extends Doctrine_Query_Condition ...@@ -77,7 +77,7 @@ class Doctrine_Query_Where extends Doctrine_Query_Condition
} }
} }
$first = $this->query->parseClause($first); $first = $this->query->parseClause($first);
$sql = $first . ' ' . $operator . ' ' . $this->parseValue($value, $table, $field); $sql = $first . ' ' . $operator . ' ' . $this->parseValue($value, $table, $field);
return $sql; return $sql;
......
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