summaryrefslogtreecommitdiff
path: root/test/dialect/mysql/test_compiler.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/dialect/mysql/test_compiler.py')
-rw-r--r--test/dialect/mysql/test_compiler.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/test/dialect/mysql/test_compiler.py b/test/dialect/mysql/test_compiler.py
index 3fb52416e..9d2c43bfe 100644
--- a/test/dialect/mysql/test_compiler.py
+++ b/test/dialect/mysql/test_compiler.py
@@ -61,6 +61,7 @@ from sqlalchemy.sql.expression import literal_column
from sqlalchemy.testing import assert_raises_message
from sqlalchemy.testing import AssertsCompiledSQL
from sqlalchemy.testing import eq_
+from sqlalchemy.testing import eq_ignore_whitespace
from sqlalchemy.testing import expect_warnings
from sqlalchemy.testing import fixtures
from sqlalchemy.testing import mock
@@ -146,6 +147,25 @@ class CompileTest(ReservedWordFixture, fixtures.TestBase, AssertsCompiledSQL):
dialect=dialect,
)
+ def test_plain_stringify_returning(self):
+ t = Table(
+ "t",
+ MetaData(),
+ Column("myid", Integer, primary_key=True),
+ Column("name", String, server_default="some str"),
+ Column("description", String, default=func.lower("hi")),
+ )
+ stmt = t.insert().values().return_defaults()
+ eq_ignore_whitespace(
+ str(stmt.compile(dialect=mysql.dialect(is_mariadb=True))),
+ "INSERT INTO t (description) VALUES (lower(%s)) "
+ "RETURNING t.myid, t.name, t.description",
+ )
+ eq_ignore_whitespace(
+ str(stmt.compile(dialect=mysql.dialect())),
+ "INSERT INTO t (description) VALUES (lower(%s))",
+ )
+
def test_create_index_simple(self):
m = MetaData()
tbl = Table("testtbl", m, Column("data", String(255)))