1
0
Fork 0

Adding upstream version 26.16.2.

Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
Daniel Baumann 2025-04-25 07:26:56 +02:00
parent 4bfa0e7e53
commit 6e767a6f98
Signed by: daniel
GPG key ID: FBB4F0E80A80222F
110 changed files with 62370 additions and 61414 deletions

View file

@ -176,6 +176,11 @@ class TestOptimizer(unittest.TestCase):
expected,
actual,
)
for expression in optimized.walk():
for arg_key, arg in expression.args.items():
if isinstance(arg, exp.Expression):
self.assertEqual(arg_key, arg.arg_key)
self.assertIs(arg.parent, expression)
if string_to_bool(execute):
with self.subTest(f"(execute) {title}"):
@ -533,6 +538,11 @@ class TestOptimizer(unittest.TestCase):
def test_simplify(self):
self.check_file("simplify", simplify)
# Stress test with huge union query
union_sql = "SELECT 1 UNION ALL " * 1000 + "SELECT 1"
expression = parse_one(union_sql)
self.assertEqual(simplify(expression).sql(), union_sql)
# Ensure simplify mutates the AST properly
expression = parse_one("SELECT 1 + 2")
simplify(expression.selects[0])