1
0
Fork 0

Merging upstream version 17.11.0.

Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
Daniel Baumann 2025-02-13 20:51:40 +01:00
parent 2bd548fc43
commit 14ca349bca
Signed by: daniel
GPG key ID: FBB4F0E80A80222F
69 changed files with 30974 additions and 30030 deletions

View file

@ -219,6 +219,9 @@ class TestParser(unittest.TestCase):
with self.assertRaises(ParseError):
parse_one("WITH cte AS (SELECT * FROM x)")
with self.assertRaises(ParseError):
parse_one("SELECT foo( FROM bar")
self.assertEqual(
parse_one(
"CREATE TABLE t (i UInt8) ENGINE = AggregatingMergeTree() ORDER BY tuple()",
@ -694,3 +697,14 @@ class TestParser(unittest.TestCase):
def test_parse_floats(self):
self.assertTrue(parse_one("1. ").is_number)
def test_parse_terse_coalesce(self):
self.assertIsNotNone(parse_one("SELECT x ?? y FROM z").find(exp.Coalesce))
self.assertEqual(
parse_one("SELECT a, b ?? 'No Data' FROM z").sql(),
"SELECT a, COALESCE(b, 'No Data') FROM z",
)
self.assertEqual(
parse_one("SELECT a, b ?? c ?? 'No Data' FROM z").sql(),
"SELECT a, COALESCE(COALESCE(b, c), 'No Data') FROM z",
)