diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2010-06-19 13:21:19 -0400 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2010-06-19 13:21:19 -0400 |
commit | 17073a015546f9fe0ce09e668e9e318269c09a2a (patch) | |
tree | 4157fc1c9ffe89cde0163b744b0876d22179ba61 /test/dialect/test_mysql.py | |
parent | fc7674bcc8b18b3e218c248d34d6755b7e14383d (diff) | |
download | sqlalchemy-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.py | 15 |
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')) |