mirror of
https://github.com/PyMySQL/mysqlclient.git
synced 2025-08-15 11:10:58 +08:00
Enable MULTI_STATEMENTS if the client library is 4.1 or newer.
Enable MULTI_RESULTS if the client library is 5.0 or newer.
This commit is contained in:
@ -130,7 +130,16 @@ class Connection(_mysql.connection):
|
||||
use_unicode = kwargs.get('use_unicode', 0)
|
||||
if kwargs.has_key('use_unicode'):
|
||||
del kwargs2['use_unicode']
|
||||
|
||||
|
||||
client_flag = kwargs.get('client_flag', 0)
|
||||
client_version = [ int(n) for n in _mysql.get_client_info().split('.')[:2] ]
|
||||
if client_version >= (4, 1):
|
||||
client_version |= CLIENT.MULTI_STATEMENTS
|
||||
if client_version >= (5, 0):
|
||||
client_version |= CLIENT.MULTI_RESULTS
|
||||
|
||||
kwargs2['client_flag'] = client_flag
|
||||
|
||||
super(Connection, self).__init__(*args, **kwargs2)
|
||||
|
||||
self.charset = self.character_set_name().split('_')[0]
|
||||
|
Reference in New Issue
Block a user