summaryrefslogtreecommitdiffstats
path: root/Lib/sqlite3
diff options
context:
space:
mode:
authorGerhard Häring <gh@ghaering.de>2008-05-31 21:33:27 (GMT)
committerGerhard Häring <gh@ghaering.de>2008-05-31 21:33:27 (GMT)
commit7f7ca35f5bf22b698135de62d2179a13f5c94c7f (patch)
treef419d9c97a27863a06021efc2fd8fb55cc51a09d /Lib/sqlite3
parent8bfba671019c6007e9551e27bcc5e0793ae7515f (diff)
downloadcpython-7f7ca35f5bf22b698135de62d2179a13f5c94c7f.zip
cpython-7f7ca35f5bf22b698135de62d2179a13f5c94c7f.tar.gz
cpython-7f7ca35f5bf22b698135de62d2179a13f5c94c7f.tar.bz2
Fixed rowcount for SELECT statements. They're -1 now (again), for better DB-API 2.0 compliance.
Diffstat (limited to 'Lib/sqlite3')
-rw-r--r--Lib/sqlite3/test/dbapi.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/Lib/sqlite3/test/dbapi.py b/Lib/sqlite3/test/dbapi.py
index b27486d..e774f74 100644
--- a/Lib/sqlite3/test/dbapi.py
+++ b/Lib/sqlite3/test/dbapi.py
@@ -297,6 +297,15 @@ class CursorTests(unittest.TestCase):
self.cu.execute("update test set name='bar'")
self.failUnlessEqual(self.cu.rowcount, 2)
+ def CheckRowcountSelect(self):
+ """
+ pysqlite does not know the rowcount of SELECT statements, because we
+ don't fetch all rows after executing the select statement. The rowcount
+ has thus to be -1.
+ """
+ self.cu.execute("select 5 union select 6")
+ self.failUnlessEqual(self.cu.rowcount, -1)
+
def CheckRowcountExecutemany(self):
self.cu.execute("delete from test")
self.cu.executemany("insert into test(name) values (?)", [(1,), (2,), (3,)])