Details
-
Type:
Bug
-
Status:
Resolved
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: 1.2.2
-
Component/s: Searchable
-
Labels:None
Description
Im have setup search behaviour for my model.
Searching phrase "foo bar" throws "Doctrine_Connection_Mysql_Exception"
SQLSTATE[21000]: Cardinality violation: 1242 Subquery returns more than 1 row
To fix the issue replace line 208 in file: Doctrine/Search/Query.php
$where .= ' AND (position + ' . $k . ') = (SELECT position FROM ' . $this->_table->getTableName() . ' WHERE ' . $this->parseWord($word) . ')';
with:
$where .= ' AND (position + ' . $k . ') IN (SELECT position FROM ' . $this->_table->getTableName() . ' WHERE ' . $this->parseWord($word) . ')';