summaryrefslogtreecommitdiff
path: root/tests/test_grouping.py
diff options
context:
space:
mode:
authorAndi Albrecht <andi@lap-pu35.prounix.local>2017-03-02 05:37:20 +0100
committerAndi Albrecht <andi@lap-pu35.prounix.local>2017-03-02 05:37:20 +0100
commit59033cc0ea75e160c87a68de6817cad06888cc38 (patch)
treee744c90531788586f2edbeeeb7bdfd1f3843ca55 /tests/test_grouping.py
parent0ea7cf49bd329bba28833a7e33c95b131c71a029 (diff)
downloadsqlparse-59033cc0ea75e160c87a68de6817cad06888cc38.tar.gz
Fix parsing of INTO keyword in WHERE clauses (fixes #324).
Diffstat (limited to 'tests/test_grouping.py')
-rw-r--r--tests/test_grouping.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/test_grouping.py b/tests/test_grouping.py
index 02d211e..72f94f6 100644
--- a/tests/test_grouping.py
+++ b/tests/test_grouping.py
@@ -210,6 +210,14 @@ def test_returning_kw_ends_where_clause():
assert p.tokens[7].value == 'returning'
+def test_into_kw_ends_where_clause(): # issue324
+ s = 'select * from foo where a = 1 into baz'
+ p = sqlparse.parse(s)[0]
+ assert isinstance(p.tokens[8], sql.Where)
+ assert p.tokens[9].ttype == T.Keyword
+ assert p.tokens[9].value == 'into'
+
+
@pytest.mark.parametrize('sql, expected', [
# note: typecast needs to be 2nd token for this test
('select foo::integer from bar', 'integer'),