summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/engine/base.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2010-09-16 11:29:01 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2010-09-16 11:29:01 -0400
commit90d4cdbac80f0f87f365efdf9b596eff77764bed (patch)
tree98dacaa14d1aa9906546684af5f848f0a5c81e23 /lib/sqlalchemy/engine/base.py
parentb609030130eb4c415deee5516e2450ed660f2717 (diff)
downloadsqlalchemy-90d4cdbac80f0f87f365efdf9b596eff77764bed.tar.gz
- Fixed a regression in 0.6.4 whereby the change that
allowed cursor errors to be raised consistently broke the result.lastrowid accessor. Test coverage has been added for result.lastrowid. Note that lastrowid is only supported by Pysqlite and some MySQL drivers, so isn't super-useful in the general case.
Diffstat (limited to 'lib/sqlalchemy/engine/base.py')
-rw-r--r--lib/sqlalchemy/engine/base.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/sqlalchemy/engine/base.py b/lib/sqlalchemy/engine/base.py
index 79cadaea9..4d6912ce4 100644
--- a/lib/sqlalchemy/engine/base.py
+++ b/lib/sqlalchemy/engine/base.py
@@ -2249,7 +2249,7 @@ class ResultProxy(object):
self.context = context
self.dialect = context.dialect
self.closed = False
- self.cursor = context.cursor
+ self.cursor = self._saved_cursor = context.cursor
self.connection = context.root_connection
self._echo = self.connection._echo and \
context.engine._should_log_debug()
@@ -2304,12 +2304,12 @@ class ResultProxy(object):
regardless of database backend.
"""
- return self.cursor.lastrowid
+ return self._saved_cursor.lastrowid
def _cursor_description(self):
"""May be overridden by subclasses."""
- return self.cursor.description
+ return self._saved_cursor.description
def _autoclose(self):
"""called by the Connection to autoclose cursors that have no pending