diff options
author | Gerhard Häring <gh@ghaering.de> | 2008-05-31 21:33:27 +0000 |
---|---|---|
committer | Gerhard Häring <gh@ghaering.de> | 2008-05-31 21:33:27 +0000 |
commit | 7f7ca35f5bf22b698135de62d2179a13f5c94c7f (patch) | |
tree | f419d9c97a27863a06021efc2fd8fb55cc51a09d /Lib/sqlite3/test | |
parent | 8bfba671019c6007e9551e27bcc5e0793ae7515f (diff) | |
download | cpython-git-7f7ca35f5bf22b698135de62d2179a13f5c94c7f.tar.gz |
Fixed rowcount for SELECT statements. They're -1 now (again), for better DB-API 2.0 compliance.
Diffstat (limited to 'Lib/sqlite3/test')
-rw-r--r-- | Lib/sqlite3/test/dbapi.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/Lib/sqlite3/test/dbapi.py b/Lib/sqlite3/test/dbapi.py index b27486d5b8..e774f744e4 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,)]) |