From 1ffed8432e282aa57ecde9f3e4ca778a1756ddc0 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Sat, 17 Jun 2006 00:53:33 +0000 Subject: cast converted into its own ClauseElement so that it can have an explicit compilation 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 .....) --- test/sql/select.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'test/sql') 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 -- cgit v1.2.1