Repository navigation
fix: filter logic — NULL handling, BETWEEN plugin path, IN/NOT IN (#706) - #718
Merged
Merged
Conversation
… IN NULL handling (#706)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes filter logic inconsistencies compared to TablePlus behavior. Three bugs fixed with 8 new exact-output tests.
Closes #706
Fixes
A.
= NULLauto-converts toIS NULL(matches TablePlus)Before:
col = NULL— always false in SQL, never matches NULL rowsAfter:
col IS NULL— correctly matches NULL rowsSame for
!= NULL→IS NOT NULL. Case-insensitive (null,Null,NULLall work).B. BETWEEN
secondValueincluded in plugin-dispatch pathBefore: Plugin tuple was
(column, operator, value)—secondValuedropped, BETWEEN broken for MSSQL and all plugin-implemented filter pathsAfter: BETWEEN values combined as
"value1,value2"in the tuple for plugin parsingD. IN/NOT IN with NULL values handled correctly
Before:
IN (1, NULL, 3)— SQLIN (NULL)never matches NULL rowsAfter:
(col IN (1, 3) OR col IS NULL)— compound condition handles NULL correctlySame for NOT IN:
(col NOT IN (1, 3) AND col IS NOT NULL)Tests added (8 new)
Test plan
=operator and valueNULL→ should match NULL rows!=operator and valueNULL→ should exclude NULL rowsINoperator and value1, NULL, 3→ should match rows with id 1, 3, or NULLBETWEENon MSSQL connection → should work correctly