Details
-
Type:
Bug
-
Status:
In Progress
-
Priority:
Major
-
Resolution: Unresolved
-
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.