From: brian z. <bz...@us...> - 2002-01-07 02:59:03
|
Update of /cvsroot/jython/jython/Lib/test/zxjdbc In directory usw-pr-cvs1:/tmp/cvs-serv31681/Lib/test/zxjdbc Modified Files: zxtest.py Log Message: updatecount is None if stmt.getUpdateCount() < 0 Index: zxtest.py =================================================================== RCS file: /cvsroot/jython/jython/Lib/test/zxjdbc/zxtest.py,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** zxtest.py 2002/01/07 02:12:37 1.6 --- zxtest.py 2002/01/07 02:59:00 1.7 *************** *** 31,35 **** c = self.db.cursor(dynamic) if hasattr(self, "datahandler"): ! c.datahandler.__class__ = self.datahandler(c.datahandler.__class__) return c --- 31,35 ---- c = self.db.cursor(dynamic) if hasattr(self, "datahandler"): ! c.datahandler = self.datahandler(c.datahandler) return c *************** *** 357,361 **** c.close() ! def testUpdateCount(self, insert_only=0): c = self.cursor() try: --- 357,361 ---- c.close() ! def testUpdateCount(self): c = self.cursor() try: *************** *** 363,367 **** assert c.updatecount == 1, "expected [1], got [%d]" % (c.updatecount) c.execute("select * from zxtesting") ! assert c.updatecount == -1, "expected updatecount to be -1 after query" # there's a *feature* in the mysql engine where it returns 0 for delete if there is no # where clause, regardless of the actual value. using a where clause forces it to calculate --- 363,367 ---- assert c.updatecount == 1, "expected [1], got [%d]" % (c.updatecount) c.execute("select * from zxtesting") ! self.assertEquals(None, c.updatecount) # there's a *feature* in the mysql engine where it returns 0 for delete if there is no # where clause, regardless of the actual value. using a where clause forces it to calculate *************** *** 369,372 **** --- 369,374 ---- c.execute("delete from zxtesting where 1>0") assert c.updatecount == 8, "expected [8], got [%d]" % (c.updatecount) + c.execute("update zxtesting set name = 'nothing'") + self.assertEquals(0, c.updatecount) finally: c.close() |