summaryrefslogtreecommitdiff
path: root/test/dialect/test_mysql.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2010-06-19 13:21:19 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2010-06-19 13:21:19 -0400
commit17073a015546f9fe0ce09e668e9e318269c09a2a (patch)
tree4157fc1c9ffe89cde0163b744b0876d22179ba61 /test/dialect/test_mysql.py
parentfc7674bcc8b18b3e218c248d34d6755b7e14383d (diff)
downloadsqlalchemy-17073a015546f9fe0ce09e668e9e318269c09a2a.tar.gz
- MySQL dialect doesn't emit CAST() for MySQL version
detected < 4.0.2. This allows the unicode check on connect to proceed. [ticket:1826]
Diffstat (limited to 'test/dialect/test_mysql.py')
-rw-r--r--test/dialect/test_mysql.py15
1 files changed, 14 insertions, 1 deletions
diff --git a/test/dialect/test_mysql.py b/test/dialect/test_mysql.py
index f61af4238..f41f06209 100644
--- a/test/dialect/test_mysql.py
+++ b/test/dialect/test_mysql.py
@@ -1162,7 +1162,20 @@ class SQLTest(TestBase, AssertsCompiledSQL):
for type_, expected in specs:
self.assert_compile(cast(t.c.col, type_), expected)
-
+
+ def test_no_cast_pre_4(self):
+ self.assert_compile(
+ cast(Column('foo', Integer), String),
+ "CAST(foo AS CHAR)",
+ )
+ dialect = mysql.dialect()
+ dialect.server_version_info = (3, 2, 3)
+ self.assert_compile(
+ cast(Column('foo', Integer), String),
+ "foo",
+ dialect=dialect
+ )
+
def test_extract(self):
t = sql.table('t', sql.column('col1'))