]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
tests
authorJ. Nick Koston <nick@koston.org>
Fri, 24 Mar 2023 23:09:26 +0000 (13:09 -1000)
committerJ. Nick Koston <nick@koston.org>
Fri, 24 Mar 2023 23:09:26 +0000 (13:09 -1000)
test/dialect/mysql/test_compiler.py

index 52d4529aecd3f2ace37e71a31f981118d8dd41b2..b04659c2dbb165a11763f59bd1ec169ce9f06f07 100644 (file)
@@ -746,6 +746,7 @@ class SQLTest(fixtures.TestBase, AssertsCompiledSQL):
         (String(32), "CAST(t.col AS CHAR(32))"),
         (Unicode(32), "CAST(t.col AS CHAR(32))"),
         (CHAR(32), "CAST(t.col AS CHAR(32))"),
+        (CHAR(0), "CAST(t.col AS CHAR(0))"),
         (m.MSString, "CAST(t.col AS CHAR)"),
         (m.MSText, "CAST(t.col AS CHAR)"),
         (m.MSTinyText, "CAST(t.col AS CHAR)"),
@@ -1526,3 +1527,15 @@ class MatchExpressionTest(fixtures.TestBase, AssertsCompiledSQL):
             "MATCH ('x') AGAINST ('y' IN BOOLEAN MODE)",
             literal_binds=True,
         )
+
+    def test_char_zero(self):
+        t1 = Table(
+            "sometable",
+            MetaData(),
+            Column("unused", CHAR(0))
+        )
+        self.assert_compile(
+            schema.CreateTable(t1),
+            "CREATE TABLE sometable (unused "
+            "CHAR(0))",
+        )
\ No newline at end of file