Fabio B. Silva
added a comment - 27/Dec/12 7:41 PM Hi,
How did you get this query string ?
Repository#findBy does not quote the values, It uses PDO:bindParam.
so the expected query string should be someting like :
WHERE t0.line_id IN (?, ? ,?)
I tried to reproduce but in my tests the generated Query binds the parameters as "PDO::PARAM_INT".
I have added a test case.
Could you please can try to change it and make fails.
Cheers

interesting. I've dump(using ladybug_dump) the $lines,and I found out that when the element is a Proxies Object(Object(Proxies_GC_\My\WebBundle\Entity\Line)),then the id of that Object will be with quoted,when the elememt is an Real Entity,then It will be without quote.

for example,in my last comment, the parameters is [['6059', 4851, '6068', 126352, '6060', '1000000']]
the result of dumping $lines is :

Marco Pivetta
added a comment - 28/Dec/12 9:16 AM - edited This may be because
$_identifier
in proxies ( https://github.com/doctrine/doctrine2/blob/42e83a2716d19eada4f1cd49ece77d5f5229a239/lib/Doctrine/ORM/Proxy/ProxyFactory.php#L383 ) is not necessarily composed by integers. This could be fixed with DCOM-96 . I'll add the tests to my development branch and will ping you back tomorrow

Marco Pivetta
added a comment - 06/Jan/13 2:24 PM I see what is going on here... But this should not be a problem anyway, since they're bound anyway as "PDO::PARAM_INT", as Fabio B. Silva told you.
That's only a problem with the logger showing them as string. PDO will handle the conversion before the value hits the DB as far as I know.

I can understand your point,but what I don't really get is that the execute time of sql is very long,that explained the quote should be in the sql,not like what you said,that's only a problem with the logger.

scourgen
added a comment - 07/Jan/13 3:48 AM I can understand your point,but what I don't really get is that the execute time of sql is very long,that explained the quote should be in the sql,not like what you said,that's only a problem with the logger.

scourgen
added a comment - 07/Jan/13 8:53 AM @ocramius I wish I could, but I was using doctrine2 with symfony2,So It looks like It will takes some time to simulating all environment and settings that could allow me to reproduced the problem.
but anyway,I will have a try and tell you what happen when I found something.

I've spent some time on playing with native doctrine2. It took me awhile to setup everything. but I just don't get that how to retrive data with its Proxy ojbect(for example Proxies_CG_\My\WebBundle\Entity\Line).

I mean the result of

$this->_em->getRepository("something")->findxxx()

always return an array of real object. I can't reproduced the situation(#comment-19186) that happens on symfony2+doctrine2.

anyway,I can make sure the problem is real exist,Because the execute time of that slow sql from the tool bar of symfony2 is same as I executed it at mysql cli. If the sql shows up on log with quote but running at mysql without quote,the execute time won't be same(actually It will be much more faster,in my case,20x times,from 2xxms to 10ms).

scourgen
added a comment - 07/Jan/13 5:48 PM - edited I've spent some time on playing with native doctrine2. It took me awhile to setup everything. but I just don't get that how to retrive data with its Proxy ojbect(for example Proxies_CG_\My\WebBundle\Entity\Line).
I mean the result of
$ this ->_em->getRepository( "something" )->findxxx()
always return an array of real object. I can't reproduced the situation(#comment-19186) that happens on symfony2+doctrine2.
anyway,I can make sure the problem is real exist,Because the execute time of that slow sql from the tool bar of symfony2 is same as I executed it at mysql cli. If the sql shows up on log with quote but running at mysql without quote,the execute time won't be same(actually It will be much more faster,in my case,20x times,from 2xxms to 10ms).