diff options
| author | Andi Albrecht <albrecht.andi@gmail.com> | 2017-09-24 08:54:01 +0200 |
|---|---|---|
| committer | Andi Albrecht <albrecht.andi@gmail.com> | 2017-09-24 08:54:01 +0200 |
| commit | 097478e47fbc0423118f82a0a7b458c2e9dbea7b (patch) | |
| tree | 8223f37023fc85d96277b071c8a59cd667f44c54 /tests | |
| parent | d7a290c43708b3a743472db34e0519159d8ee134 (diff) | |
| download | sqlparse-097478e47fbc0423118f82a0a7b458c2e9dbea7b.tar.gz | |
Fix handling of semicolon when grouping assignments (fixes #359).
When grouping assignments that contain a semicolon itself, the
engine was too greedy. Assignments with semicolon were introduced
in 691c0400e5a7d8229b7dce09bf47176539add328.
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/test_regressions.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/test_regressions.py b/tests/test_regressions.py index cc553c2..89828f0 100644 --- a/tests/test_regressions.py +++ b/tests/test_regressions.py @@ -356,3 +356,13 @@ def test_issue322_concurrently_is_keyword(): assert p.tokens[4].value == 'CONCURRENTLY' assert isinstance(p.tokens[6], sql.Identifier) assert p.tokens[6].value == 'myindex' + + +@pytest.mark.parametrize('s', [ + 'SELECT @min_price:=MIN(price), @max_price:=MAX(price) FROM shop;', + 'SELECT @min_price:=MIN(price), @max_price:=MAX(price) FROM shop', + +]) +def test_issue359_index_error_assignments(s): + sqlparse.parse(s) + sqlparse.format(s, strip_comments=True) |
