From: Mike Bayer Date: Tue, 10 Nov 2009 23:15:39 +0000 (+0000) Subject: reduce some call overhead X-Git-Tag: rel_0_6beta1~171 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b0833b66a02a77a8b962f6b020243ae79dc2939b;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git reduce some call overhead --- diff --git a/lib/sqlalchemy/dialects/mysql/oursql.py b/lib/sqlalchemy/dialects/mysql/oursql.py index 4836e76a50..37537483d7 100644 --- a/lib/sqlalchemy/dialects/mysql/oursql.py +++ b/lib/sqlalchemy/dialects/mysql/oursql.py @@ -50,10 +50,8 @@ class _oursqlNumeric(NUMERIC): class _oursqlBIT(BIT): def result_processor(self, dialect): """oursql already converts mysql bits, so.""" - def process(value): - return value - return process + return None class MySQL_oursql(MySQLDialect): driver = 'oursql' @@ -77,7 +75,8 @@ class MySQL_oursql(MySQLDialect): def do_execute(self, cursor, statement, parameters, context=None): """Provide an implementation of *cursor.execute(statement, parameters)*.""" - if isinstance(statement, _PlainQuery): + + if context and not context.compiled and isinstance(context.statement, _PlainQuery): cursor.execute(statement, plain_query=True) else: cursor.execute(statement, parameters)