[Dbix-class] update and join

Peter Rabbitson rabbit+dbic at rabbit.us
Thu Jan 22 10:26:10 GMT 2015


On 01/22/2015 11:12 AM, RAPPAZ Francois wrote:
> I'm checking with phpMyAdmin
>
> If I do
> $s->resultset('Dduser')->search_rs({iduser => 3})->update({id_credit => 22});
>
> UPDATE ddusers SET id_credit = ? WHERE ( iduser = ? ): '22', '3'
>
> The field is updated
>
> If I do
> $s->resultset('Ddref')->search_related_rs('RefUser',{ 'RefUser.iduser' => 3 })->update({id_credit => 22});
>
> UPDATE ddusers SET id_credit = ? WHERE (  iduser IN ( SELECT * FROM ( SELECT Ref
> User.iduser FROM ddrefs me  JOIN ddusers RefUser ON RefUser.iduser = me.iduser W
> HERE ( RefUser.iduser = ? ) ) `_forced_double_subquery` )  ): '22', '3'	
>
> It is not

This is... bizarre, and a *VERY* serious issue if indeed the case. I am 
trying to reproduce it locally, will get back to you in a bit...





More information about the DBIx-Class mailing list