Doctrine 1
  1. Doctrine 1
  2. DC-602

Cardinality violation when searching phrase

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major 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) . ')';

        Activity

        There are no comments yet on this issue.

          People

          • Assignee:
            Jonathan H. Wage
            Reporter:
            Mishal
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: