1
0
Fork 0

Merging upstream version 26.19.0.

Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
Daniel Baumann 2025-05-24 07:15:28 +02:00
parent 58527c3d26
commit a99682f526
Signed by: daniel
GPG key ID: FBB4F0E80A80222F
98 changed files with 67345 additions and 65319 deletions

View file

@ -1,4 +1,4 @@
from sqlglot import exp, UnsupportedError
from sqlglot import exp, UnsupportedError, ParseError, parse_one
from tests.dialects.test_dialect import Validator
@ -47,6 +47,9 @@ class TestOracle(Validator):
self.validate_identity("SELECT * FROM V$SESSION")
self.validate_identity("SELECT TO_DATE('January 15, 1989, 11:00 A.M.')")
self.validate_identity("SELECT INSTR(haystack, needle)")
self.validate_identity(
"SELECT * FROM consumer LEFT JOIN groceries ON consumer.groceries_id = consumer.id PIVOT(MAX(type_id) FOR consumer_type IN (1, 2, 3, 4))"
)
self.validate_identity(
"SELECT * FROM test UNPIVOT INCLUDE NULLS (value FOR Description IN (col AS 'PREFIX ' || CHR(38) || ' SUFFIX'))"
)
@ -320,6 +323,7 @@ class TestOracle(Validator):
},
)
self.validate_identity("CREATE OR REPLACE FORCE VIEW foo1.foo2")
self.validate_identity("TO_TIMESTAMP('foo')")
def test_join_marker(self):
self.validate_identity("SELECT e1.x, e2.x FROM e e1, e e2 WHERE e1.y (+) = e2.y")
@ -522,6 +526,8 @@ FROM JSON_TABLE(res, '$.info[*]' COLUMNS(
)) src""",
pretty=True,
)
self.validate_identity("CONVERT('foo', 'dst')")
self.validate_identity("CONVERT('foo', 'dst', 'src')")
def test_connect_by(self):
start = "START WITH last_name = 'King'"
@ -702,3 +708,11 @@ CONNECT BY PRIOR employee_id = manager_id AND LEVEL <= 4"""
self.validate_identity(
"ANALYZE TABLE tbl VALIDATE STRUCTURE CASCADE COMPLETE OFFLINE INTO db.tbl"
)
def test_prior(self):
self.validate_identity(
"SELECT id, PRIOR name AS parent_name, name FROM tree CONNECT BY NOCYCLE PRIOR id = parent_id"
)
with self.assertRaises(ParseError):
parse_one("PRIOR as foo", read="oracle")