Skip to content

UNION scan of remainder looks too deep for parentheses#293

Merged
greenlion merged 3 commits intogreenlion:masterfrom
jcgatica:Union-subselect-with-groups
Oct 1, 2020
Merged

UNION scan of remainder looks too deep for parentheses#293
greenlion merged 3 commits intogreenlion:masterfrom
jcgatica:Union-subselect-with-groups

Conversation

@jcgatica
Copy link
Copy Markdown
Contributor

An expression such as

SELECT * FROM SOFTWARE WHERE (DISPLAY_NAME like "a%") UNION ALL SELECT * FROM SOFTWARE WHERE (DISPLAY_NAME like "b%")

Will fail, since the current logic will scan inside the sub-select, and extract whatever is inside the set of parentheses inside of it. My update modifies the logic to only look for a parenthesis in the very first nonempty token. The unit tests
tests/cases/parser/issue95Test.php, tests/cases/parser/unionTest.php, and tests/cases/creator/unionTest.php all run to completion with my change.

I would appreciate getting this fix in the codebase. Thank you for your help!

@greenlion
Copy link
Copy Markdown
Owner

Can you investigate the test failures?

@greenlion greenlion merged commit fef5bc3 into greenlion:master Oct 1, 2020
greenlion added a commit that referenced this pull request Oct 1, 2020
greenlion added a commit that referenced this pull request Oct 1, 2020
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.

2 participants