You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
where('id', 2) will generate a bind in BaseBuilder with key id. orWhereIn('id', [3, 4]) will do the same.
We will end up with one bind, when we should have two.
The final query will end up like this
SELECT *
FROM `users`
WHERE `users`.`id` = (3,4)
OR `users`.`id` IN (3,4)
I see that you have already tried to deal with this issue by adding a setBind-method in BaseBuilder. But whereIn() does not use this method. I've tried replacing $this->binds[$ok] = $where_in;
With $this->setBind($ok, $where_in);
But this does not solve the problem. I still end up with a query like this
SELECT *
FROM `users`
WHERE `users`.`id` = 2
OR `users`.`id` IN 2
Unfortunately I do not have more time to look at this. I hope someone else with take a look :-)
The text was updated successfully, but these errors were encountered:
Will have to dig a little deeper when I have a little more time, but that's not a perfect fix. It needs to be fixed in the setBind method, since that helps to ensure that name collisions don't happen, etc.
jim-parry
added
the
bug
Verified issues on the current code behavior or pull requests that will fix them
label
Oct 19, 2018
Imagine this query.
where('id', 2)
will generate a bind in BaseBuilder with key id.orWhereIn('id', [3, 4])
will do the same.We will end up with one bind, when we should have two.
The final query will end up like this
I see that you have already tried to deal with this issue by adding a setBind-method in BaseBuilder. But whereIn() does not use this method. I've tried replacing
$this->binds[$ok] = $where_in;
With
$this->setBind($ok, $where_in);
But this does not solve the problem. I still end up with a query like this
Unfortunately I do not have more time to look at this. I hope someone else with take a look :-)
The text was updated successfully, but these errors were encountered: