Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #17 from paulie4/master

help on debugging "Socket receive buffer full"
  • Loading branch information...
commit 43f7e152599afc85d395f2a5977e2fb3a22c4c2a 2 parents 09e4b36 + 79f025f
@jskorpan jskorpan authored
Showing with 27 additions and 0 deletions.
  1. +27 −0 tests/tests.py
View
27 tests/tests.py
@@ -334,6 +334,33 @@ def testMySQLClient2(self):
cnn.close()
+ def testMySQLClientManyInserts(self):
+ cnn = umysql.Connection()
+ cnn.connect (DB_HOST, 3306, DB_USER, DB_PASSWD, DB_DB)
+
+ cnn.query("DROP TABLE IF EXISTS tbltestmanyinserts")
+ cnn.query("CREATE TABLE tbltestmanyinserts (i int, j int, f double)")
+
+ cnti = cntj = 0
+ print datetime.datetime.now(),'\tstarting test'
+ try:
+ for i in xrange(10000):
+ cnti += 1
+ cntj = 0
+ for j in xrange(10000):
+ cntj += 1
+ self.assertEquals((1, 0), cnn.query('''INSERT INTO tbltestmanyinserts
+ VALUES (%d, %d, %s)''' %
+ (i, j, 0.000012345)))
+ #cnn.query("INSERT INTO tbltestmanyinserts VALUES (%d, %d, %s)" %
+ # (i, j, 0.000012345))
+ if not cnti % 10:
+ print datetime.datetime.now(),'\t',str(cnti)
+ print datetime.datetime.now(),'\tfinished'
+ finally:
+ print datetime.datetime.now(),'\tcnti =',cnti,'\tcntj =',cntj
+ cnn.close()
+
def testMySQLDBAPI(self):
cnn = umysql.Connection()
Please sign in to comment.
Something went wrong with that request. Please try again.