Whole file
andialbrecht/sqlparse
The author described this change as “Fix handling of semicolon when grouping assignments (fixes #359).”. It counts as a record because the check below fails on the code as it stood at d7a290c43 and passes on 097478e47, with nothing else changed between the two runs.
Projectandialbrecht/sqlparse
Fix saved2017-09-24
Sharing licenceBSD-3-Clause · LICENSE
Change size+1 −1
What the code was meant to do, written into the code itself as a save note
Fix handling of semicolon when grouping assignments (fixes #359).
The change
| 134 | 134 | return token.match(T.Assignment, ':=') | |
| 135 | 135 | ||
| 136 | 136 | def valid(token): | |
| 137 | - | return token is not None | |
| 137 | + | return token is not None and token.ttype not in (T.Keyword) | |
| 138 | 138 | ||
| 139 | 139 | def post(tlist, pidx, tidx, nidx): | |
| 140 | 140 | m_semicolon = T.Punctuation, ';' |
The check that tells the two apart
fail→pass·tests/test_regressions.py::test_issue359_index_error_assignments[SELECT
Check file tests/test_regressions.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 itd7a290c43708b3a743472db34e0519159d8ee134
Broken version dated2017-09-21
Modulesqlparse.engine.grouping
Units changedgroup_assignment
Fingerprintf55912b7c9099d6f
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 andialbrecht/sqlparse
- 2026-07-25Fix get_real_name for names with more than two dotted parts (#332)
- 2026-07-22Fix function grouping skipped for lowercase 'as' in CREATE TABLE AS SELECT
- 2025-11-29StatementSplitter
- 2025-11-28StatementSplitter
- 2024-07-15StatementSplitter
- 2024-04-13Raise SQLParseError instead of RecursionError.