summaryrefslogtreecommitdiffstats
path: root/tests/dialects/test_sqlite.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-03-03 14:11:03 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-03-03 14:11:03 +0000
commit5d0ea770947ae1da51537ff75b14b48218d729aa (patch)
tree86e66fc69feeae4c4b23749e7779f6731791edcc /tests/dialects/test_sqlite.py
parentAdding upstream version 21.1.2. (diff)
downloadsqlglot-5d0ea770947ae1da51537ff75b14b48218d729aa.tar.xz
sqlglot-5d0ea770947ae1da51537ff75b14b48218d729aa.zip
Adding upstream version 22.2.0.upstream/22.2.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/dialects/test_sqlite.py')
-rw-r--r--tests/dialects/test_sqlite.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/dialects/test_sqlite.py b/tests/dialects/test_sqlite.py
index f7a3dd7..2421987 100644
--- a/tests/dialects/test_sqlite.py
+++ b/tests/dialects/test_sqlite.py
@@ -1,5 +1,7 @@
from tests.dialects.test_dialect import Validator
+from sqlglot.helper import logger as helper_logger
+
class TestSQLite(Validator):
dialect = "sqlite"
@@ -76,6 +78,7 @@ class TestSQLite(Validator):
self.validate_identity(
"""SELECT item AS "item", some AS "some" FROM data WHERE (item = 'value_1' COLLATE NOCASE) AND (some = 't' COLLATE NOCASE) ORDER BY item ASC LIMIT 1 OFFSET 0"""
)
+ self.validate_identity("SELECT * FROM GENERATE_SERIES(1, 5)")
self.validate_all("SELECT LIKE(y, x)", write={"sqlite": "SELECT x LIKE y"})
self.validate_all("SELECT GLOB('*y*', 'xyz')", write={"sqlite": "SELECT 'xyz' GLOB '*y*'"})
@@ -178,3 +181,12 @@ class TestSQLite(Validator):
"CREATE TABLE foo (bar LONGVARCHAR)",
write={"sqlite": "CREATE TABLE foo (bar TEXT)"},
)
+
+ def test_warnings(self):
+ with self.assertLogs(helper_logger) as cm:
+ self.validate_identity(
+ "SELECT * FROM t AS t(c1, c2)",
+ "SELECT * FROM t AS t",
+ )
+
+ self.assertIn("Named columns are not supported in table alias.", cm.output[0])