Permalink
Browse files

I don't know if this is the best way to do it, but this kind of valid…

…ation is necessary because on some RDBMS (like PostgreSQL) you can't compare an integer field to a string value, it will generate an error, as it can't compare different data types.
  • Loading branch information...
1 parent 164ccc3 commit f6d40d02f119d25af9e2687e5ca9f5d3feb84958 @rsandrea committed Apr 1, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 library/Zend/Db/Sql/Predicate/Operator.php
@@ -222,7 +222,7 @@ public function getRightType()
public function getWhereParts()
{
return array(array(
- '%s ' . $this->operator . ' %s',
+ (is_int($this->left)? '%d ':'%s ') . $this->operator . (is_int($this->right)? ' %d':' %s'),
array($this->left, $this->right),
array($this->leftType, $this->rightType)
));

0 comments on commit f6d40d0

Please sign in to comment.