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

Add failing test for #177 #216

Open
wants to merge 3 commits into
base: 3.x
Choose a base branch
from
Open

Add failing test for #177 #216

wants to merge 3 commits into from

Conversation

harikt
Copy link
Member

@harikt harikt commented Feb 28, 2022

This one is interesting when you change the order it will work.

@harikt harikt changed the base branch from 5.x to 3.x February 28, 2022 12:46
@harikt harikt requested review from kenjis and koriym March 1, 2022 07:09
@kenjis
Copy link
Member

kenjis commented Mar 2, 2022

@harikt What do you want?

The test fails, because "::jsonb AND type in (:types)" goes into the if statement.

if (preg_match($this->skip, $part)) {
return $part;
}

@kenjis
Copy link
Member

kenjis commented Mar 2, 2022

protected function getParts(string $statement): array

Now

SELECT * FROM table WHERE type in (:types) AND removed = false AND data @> '{\"is_hidden\":false}'::jsonb

will be split into

0 = "SELECT * FROM table WHERE type in (:types) AND removed = false AND data @> "
1 = "'{\"is_hidden\":false}'"
2 = "::jsonb"

But should be

0 = "SELECT * FROM table WHERE type in (:types) AND removed = false AND data @> "
1 = "'{\"is_hidden\":false}'::jsonb"

@harikt
Copy link
Member Author

harikt commented Mar 3, 2022

@kenjis Your findings are very interesting.

What I am trying to show here is the test is failing. So we need to fix it. I didn't got the time to look into it.

If you find some time to fix it, please do send a PR.

I think this will be same for 5.x also.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants