🐛 Incorrect insertion of FragmentInterface parameters into WHERE IN queries
No duplicates 🥲.
- [X] I have searched for a similar issue in our bug tracker and didn't find any solutions.
Database
MySQL
What happened?
Continue of #145
$products = $this->select()->andWhere('productGuid', 'IN', $productGuids)->fetchData();
with empty array $productGuids resulting the following sql:
AND `xxx`.`ProductGuid` IN()
and database error is raised, as there is nothing in IN
Version
database 2.8.1
PHP 8.3
Hi. What do you expect from ORM in case of passing an empty list?
Hi, maybe not to generate AND xxx.ProductGuid IN() at all?
Hi, maybe not to generate
AND xxx.ProductGuid IN()at all?
or generate FALSE instead? because the IN operator is used to define a white list. And if the list is empty it equals to FALSE
Yet another option -- generate xxx.ProductGuid is null. Wny not?
The values list has no values. Shouldn't we check that field has no value too? :)