diff options
| author | Andi Albrecht <albrecht.andi@gmail.com> | 2016-04-06 09:41:31 +0200 |
|---|---|---|
| committer | Andi Albrecht <albrecht.andi@gmail.com> | 2016-04-06 09:41:31 +0200 |
| commit | 9ab1464ea9c1d0296d698d9637ed3e3cd92326f9 (patch) | |
| tree | fa0b598c77018f2bd0bbfc985f4086548f10b11b /tests | |
| parent | baeea12b776b1f4477ee5af80aaa2e7c44fadf0e (diff) | |
| download | sqlparse-9ab1464ea9c1d0296d698d9637ed3e3cd92326f9.tar.gz | |
Improve identifier parsing when identifier is a literal combined with order keyword (fixes #101).
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/test_grouping.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/test_grouping.py b/tests/test_grouping.py index 9a9dd6a..7dc1269 100644 --- a/tests/test_grouping.py +++ b/tests/test_grouping.py @@ -140,6 +140,12 @@ class TestGrouping(TestCaseBase): self.assert_(isinstance(p.tokens[0].tokens[0], sql.Identifier)) self.assert_(isinstance(p.tokens[0].tokens[3], sql.Identifier)) + def test_identifier_list_with_order(self): # issue101 + p = sqlparse.parse('1, 2 desc, 3')[0] + self.assert_(isinstance(p.tokens[0], sql.IdentifierList)) + self.assert_(isinstance(p.tokens[0].tokens[3], sql.Identifier)) + self.ndiffAssertEqual(u(p.tokens[0].tokens[3]), '2 desc') + def test_where(self): s = 'select * from foo where bar = 1 order by id desc' p = sqlparse.parse(s)[0] |
