2008-11-29 04:04:56 |
yufang |
description |
I got PySQLPool_V0.3B1.tar.gz and fount it dosen't work with mysqldb1.22 which doesn't support username and password keyword params any more.So I change getNewConnection with:
def getNewConnection(commitOnEnd = False, **kargs):
return PySQLConnection.PySQLConnection(commitOnEnd = commitOnEnd, **kargs)
And in python2.5, PySQLConnection.py line 52: 'hashStr += self.info[key]' need to replace with 'hashStr += str(self.info[key])' to get it worked.
Also I have a question, PySQLPool.py line 116: 'self.__Pool['conn'][key][i].count = 0'. It seems all ok with or without this line? |
I got PySQLPool_V0.3B1.tar.gz and fount it dosen't work with mysqldb1.22 which doesn't support username and password keyword params any more.So I change getNewConnection with:
def getNewConnection(commitOnEnd = False, **kargs):
return PySQLConnection.PySQLConnection(commitOnEnd = commitOnEnd, **kargs)
And in python2.5, PySQLConnection.py line 52: 'hashStr += self.info[key]' need to replace with 'hashStr += str(self.info[key])' to get it worked.
Also I have a question, PySQLPool.py line 116: 'self.__Pool['conn'][key][i].count = 0'. It seems all ok with or without this line?
my script:
import PySQLPool
for i in range(1,10):
connection = PySQLPool.getNewConnection(host = 'localhost', user='root', passwd='', client_flag=2)
query = PySQLPool.getNewQuery(connection = connection)
print query.Query("SQL")
for row in query.record:
print row
|
|
2008-11-29 04:14:12 |
yufang |
description |
I got PySQLPool_V0.3B1.tar.gz and fount it dosen't work with mysqldb1.22 which doesn't support username and password keyword params any more.So I change getNewConnection with:
def getNewConnection(commitOnEnd = False, **kargs):
return PySQLConnection.PySQLConnection(commitOnEnd = commitOnEnd, **kargs)
And in python2.5, PySQLConnection.py line 52: 'hashStr += self.info[key]' need to replace with 'hashStr += str(self.info[key])' to get it worked.
Also I have a question, PySQLPool.py line 116: 'self.__Pool['conn'][key][i].count = 0'. It seems all ok with or without this line?
my script:
import PySQLPool
for i in range(1,10):
connection = PySQLPool.getNewConnection(host = 'localhost', user='root', passwd='', client_flag=2)
query = PySQLPool.getNewQuery(connection = connection)
print query.Query("SQL")
for row in query.record:
print row
|
I got PySQLPool_V0.3B1.tar.gz and fount it dosen't work with mysqldb1.22 which doesn't support username and password keyword params any more.So I change getNewConnection with:
def getNewConnection(commitOnEnd = False, **kargs):
return PySQLConnection.PySQLConnection(commitOnEnd = commitOnEnd, **kargs)
PySQLConnection.py line 31:
if not self.info.has_key('passwd'):
self.info['passwd'] = ''
And in python2.5, PySQLConnection.py line 52: 'hashStr += self.info[key]' need to replace with 'hashStr += str(self.info[key])' to get it worked.
Also I have a question, PySQLPool.py line 116: 'self.__Pool['conn'][key][i].count = 0'. It seems all ok with or without this line?
my script:
import PySQLPool
for i in range(1,10):
connection = PySQLPool.getNewConnection(host = 'localhost', user='root', passwd='', client_flag=2)
query = PySQLPool.getNewQuery(connection = connection)
print query.Query("SQL")
for row in query.record:
print row
|
|