FaaPz/PDO

Between condition with parentheses lead to strange state

serge-kilimoff opened this issue · 1 comments

Hi,

When I write something like that :

        $db
            ->select()
            ->columns(['col1' => 'C1', 'col2' => 'C2'])
            ->from('table')
            ->where(new Grouping('AND', ...[
                new Conditional('C2', 'BETWEEN', ['2022-01-01', '2022-12-31']),
                new Conditional('C1', '=', 'OK'),
            ]));

the "between" clause is writing like that :

C2 BETWEEN ('2022-01-01' AND '2022-12-31') AND C1 = 'OK'

It's not working like expected because : https://dba.stackexchange.com/a/251542

(And I cannot passing array like second argument in Grouping, php raise an Exception. The doc seem to say "it's okay with an array")

For informations, i use php 7.2 and mariadb 10.3.

Thanks !

kwhat commented

Really? How bizarre. I need to look into this a little further but I will try to get this fixed next week.

Thanks for reporting!