Whole file
andialbrecht/sqlparse
The author described this change as “Fix get_token_at_offset behavior at edge”. It counts as a record because the check below fails on the code as it stood at ff0ee8399 and passes on 0c468f594, with nothing else changed between the two runs.
Projectandialbrecht/sqlparse
Fix saved2016-06-11
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 get_token_at_offset behavior at edge
The change
| 167 | 167 | idx = 0 | |
| 168 | 168 | for token in self.flatten(): | |
| 169 | 169 | end = idx + len(token.value) | |
| 170 | - | if idx <= offset <= end: | |
| 170 | + | if idx <= offset < end: | |
| 171 | 171 | return token | |
| 172 | 172 | idx = end | |
| 173 | 173 |
The check that tells the two apart
fail→pass·tests/test_parse.py::test_get_token_at_offset
Check file tests/test_parse.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 itff0ee839987c43c420f1a5d167e3c3c0e873411c
Broken version dated2016-06-11
Modulesqlparse.sql
Units changedTokenList
Fingerprintf936903735898d69
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.