1
0
Fork 0

Merging upstream version 26.1.3.

Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
Daniel Baumann 2025-02-13 21:59:50 +01:00
parent 829d661a08
commit c8d4d2df63
Signed by: daniel
GPG key ID: FBB4F0E80A80222F
119 changed files with 71635 additions and 68059 deletions

View file

@ -520,6 +520,19 @@ class TestDialect(Validator):
},
)
def test_is_ascii(self):
self.validate_all(
"SELECT IS_ASCII(x)",
write={
"": "SELECT IS_ASCII(x)",
"sqlite": "SELECT (NOT x GLOB CAST(x'2a5b5e012d7f5d2a' AS TEXT))",
"mysql": "SELECT REGEXP_LIKE(x, '^[[:ascii:]]*$')",
"postgres": "SELECT (x ~ '^[[:ascii:]]*$')",
"tsql": "SELECT (PATINDEX('%[^' + CHAR(0x00) + '-' + CHAR(0x7f) + ']%' COLLATE Latin1_General_BIN, x) = 0)",
"oracle": "SELECT NVL(REGEXP_LIKE(x, '^[' || CHR(1) || '-' || CHR(127) || ']*$'), TRUE)",
},
)
def test_nvl2(self):
self.validate_all(
"SELECT NVL2(a, b, c)",
@ -1669,11 +1682,11 @@ class TestDialect(Validator):
},
)
self.validate_all(
"POSITION(needle in haystack)",
"POSITION(needle IN haystack)",
write={
"drill": "STRPOS(haystack, needle)",
"duckdb": "STRPOS(haystack, needle)",
"postgres": "STRPOS(haystack, needle)",
"postgres": "POSITION(needle IN haystack)",
"presto": "STRPOS(haystack, needle)",
"spark": "LOCATE(needle, haystack)",
"clickhouse": "position(haystack, needle)",
@ -1686,7 +1699,7 @@ class TestDialect(Validator):
write={
"drill": "STRPOS(haystack, needle)",
"duckdb": "STRPOS(haystack, needle)",
"postgres": "STRPOS(haystack, needle)",
"postgres": "POSITION(needle IN haystack)",
"presto": "STRPOS(haystack, needle)",
"bigquery": "STRPOS(haystack, needle)",
"spark": "LOCATE(needle, haystack)",