summaryrefslogtreecommitdiff
path: root/test/dialect/test_mysql.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2012-04-16 12:08:32 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2012-04-16 12:08:32 -0400
commitfdda4b0e018f8c1a869411b7ed31387ea90cb082 (patch)
tree05791a5c57b22b6f48517e9a65bdeb46bb14dc15 /test/dialect/test_mysql.py
parentad9c893dc81704de7adca8635fb870de5952305b (diff)
downloadsqlalchemy-fdda4b0e018f8c1a869411b7ed31387ea90cb082.tar.gz
- mysql [bug] Fixed bug whereby if cast() is used
on a SQL expression whose type is not supported by cast() and therefore CAST isn't rendered by the dialect, the order of evaluation could change if the casted expression required that it be grouped; grouping is now applied to those expressions. [ticket:2467]
Diffstat (limited to 'test/dialect/test_mysql.py')
-rw-r--r--test/dialect/test_mysql.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/dialect/test_mysql.py b/test/dialect/test_mysql.py
index 5a34a79a0..8a880645c 100644
--- a/test/dialect/test_mysql.py
+++ b/test/dialect/test_mysql.py
@@ -1379,6 +1379,21 @@ class SQLTest(fixtures.TestBase, AssertsCompiledSQL):
dialect=dialect
)
+ def test_cast_grouped_expression_non_castable(self):
+ self.assert_compile(
+ cast(sql.column('x') + sql.column('y'), Float),
+ "(x + y)"
+ )
+
+ def test_cast_grouped_expression_pre_4(self):
+ dialect = mysql.dialect()
+ dialect.server_version_info = (3, 2, 3)
+ self.assert_compile(
+ cast(sql.column('x') + sql.column('y'), Integer),
+ "(x + y)",
+ dialect=dialect
+ )
+
def test_extract(self):
t = sql.table('t', sql.column('col1'))