Doctrine 2 - ORM
  1. Doctrine 2 - ORM
  2. DDC-2214

extra single quotation in sql when using EntityRepository::findBy

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.4
    • Component/s: None
    • Security Level: All
    • Labels:
      None

      Description

      I'm using symfony 2.1 with mysql.

      I have following code:

      $related = 
      $this->getDoctrine()->getRepository('MyWebBundle:LineRelated')
      ->findBy(array('line' => $lines), array('count' => 'DESC'), 20);
      

      that generate the sql like this:

      SELECT *
      FROM line_related t0 
      WHERE t0.line_id IN ('6059', 126352, '5677', '6058') 
      ORDER BY t0.count DESC 
      LIMIT 20
      

      please notice that the sql has extra single quotation around the number 6059,5677 and 6058. which make the sql very slow.

      I did a test, when using single quotation,the sql takes 300ms,when using without single quotation,the sql takes 1 ms.

        Activity

          People

          • Assignee:
            Marco Pivetta
            Reporter:
            scourgen
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: