Whole file

David-Wobrock/sqlvalidator

The author described this change as Fix #29 -- Handle strings containing others quotes. It counts as a record because the check below fails on the code as it stood at 870a71a72 and passes on 577459789, with nothing else changed between the two runs.

Fix saved2021-12-22
Sharing licenceMIT · LICENSE
Change size+4 1

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

Fix #29 -- Handle strings containing others quotes

The change

158158
159159
160160 def split_tokens(value: str):
161- for string_token in STRING_SPLIT_TOKENS:
161+ for string_token in sorted(
162+ STRING_SPLIT_TOKENS,
163+ key=lambda token: value.index(token) if token in value else (len(value) + 1),
164+ ):
162165 if string_token in value:
163166 yield from _split_on_string_token(string_token, value)
164167 return

The check that tells the two apart

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

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 it870a71a7201f39080f0892d3a2c631d4b3122f38
Broken version dated2021-12-22
Modulesqlvalidator.grammar.tokeniser
Units changedsplit_tokens
Fingerprinta4e0e54c557f1421
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