Whole file
andialbrecht/sqlparse
The author described this change as “Fix #230 (function comparison grouping)”. It counts as a record because the check below fails on the code as it stood at ee5799fbb and passes on c63737f9d, with nothing else changed between the two runs.
Projectandialbrecht/sqlparse
Fix saved2016-04-05
Sharing licenceBSD-3-Clause · LICENSE
Change size+2 −1
What the code was meant to do, written into the code itself as a save note
Fix #230 (function comparison grouping)
The change
| 135 | 135 | T.Name, T.Number, T.Number.Float, | |
| 136 | 136 | T.Number.Integer, T.Literal, | |
| 137 | 137 | T.Literal.Number.Integer, T.Name.Placeholder) | |
| 138 | - | or isinstance(token, (sql.Identifier, sql.Parenthesis)) | |
| 138 | + | or isinstance(token, (sql.Identifier, sql.Parenthesis, | |
| 139 | + | sql.Function)) | |
| 139 | 140 | or (token.ttype is T.Keyword | |
| 140 | 141 | and token.value.upper() in ['NULL', ])) | |
| 141 | 142 | _group_left_right(tlist, T.Operator.Comparison, None, sql.Comparison, |
The check that tells the two apart
fail→pass·tests/test_grouping.py::test_comparison_with_functions
Check file tests/test_grouping.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 itee5799fbb60e9739e42922861cd9f24990fc52dd
Broken version dated2016-04-03
Modulesqlparse.engine.grouping
Units changedgroup_comparison
Fingerprint823f2be261258582
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.