diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2023-01-23 08:43:00 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2023-01-23 08:43:00 +0000 |
commit | 2228e192dc1a582aa2ae004f20c692f6c7aeb853 (patch) | |
tree | 9308157255d0d746263d77fa71bd3cb29fded23b /tests/test_expressions.py | |
parent | Releasing debian version 10.5.2-1. (diff) | |
download | sqlglot-2228e192dc1a582aa2ae004f20c692f6c7aeb853.tar.xz sqlglot-2228e192dc1a582aa2ae004f20c692f6c7aeb853.zip |
Merging upstream version 10.5.6.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/test_expressions.py')
-rw-r--r-- | tests/test_expressions.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/test_expressions.py b/tests/test_expressions.py index 906e08c..9e5f988 100644 --- a/tests/test_expressions.py +++ b/tests/test_expressions.py @@ -624,6 +624,10 @@ FROM foo""", self.assertEqual(catalog_db_and_table.args.get("catalog"), exp.to_identifier("catalog")) with self.assertRaises(ValueError): exp.to_table(1) + empty_string = exp.to_table("") + self.assertEqual(empty_string.name, "") + self.assertIsNone(table_only.args.get("db")) + self.assertIsNone(table_only.args.get("catalog")) def test_to_column(self): column_only = exp.to_column("column_name") @@ -715,3 +719,9 @@ FROM foo""", self.assertEqual(exp.DataType.build("OBJECT").sql(), "OBJECT") self.assertEqual(exp.DataType.build("NULL").sql(), "NULL") self.assertEqual(exp.DataType.build("UNKNOWN").sql(), "UNKNOWN") + + def test_rename_table(self): + self.assertEqual( + exp.rename_table("t1", "t2").sql(), + "ALTER TABLE t1 RENAME TO t2", + ) |