Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Between condition with parentheses lead to strange state #175

Open
serge-kilimoff opened this issue Sep 29, 2022 · 1 comment
Open

Between condition with parentheses lead to strange state #175

serge-kilimoff opened this issue Sep 29, 2022 · 1 comment
Assignees
Labels
Milestone

Comments

@serge-kilimoff
Copy link

serge-kilimoff commented Sep 29, 2022

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
Copy link
Collaborator

kwhat commented Sep 30, 2022

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!

@kwhat kwhat added the bug label Sep 30, 2022
@kwhat kwhat modified the milestones: v2.2.1, 2.2.2 Sep 30, 2022
@kwhat kwhat self-assigned this Sep 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants