Hello,

It looks that the issue with fetch across rollback still can occur in the new 
version. It turned up when I applied the Pysqlite transaction test suite to 
some dbapi2 version of my own. Below is a minimal script to reproduce it. It 
has puzzled me what goes wrong and I would like to believe that the old version 
is still installed. But the printed version is the new one. Also it behavious 
slightly different, as the same result comes also after commit. In 2.5.1 you 
would not get that far. The issue is not causing practical problems but it 
would be nice to have a work-around to get a clean test result.
It is great, by the way, that commit and rollback are now dealing equally with 
open cursors! 

Edzard Pasma

#!/usr/bin/env python
import pysqlite2.dbapi2 as sqlite
import sys
print "VERSION", sqlite.version, sqlite.sqlite_version, sys.version
class Connection (sqlite.Connection):
    def cursor (self):
        return Cursor (self)
class Cursor (sqlite.Cursor):
    def execute (self, *args):
        print "EXEC", args
        sqlite.Cursor.execute (self, *args)
con = Connection ('test.db')
cur = con.cursor ()
try: cur.execute ('drop table t2')
except sqlite.OperationalError: pass
cur.execute ('create table t2 (c)')
cur.execute ("insert into t2 values (1)")
cur.execute ('select 1 union select 2 union select 3')
con.rollback ()
print cur.fetchall ()

VERSION 2.5.2 3.6.11 2.6 (trunk:66714:66715M, Oct  1 2008, 18:36:04) 
[GCC 4.0.1 (Apple Computer, Inc. build 5370)]
EXEC ('drop table t2',)
EXEC ('create table t2 (c)',)
EXEC ('insert into t2 values (1)',)
EXEC ('select 1 union select 2 union select 3',)
[(1,), (1,), (2,), (3,)]

--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to