diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2023-09-07 11:39:43 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2023-09-07 11:39:43 +0000 |
commit | 341eb1a6bdf0dd5b015e5140d3b068c6fd3f4d87 (patch) | |
tree | 61fb7eca2238fb5d41d3906f4af41de03abd25ea /tests/dialects/test_oracle.py | |
parent | Adding upstream version 17.12.0. (diff) | |
download | sqlglot-341eb1a6bdf0dd5b015e5140d3b068c6fd3f4d87.tar.xz sqlglot-341eb1a6bdf0dd5b015e5140d3b068c6fd3f4d87.zip |
Adding upstream version 18.2.0.upstream/18.2.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/dialects/test_oracle.py')
-rw-r--r-- | tests/dialects/test_oracle.py | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/tests/dialects/test_oracle.py b/tests/dialects/test_oracle.py index 0c3b09f..01a9ca3 100644 --- a/tests/dialects/test_oracle.py +++ b/tests/dialects/test_oracle.py @@ -6,6 +6,11 @@ class TestOracle(Validator): dialect = "oracle" def test_oracle(self): + self.validate_identity("SELECT JSON_OBJECT('name': first_name || ' ' || last_name) FROM t") + self.validate_identity("COALESCE(c1, c2, c3)") + self.validate_identity("SELECT * FROM TABLE(foo)") + self.validate_identity("SELECT a$x#b") + self.validate_identity("SELECT :OBJECT") self.validate_identity("SELECT * FROM t FOR UPDATE") self.validate_identity("SELECT * FROM t FOR UPDATE WAIT 5") self.validate_identity("SELECT * FROM t FOR UPDATE NOWAIT") @@ -21,6 +26,9 @@ class TestOracle(Validator): self.validate_identity("SELECT * FROM table_name SAMPLE (25) s") self.validate_identity("SELECT * FROM V$SESSION") self.validate_identity( + "SELECT COUNT(1) INTO V_Temp FROM TABLE(CAST(somelist AS data_list)) WHERE col LIKE '%contact'" + ) + self.validate_identity( "SELECT MIN(column_name) KEEP (DENSE_RANK FIRST ORDER BY column_name DESC) FROM table_name" ) self.validate_identity( @@ -28,12 +36,16 @@ class TestOracle(Validator): 'OVER (PARTITION BY department_id) AS "Worst", MAX(salary) KEEP (DENSE_RANK LAST ORDER BY commission_pct) ' 'OVER (PARTITION BY department_id) AS "Best" FROM employees ORDER BY department_id, salary, last_name' ) + self.validate_identity( + "SELECT UNIQUE col1, col2 FROM table", + "SELECT DISTINCT col1, col2 FROM table", + ) self.validate_all( "NVL(NULL, 1)", write={ "": "COALESCE(NULL, 1)", - "oracle": "NVL(NULL, 1)", + "oracle": "COALESCE(NULL, 1)", }, ) self.validate_all( |