Merging upstream version 10.4.2.
Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
parent
de4e42d4d3
commit
0c79f8b507
88 changed files with 1637 additions and 436 deletions
|
@ -164,9 +164,6 @@ class TestOptimizer(unittest.TestCase):
|
|||
with self.assertRaises(OptimizeError):
|
||||
optimizer.qualify_columns.qualify_columns(parse_one(sql), schema=self.schema)
|
||||
|
||||
def test_quote_identities(self):
|
||||
self.check_file("quote_identities", optimizer.quote_identities.quote_identities)
|
||||
|
||||
def test_lower_identities(self):
|
||||
self.check_file("lower_identities", optimizer.lower_identities.lower_identities)
|
||||
|
||||
|
@ -555,3 +552,29 @@ FROM READ_CSV('tests/fixtures/optimizer/tpc-h/nation.csv.gz', 'delimiter', '|')
|
|||
parse_one(f"SELECT {func}(x.{col}) AS _col_0 FROM x AS x"), schema=schema
|
||||
)
|
||||
self.assertEqual(expression.expressions[0].type.this, target_type)
|
||||
|
||||
def test_recursive_cte(self):
|
||||
query = parse_one(
|
||||
"""
|
||||
with recursive t(n) AS
|
||||
(
|
||||
select 1
|
||||
union all
|
||||
select n + 1
|
||||
FROM t
|
||||
where n < 3
|
||||
), y AS (
|
||||
select n
|
||||
FROM t
|
||||
union all
|
||||
select n + 1
|
||||
FROM y
|
||||
where n < 2
|
||||
)
|
||||
select * from y
|
||||
"""
|
||||
)
|
||||
|
||||
scope_t, scope_y = build_scope(query).cte_scopes
|
||||
self.assertEqual(set(scope_t.cte_sources), {"t"})
|
||||
self.assertEqual(set(scope_y.cte_sources), {"t", "y"})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue