Whole file

David-Wobrock/sqlvalidator

The author described this change as Fix variable leaking from one condition to another. It counts as a record because the check below fails on the code as it stood at f6462b9d0 and passes on f3c23ee79, with nothing else changed between the two runs.

Fix saved2021-02-14
Sharing licenceMIT · LICENSE
Change size+1 2

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

Fix variable leaking from one condition to another

The change

755755 return expression, next_token
756756
757757 if lower(next_token) in Condition.PREDICATES:
758+ first_token = None
758759 symbol = next_token
759760 if lower(next_token) == "is":
760761 next_next_token = next(tokens)
761- first_token = None
762762 if lower(next_next_token) == "not":
763763 symbol = "is not"
764764 else:
765765 first_token = next_next_token
766766 elif lower(next_token) == "not":
767767 next_next_token = next(tokens)
768- first_token = None
769768 if lower(next_next_token) == "in":
770769 symbol = "not in"
771770 else:

The check that tells the two apart

failpass·tests/integration/test_formatting.py::test_count_equal_countif

Check file tests/integration/test_formatting.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 itf6462b9d024d29dc68a1804c6e3de1c8f3c286d0
Broken version dated2021-02-06
Modulesqlvalidator.grammar.lexer
Units changedExpressionParser
Fingerprint88bc7d77009be622
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