Commits

Alex Gaynor committed a81fdc1

Fix for sqlite3 statement cache.

Comments (0)

Files changed (2)

lib-python/modified-2.7/sqlite3/test/regression.py

         cur.execute("UPDATE foo SET id = 3 WHERE id = 1")
         self.assertEqual(cur.description, None)
 
+    def CheckStatementCache(self):
+        cur = self.con.cursor()
+        cur.execute("CREATE TABLE foo (id INTEGER)")
+        values = [(i,) for i in xrange(5)]
+        cur.executemany("INSERT INTO foo (id) VALUES (?)", values)
+
+        cur.execute("SELECT id FROM foo")
+        self.assertEqual(list(cur), values)
+        self.con.commit()
+        cur.execute("SELECT id FROM foo")
+        self.assertEqual(list(cur), values)
+
 def suite():
     regression_suite = unittest.makeSuite(RegressionTests, "Check")
     return unittest.TestSuite((regression_suite,))

lib_pypy/_sqlite3.py

         self.row_cast_map = None
         ret = sqlite.sqlite3_reset(self.statement)
         self.in_use = False
+        self.exhausted = False
         return ret
 
     def finalize(self):