summaryrefslogtreecommitdiff
path: root/test/sql
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2006-06-17 00:53:33 +0000
committerMike Bayer <mike_mp@zzzcomputing.com>2006-06-17 00:53:33 +0000
commit1ffed8432e282aa57ecde9f3e4ca778a1756ddc0 (patch)
tree0849938da765ee182bc23284337b214e3202e5d1 /test/sql
parent3736b3ddff65f6d4b7e273b040b48b19dbac9b66 (diff)
downloadsqlalchemy-1ffed8432e282aa57ecde9f3e4ca778a1756ddc0.tar.gz
cast converted into its own ClauseElement so that it can have an explicit compilationrel_0_2_3
function in ANSICompiler MySQLCompiler then skips most CAST calls since it only seems to support the standard syntax for Date types; other types now a TODO for MySQL then, polymorphic_union() function now CASTs null()s to the type corresponding to the columns in the UNION, since postgres doesnt like mixing NULL with integer types (long road for that .....)
Diffstat (limited to 'test/sql')
-rw-r--r--test/sql/select.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/test/sql/select.py b/test/sql/select.py
index 290e324cf..d78f36b1a 100644
--- a/test/sql/select.py
+++ b/test/sql/select.py
@@ -556,14 +556,14 @@ FROM mytable, myothertable WHERE mytable.myid = myothertable.otherid AND mytable
check_results(postgres.dialect(), ['NUMERIC(10, 2)', 'NUMERIC(12, 9)', 'DATE', 'TEXT', 'VARCHAR(20)'], '%(literal)s')
# then the Oracle engine
-# check_results(oracle.OracleDialect(), ['NUMERIC(10, 2)', 'NUMERIC(12, 9)', 'DATE', 'CLOB', 'VARCHAR(20)'], ':literal')
+ check_results(oracle.dialect(), ['NUMERIC(10, 2)', 'NUMERIC(12, 9)', 'DATE', 'CLOB', 'VARCHAR(20)'], ':literal')
# then the sqlite engine
check_results(sqlite.dialect(), ['NUMERIC(10, 2)', 'NUMERIC(12, 9)', 'DATE', 'TEXT', 'VARCHAR(20)'], '?')
- # and the MySQL engine
- check_results(mysql.dialect(), ['NUMERIC(10, 2)', 'NUMERIC(12, 9)', 'DATE', 'TEXT', 'VARCHAR(20)'], '%s')
-
+ # MySQL seems to only support DATE types for cast
+ self.assertEqual(str(cast(tbl.c.ts, Date).compile(dialect=mysql.dialect())), 'CAST(casttest.ts AS DATE)')
+ self.assertEqual(str(cast(tbl.c.ts, Numeric).compile(dialect=mysql.dialect())), 'casttest.ts')
def testdatebetween(self):
import datetime