Sounds like you should look into a join or whereHas instead. What is $array_ids ? The issue is most likely from you sql server that has a max of 1000 bound parameters
Mar 29, 2022
6
Level 1
WhereIn array length limited?
Hi, i got a problem when the array size of "$array_id" of this query goes over 1000.
$services = Service::whereIn('id', $array_id)->get();
This just return 0 instance of Service when the $array_id contains more than 1000 id, at 999 array size the query works just fine. I got this problem only on my production server, it works as expected in local enviroment. Im guessing of some bad configuration over php or mysql, some one can help me?
Level 102
Did some digging and it seems to have been reported as a bug here: https://jira.mariadb.org/browse/MDEV-27937
1 like
Please or to participate in this conversation.