Bug #73445 Setting conn. pooling through the connect func. seems to be broken with Fabric
Description:
Setting the connection pooling when MySQL Fabric is in use seems to be broken.
The problem does not happen in previous releases that support MySQL Fabric.
The following error is reported:
...
return self.__cnx.cursor()
File "/usr/local/lib/python2.7/dist-packages/mysql/connector/fabric/connection.py", line 1168, in cursor
self._connect()
File "/usr/local/lib/python2.7/dist-packages/mysql/connector/fabric/connection.py", line 1128, in _connect
self._mysql_cnx = MySQLConnection(**dbconfig)
File "/usr/local/lib/python2.7/dist-packages/mysql/connector/connection.py", line 129, in __init__
self.connect(**kwargs)
File "/usr/local/lib/python2.7/dist-packages/mysql/connector/connection.py", line 504, in connect
self.config(**kwargs)
File "/usr/local/lib/python2.7/dist-packages/mysql/connector/connection.py", line 410, in config
raise AttributeError("Unsupported argument '{0}'".format(key))
AttributeError: Unsupported argument 'pool_name'
This happens because of the following code:
def config(self, **kwargs):
...
for key, value in config.items():
try:
DEFAULT_CONFIGURATION[key]
except KeyError:
raise AttributeError("Unsupported argument '{0}'".format(key)
Neither pool_name or pool_size are present in the DEFAULT_CONFIGURATION dictionary. However, even after ignoring the KeyError, the connection pooling
does not seem to be working properly.
How to repeat:
params = {
"fabric" : {
"host" : fabric_host, "port" : fabric_port, "user" : "admin",
"password" : "password"
},
"user" : user, "passwd" : passwd, "database" : "mysql", "pool_name" :
"pool_name"
}
cnx = connect(**params)
cur = cnx.cursor()
Portions of this website are copyright © 2001, 2002 The PHP Group
Page generated in 0.052 sec. using MySQL 8.4.7-u6-cloud
Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the
respective copyright holders.
It is not reviewed in advance
by Oracle and does not necessarily represent the opinion of
Oracle or any other party.
Description: Setting the connection pooling when MySQL Fabric is in use seems to be broken. The problem does not happen in previous releases that support MySQL Fabric. The following error is reported: ... return self.__cnx.cursor() File "/usr/local/lib/python2.7/dist-packages/mysql/connector/fabric/connection.py", line 1168, in cursor self._connect() File "/usr/local/lib/python2.7/dist-packages/mysql/connector/fabric/connection.py", line 1128, in _connect self._mysql_cnx = MySQLConnection(**dbconfig) File "/usr/local/lib/python2.7/dist-packages/mysql/connector/connection.py", line 129, in __init__ self.connect(**kwargs) File "/usr/local/lib/python2.7/dist-packages/mysql/connector/connection.py", line 504, in connect self.config(**kwargs) File "/usr/local/lib/python2.7/dist-packages/mysql/connector/connection.py", line 410, in config raise AttributeError("Unsupported argument '{0}'".format(key)) AttributeError: Unsupported argument 'pool_name' This happens because of the following code: def config(self, **kwargs): ... for key, value in config.items(): try: DEFAULT_CONFIGURATION[key] except KeyError: raise AttributeError("Unsupported argument '{0}'".format(key) Neither pool_name or pool_size are present in the DEFAULT_CONFIGURATION dictionary. However, even after ignoring the KeyError, the connection pooling does not seem to be working properly. How to repeat: params = { "fabric" : { "host" : fabric_host, "port" : fabric_port, "user" : "admin", "password" : "password" }, "user" : user, "passwd" : passwd, "database" : "mysql", "pool_name" : "pool_name" } cnx = connect(**params) cur = cnx.cursor()