diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2023-07-24 08:03:45 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2023-07-24 08:03:45 +0000 |
commit | ca57dc468e5d8d0920e964d45ad25271ae6e633d (patch) | |
tree | 319d8bffcb5c3e9afe9e62beca9ef401480578d2 /tests/dialects/test_dialect.py | |
parent | Adding upstream version 17.4.1. (diff) | |
download | sqlglot-ca57dc468e5d8d0920e964d45ad25271ae6e633d.tar.xz sqlglot-ca57dc468e5d8d0920e964d45ad25271ae6e633d.zip |
Adding upstream version 17.7.0.upstream/17.7.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/dialects/test_dialect.py')
-rw-r--r-- | tests/dialects/test_dialect.py | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/tests/dialects/test_dialect.py b/tests/dialects/test_dialect.py index 618b1b4..aaaffab 100644 --- a/tests/dialects/test_dialect.py +++ b/tests/dialects/test_dialect.py @@ -81,7 +81,7 @@ class TestDialect(Validator): "clickhouse": "CAST(a AS TEXT)", "drill": "CAST(a AS VARCHAR)", "duckdb": "CAST(a AS TEXT)", - "mysql": "CAST(a AS TEXT)", + "mysql": "CAST(a AS CHAR)", "hive": "CAST(a AS STRING)", "oracle": "CAST(a AS CLOB)", "postgres": "CAST(a AS TEXT)", @@ -160,7 +160,7 @@ class TestDialect(Validator): "bigquery": "CAST(a AS STRING)", "drill": "CAST(a AS VARCHAR)", "duckdb": "CAST(a AS TEXT)", - "mysql": "CAST(a AS TEXT)", + "mysql": "CAST(a AS CHAR)", "hive": "CAST(a AS STRING)", "oracle": "CAST(a AS CLOB)", "postgres": "CAST(a AS TEXT)", @@ -177,7 +177,7 @@ class TestDialect(Validator): "bigquery": "CAST(a AS STRING)", "drill": "CAST(a AS VARCHAR)", "duckdb": "CAST(a AS TEXT)", - "mysql": "CAST(a AS VARCHAR)", + "mysql": "CAST(a AS CHAR)", "hive": "CAST(a AS STRING)", "oracle": "CAST(a AS VARCHAR2)", "postgres": "CAST(a AS VARCHAR)", @@ -194,7 +194,7 @@ class TestDialect(Validator): "bigquery": "CAST(a AS STRING)", "drill": "CAST(a AS VARCHAR(3))", "duckdb": "CAST(a AS TEXT(3))", - "mysql": "CAST(a AS VARCHAR(3))", + "mysql": "CAST(a AS CHAR(3))", "hive": "CAST(a AS VARCHAR(3))", "oracle": "CAST(a AS VARCHAR2(3))", "postgres": "CAST(a AS VARCHAR(3))", @@ -224,13 +224,13 @@ class TestDialect(Validator): }, ) self.validate_all( - "TRY_CAST(a AS DOUBLE)", + "CAST(a AS DOUBLE)", read={ "postgres": "CAST(a AS DOUBLE PRECISION)", "redshift": "CAST(a AS DOUBLE PRECISION)", }, write={ - "duckdb": "TRY_CAST(a AS DOUBLE)", + "duckdb": "CAST(a AS DOUBLE)", "drill": "CAST(a AS DOUBLE)", "postgres": "CAST(a AS DOUBLE PRECISION)", "redshift": "CAST(a AS DOUBLE PRECISION)", @@ -634,7 +634,7 @@ class TestDialect(Validator): }, ) self.validate_all( - "TIMESTAMP_TRUNC(TRY_CAST(x AS DATE), day)", + "TIMESTAMP_TRUNC(CAST(x AS DATE), day)", read={"postgres": "DATE_TRUNC('day', x::DATE)"}, ) self.validate_all( @@ -1512,6 +1512,7 @@ SELECT "redshift": "BEGIN", "snowflake": "BEGIN", "sqlite": "BEGIN TRANSACTION", + "tsql": "BEGIN TRANSACTION", }, ) self.validate_all( |