From e6d86edf4454153c655ba548b5698a4dbe5a10fd Mon Sep 17 00:00:00 2001 From: Andi Albrecht Date: Mon, 3 Mar 2014 07:55:06 +0100 Subject: Improve handling of NULL in aliased identifiers. --- tests/test_regressions.py | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'tests') diff --git a/tests/test_regressions.py b/tests/test_regressions.py index 395c2b6..e30ddf0 100644 --- a/tests/test_regressions.py +++ b/tests/test_regressions.py @@ -233,3 +233,14 @@ def test_except_formatting(): 'WHERE 1 = 2' ]) assert formatted == tformatted + + +def test_null_with_as(): + sql = 'SELECT NULL AS c1, NULL AS c2 FROM t1' + formatted = sqlparse.format(sql, reindent=True) + tformatted = '\n'.join([ + 'SELECT NULL AS c1,', + ' NULL AS c2', + 'FROM t1' + ]) + assert formatted == tformatted \ No newline at end of file -- cgit v1.2.1