Whole file
David-Wobrock/sqlvalidator
The author described this change as “Fix some newline problems”. It counts as a record because the check below fails on the code as it stood at e48827a36 and passes on 554746350, with nothing else changed between the two runs.
ProjectDavid-Wobrock/sqlvalidator
Fix saved2020-05-29
Sharing licenceMIT · LICENSE
Change size+15 −10
What the code was meant to do, written into the code itself as a save note
Fix some newline problems
The change
| 62 | 62 | yield elem3 | |
| 63 | 63 | else: | |
| 64 | 64 | for w1 in elem3.split(" "): | |
| 65 | - | for w2 in split_with_sep(w1, ","): | |
| 66 | - | for w3 in split_with_sep(w2, ";"): | |
| 67 | - | for w4 in split_with_sep(w3, "("): | |
| 68 | - | for w5 in split_with_sep(w4, ")"): | |
| 69 | - | for w6 in split_with_sep(w5, "+"): | |
| 70 | - | for w7 in split_with_sep(w6, "-"): | |
| 65 | + | for w2 in w1.split("\n"): | |
| 66 | + | for w3 in split_with_sep(w2, ","): | |
| 67 | + | for w4 in split_with_sep(w3, ";"): | |
| 68 | + | for w5 in split_with_sep(w4, "("): | |
| 69 | + | for w6 in split_with_sep(w5, ")"): | |
| 70 | + | for w7 in split_with_sep(w6, "+"): | |
| 71 | 71 | for w8 in split_with_sep( | |
| 72 | - | w7, "*" | |
| 72 | + | w7, "-" | |
| 73 | 73 | ): | |
| 74 | 74 | for w9 in split_with_sep( | |
| 75 | - | w8, "/" | |
| 75 | + | w8, "*" | |
| 76 | 76 | ): | |
| 77 | 77 | for ( | |
| 78 | 78 | w10 | |
| 79 | 79 | ) in split_with_sep( | |
| 80 | - | w9, "=" | |
| 80 | + | w9, "/" | |
| 81 | 81 | ): | |
| 82 | - | yield w10.lower() | |
| 82 | + | for ( | |
| 83 | + | w11 | |
| 84 | + | ) in split_with_sep( | |
| 85 | + | w10, "=" | |
| 86 | + | ): | |
| 87 | + | yield w11.lower() | |
| 83 | 88 |
The check that tells the two apart
fail→pass·tests/integration/test_file_formatting.py::test_format_file_multiline_sql
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 ite48827a3682ce9c82c75f967df207939c8c8ce31
Broken version dated2020-05-29
Modulesqlvalidator.grammar.tokeniser
Units changedto_tokens
Fingerprintc53da84f3bc20211
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
- 2022-04-15Fix #38 -- Handle nested case expressions
- 2021-12-22Fix #29 -- Handle strings containing others quotes
- 2021-12-22Fix #35 -- Handle index based access on function call
- 2021-12-22Fix #34 -- Handle parsing a function with a single comma string
- 2021-11-15Fix validating between predicate conditions
- 2021-11-15Fix handling Any return type as invalid WHERE/HAVING condition