From cf18eecd704f5eb6fde4e0c362cfdb322e3e559a Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Sun, 25 Nov 2007 03:28:49 +0000 Subject: - named_with_column becomes an attribute - cleanup within compiler visit_select(), column labeling - is_select() removed from dialects, replaced with returns_rows_text(), returns_rows_compiled() - should_autocommit() removed from dialects, replaced with should_autocommit_text() and should_autocommit_compiled() - typemap and column_labels collections removed from Compiler, replaced with single "result_map" collection. - ResultProxy uses more succinct logic in combination with result_map to target columns --- lib/sqlalchemy/databases/mysql.py | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) (limited to 'lib/sqlalchemy/databases/mysql.py') diff --git a/lib/sqlalchemy/databases/mysql.py b/lib/sqlalchemy/databases/mysql.py index 39bfc0bea..03b9a749c 100644 --- a/lib/sqlalchemy/databases/mysql.py +++ b/lib/sqlalchemy/databases/mysql.py @@ -1378,9 +1378,6 @@ def descriptor(): class MySQLExecutionContext(default.DefaultExecutionContext): - _my_is_select = re.compile(r'\s*(?:SELECT|SHOW|DESCRIBE|XA +RECOVER)', - re.I | re.UNICODE) - def post_exec(self): if self.compiled.isinsert and not self.executemany: if (not len(self._last_inserted_ids) or @@ -1388,11 +1385,11 @@ class MySQLExecutionContext(default.DefaultExecutionContext): self._last_inserted_ids = ([self.cursor.lastrowid] + self._last_inserted_ids[1:]) - def is_select(self): - return SELECT_RE.match(self.statement) + def returns_rows_text(self, statement): + return SELECT_RE.match(statement) - def should_autocommit(self): - return AUTOCOMMIT_RE.match(self.statement) + def should_autocommit_text(self, statement): + return AUTOCOMMIT_RE.match(statement) class MySQLDialect(default.DefaultDialect): @@ -1873,9 +1870,6 @@ class MySQLCompiler(compiler.DefaultCompiler): if type_ is None: return self.process(cast.clause) - if self.stack and self.stack[-1].get('select'): - # not sure if we want to set the typemap here... - self.typemap.setdefault("CAST", cast.type) return 'CAST(%s AS %s)' % (self.process(cast.clause), type_) -- cgit v1.2.1