Adding upstream version 26.16.2.
Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
parent
4bfa0e7e53
commit
6e767a6f98
110 changed files with 62370 additions and 61414 deletions
|
@ -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])
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue