Whole file

David-Wobrock/sqlvalidator

The author described this change as Fix query after condition 'is null'. It counts as a record because the check below fails on the code as it stood at 4a1d62acd and passes on e6d2d62dd, with nothing else changed between the two runs.

Fix saved2021-02-04
Sharing licenceMIT · LICENSE
Change size+8 6

What the code was meant to do, written into the code itself as a save note

Fix query after condition 'is null'

The change

493493 can_be_type=False,
494494 can_alias=True,
495495 until_one_of=None,
496+ first_token=None,
496497 ) -> Tuple[Expression, Any]:
497498 until_one_of = until_one_of or []
498499
499- main_token = next(tokens)
500+ main_token = first_token or next(tokens)
500501 next_token = None
501502
502503 if main_token in String.QUOTES:
725726 symbol = next_token
726727 if lower(next_token) == "is":
727728 next_next_token = next(tokens)
729+ first_token = None
728730 if lower(next_next_token) == "not":
729731 symbol = "is not"
730732 else:
731- tokens, _ = get_tokens_until_one_of(
732- tokens, [], first_token=next_next_token
733- )
734- tokens = iter(tokens)
733+ first_token = next_next_token
735734
736735 right_hand, next_token = ExpressionParser.parse(
737- tokens, is_right_hand=True, until_one_of=until_one_of
736+ tokens,
737+ is_right_hand=True,
738+ until_one_of=until_one_of,
739+ first_token=first_token,
738740 )
739741 expression = Condition(expression, symbol, right_hand)
740742 elif lower(next_token) == "between":

The check that tells the two apart

failpass·tests/unit/test_lexer.py::test_where_clause_keeps_generator_intact_is_null_condition

Check file tests/unit/test_lexer.py, taken without changes from the fix and copied onto the older code, so the exact same check runs against both versions.

Origin and history

The code before it4a1d62acdc4bb866b713fc36ae476d9e6ed91e8b
Broken version dated2021-02-04
Modulesqlvalidator.grammar.lexer
Units changedExpressionParser
Fingerprintf101bd158e1d315f
Checked2026-08-18 by goldset/0.1

Every field above is generated by our program. None of it is written by hand.

Other bugs found in David-Wobrock/sqlvalidator