Merging upstream version 22.2.0.
Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
parent
b13ba670fd
commit
2c28c49d7e
148 changed files with 68457 additions and 63176 deletions
|
@ -1,4 +1,4 @@
|
|||
from sqlglot import exp, parse_one
|
||||
from sqlglot import exp
|
||||
from sqlglot.errors import UnsupportedError
|
||||
from tests.dialects.test_dialect import Validator
|
||||
|
||||
|
@ -7,11 +7,18 @@ class TestOracle(Validator):
|
|||
dialect = "oracle"
|
||||
|
||||
def test_oracle(self):
|
||||
self.validate_identity("REGEXP_REPLACE('source', 'search')")
|
||||
parse_one("ALTER TABLE tbl_name DROP FOREIGN KEY fk_symbol", dialect="oracle").assert_is(
|
||||
exp.AlterTable
|
||||
self.validate_all(
|
||||
"SELECT CONNECT_BY_ROOT x y",
|
||||
write={
|
||||
"": "SELECT CONNECT_BY_ROOT(x) AS y",
|
||||
"oracle": "SELECT CONNECT_BY_ROOT x AS y",
|
||||
},
|
||||
)
|
||||
self.parse_one("ALTER TABLE tbl_name DROP FOREIGN KEY fk_symbol").assert_is(exp.AlterTable)
|
||||
|
||||
self.validate_identity("CREATE GLOBAL TEMPORARY TABLE t AS SELECT * FROM orders")
|
||||
self.validate_identity("CREATE PRIVATE TEMPORARY TABLE t AS SELECT * FROM orders")
|
||||
self.validate_identity("REGEXP_REPLACE('source', 'search')")
|
||||
self.validate_identity("TIMESTAMP(3) WITH TIME ZONE")
|
||||
self.validate_identity("CURRENT_TIMESTAMP(precision)")
|
||||
self.validate_identity("ALTER TABLE tbl_name DROP FOREIGN KEY fk_symbol")
|
||||
|
@ -88,6 +95,13 @@ class TestOracle(Validator):
|
|||
)
|
||||
self.validate_identity("SELECT TO_CHAR(-100, 'L99', 'NL_CURRENCY = '' AusDollars '' ')")
|
||||
|
||||
self.validate_all(
|
||||
"TO_CHAR(x)",
|
||||
write={
|
||||
"doris": "CAST(x AS STRING)",
|
||||
"oracle": "TO_CHAR(x)",
|
||||
},
|
||||
)
|
||||
self.validate_all(
|
||||
"SELECT TO_CHAR(TIMESTAMP '1999-12-01 10:00:00')",
|
||||
write={
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue