Merging upstream version 26.29.0.
Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
parent
141a93f866
commit
4c1ec9be5a
58 changed files with 17605 additions and 17151 deletions
|
@ -1494,7 +1494,11 @@ class TestDuckDB(Validator):
|
|||
|
||||
# DETACH
|
||||
self.validate_identity("DETACH new_database")
|
||||
self.validate_identity("DETACH IF EXISTS file")
|
||||
|
||||
# when 'if exists' is set, the syntax is DETACH DATABASE, not DETACH
|
||||
# ref: https://duckdb.org/docs/stable/sql/statements/attach.html#detach-syntax
|
||||
self.validate_identity("DETACH IF EXISTS file", "DETACH DATABASE IF EXISTS file")
|
||||
self.validate_identity("DETACH DATABASE IF EXISTS file", "DETACH DATABASE IF EXISTS file")
|
||||
|
||||
self.validate_identity("DETACH DATABASE db", "DETACH db")
|
||||
|
||||
|
@ -1652,3 +1656,20 @@ class TestDuckDB(Validator):
|
|||
def test_show_tables(self):
|
||||
self.validate_identity("SHOW TABLES").assert_is(exp.Show)
|
||||
self.validate_identity("SHOW ALL TABLES").assert_is(exp.Show)
|
||||
|
||||
def test_extract_date_parts(self):
|
||||
for part in ("WEEK", "WEEKOFYEAR"):
|
||||
# Both are synonyms for ISO week
|
||||
self.validate_identity(f"EXTRACT({part} FROM foo)", "EXTRACT(WEEK FROM foo)")
|
||||
|
||||
for part in (
|
||||
"WEEKDAY",
|
||||
"ISOYEAR",
|
||||
"ISODOW",
|
||||
"YEARWEEK",
|
||||
"TIMEZONE_HOUR",
|
||||
"TIMEZONE_MINUTE",
|
||||
):
|
||||
with self.subTest(f"Testing DuckDB EXTRACT({part} FROM foo)"):
|
||||
# All of these should remain as is, they don't have synonyms
|
||||
self.validate_identity(f"EXTRACT({part} FROM foo)")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue