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.

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

135135 T.Name, T.Number, T.Number.Float,
136136 T.Number.Integer, T.Literal,
137137 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))
139140 or (token.ttype is T.Keyword
140141 and token.value.upper() in ['NULL', ]))
141142 _group_left_right(tlist, T.Operator.Comparison, None, sql.Comparison,

The check that tells the two apart

failpass·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