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

Fix regression WHERE (not) in (4.2.0) #1830

Merged
merged 10 commits into from
Nov 12, 2023

Conversation

paulrutter
Copy link
Contributor

Fix for #1829.

  • Fix regression when using IN / NOT IN
  • Using refs didn't work anymore
  • Dropped set cache, as it's not really needed unless the same queries are performed often
  • Added unit test to guard behavior

- Add pattern cache when using like (building RegEx is expensive)
- Optimize when having lots of values in a (NOT) IN statement, using JS Set
- Remove RegEx checking for DATE function
- When using NOW, just return the date (not sure why a date is translated to a string and then to a date again)
- Adjust or skip unit tests
- Remove cache property
- Fix LIKE unit tests by not using toUpperCase() anymore; use same code as before, but now with a patternCache
- Always use SET, remove old code
- Made returning Date objects configurable as option, to remain backwards compatible
- Added unit test for Date objects in relevant test cases
- Fix using new String in IN statement
- Add new test cases for using plain string literals in both IN and NOT IN
- Fix regression when using IN / NOT IN
- Using refs didn't work anymore
- Dropped set cache, as it's not really needed unless the same queries are performed often
- Added unit test to guard behavior
@paulrutter paulrutter changed the title Maintenance/fix regression not in Fix regression WHERE (not) in (4.2.0) Nov 10, 2023
@paulrutter
Copy link
Contributor Author

paulrutter commented Nov 10, 2023

@mathiasrw Some regression introduced in 4.2.0, this PR fixes it.
I removed the Set cache as i couldn't get it to work with passing references. It would still be beneficial when running the same query with lots of IN values against different data though, but we might add that back in later.

See the new unit test.

@mathiasrw
Copy link
Member

Thank you so much for acting on this rapidly.

@mathiasrw mathiasrw merged commit e5c6632 into AlaSQL:develop Nov 12, 2023
10 checks passed
@mathiasrw
Copy link
Member

Released as part of 4.2.1

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