From 693d7a31c1fff960763ff3ba485142ce67ff708f Mon Sep 17 00:00:00 2001 From: Andi Albrecht Date: Sun, 24 Jul 2011 00:37:47 +0200 Subject: Split statements with IF as functions correctly (fixes issue33). --- tests/test_split.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'tests/test_split.py') diff --git a/tests/test_split.py b/tests/test_split.py index 1995ca5..a794b76 100644 --- a/tests/test_split.py +++ b/tests/test_split.py @@ -103,3 +103,10 @@ class SQLSplitTest(TestCaseBase): 'SELECT 2;') stmts = sqlparse.split(sql) self.assertEqual(len(stmts), 2) + + def test_if_function(self): # see issue 33 + # don't let IF as a function confuse the splitter + sql = ('CREATE TEMPORARY TABLE tmp SELECT IF(a=1, a, b) AS o FROM one; ' + 'SELECT t FROM two') + stmts = sqlparse.split(sql) + self.assertEqual(len(stmts), 2) -- cgit v1.2.1