From 534cf5fdbd05e2049ab9feceabf3926a5ab6380c Mon Sep 17 00:00:00 2001 From: Jason Kirtland Date: Sat, 18 Aug 2007 18:15:11 +0000 Subject: - fixed prefixes= argument to select() - mysql can now generate DISTINCT or ALL for queries, select(..., distinct='ALL') - documented 'prefixes' arg to select() - rearranged doc order for select args to mirror that of a generated statement - went nutty and fixed wrapping and line length on most docstrings in sql.py --- lib/sqlalchemy/databases/mysql.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'lib/sqlalchemy/databases/mysql.py') diff --git a/lib/sqlalchemy/databases/mysql.py b/lib/sqlalchemy/databases/mysql.py index 303a44552..d5fd3b6c5 100644 --- a/lib/sqlalchemy/databases/mysql.py +++ b/lib/sqlalchemy/databases/mysql.py @@ -1752,6 +1752,14 @@ class MySQLCompiler(ansisql.ANSICompiler): # TODO: put whatever MySQL does for CAST here. return self.process(cast.clause) + def get_select_precolumns(self, select): + if isinstance(select._distinct, basestring): + return select._distinct.upper() + " " + elif select._distinct: + return "DISTINCT " + else: + return "" + def for_update_clause(self, select): if select.for_update == 'read': return ' LOCK IN SHARE MODE' -- cgit v1.2.1