class MySQL_pyodbcExecutionContext(MySQLExecutionContext):
def _lastrowid(self, cursor):
+ cursor = self.create_cursor()
cursor.execute("SELECT LAST_INSERT_ID()")
- return cursor.fetchone()[0]
+ lastrowid = cursor.fetchone()[0]
+ cursor.close()
+ return lastrowid
class MySQL_pyodbc(PyODBCConnector, MySQLDialect):
supports_unicode_statements = False
else:
return None
-dialect = MySQL_pyodbc
\ No newline at end of file
+dialect = MySQL_pyodbc
return cursor.lastrowid
def _lastrowid(self, cursor):
+ cursor = self.create_cursor()
cursor.execute("SELECT LAST_INSERT_ID()")
- return cursor.fetchone()[0]
+ lastrowid = cursor.fetchone()[0]
+ cursor.close()
+ return lastrowid
class MySQL_jdbc(ZxJDBCConnector, MySQLDialect):
execution_ctx_cls = MySQL_jdbcExecutionContext
version.append(n)
return tuple(version)
-dialect = MySQL_jdbc
\ No newline at end of file
+dialect = MySQL_jdbc