]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
reduce some call overhead
authorMike Bayer <mike_mp@zzzcomputing.com>
Tue, 10 Nov 2009 23:15:39 +0000 (23:15 +0000)
committerMike Bayer <mike_mp@zzzcomputing.com>
Tue, 10 Nov 2009 23:15:39 +0000 (23:15 +0000)
lib/sqlalchemy/dialects/mysql/oursql.py

index 4836e76a50cba2e9dc282c7873ca1ebbbd6340f5..37537483d78233ed2cfcc5f864b2c25c5b82a9a3 100644 (file)
@@ -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)