Whole file

David-Wobrock/sqlvalidator

The author described this change as Fix wrong positive in SQL parsing. It counts as a record because the check below fails on the code as it stood at 0a343e0af and passes on 683388a48, with nothing else changed between the two runs.

Fix saved2020-12-31
Sharing licenceMIT · LICENSE
Change size+5 1

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

Fix wrong positive in SQL parsing

The change

9191
9292
9393 def is_select_string(token_value: str) -> bool:
94- return token_value.lower().lstrip(" \n'\"`ufbr").startswith("select")
94+ cleaned_value = token_value.lower().lstrip(" \n'\"`ufbr")
95+ lines = cleaned_value.splitlines()
96+ if not lines:
97+ return False
98+ return lines[0].split(" ", maxsplit=1)[0] == "select"
9599
96100
97101 def get_formatted_file_content(file: IO) -> Tuple[int, str]:

The check that tells the two apart

failpass·tests/integration/test_file_formatting.py::test_string_starting_with_selected

Check file tests/integration/test_file_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 it0a343e0afdf388bf0eb9aeab4a4cb3d3c18a8b0f
Broken version dated2020-12-31
Modulesqlvalidator.file_formatter
Units changedis_select_string
Fingerprint04c69dd555fce6f3
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