-
Notifications
You must be signed in to change notification settings - Fork 6.8k
Description
Bug Report
Test Topology
(1) python driver ------> proxy ------> mysql
(2) python driver ------> mysql
row info:
rows =
((datetime.datetime(2019, 3, 11, 14, 6, 11), datetime.datetime(2019, 3, 11, 14, 6, 11), 1, u"abc'"),)
insert statement
sql = """
insert into tbl_key_test (data_create_time,data_update_time,id,key_name_partial) values
(%s, %s, %s, %s )
"""
Test1 python driver ------> proxy ------> mysql
connect to proxy
conn_d = get_mysql_connection('10.10.5.xxx:3306', 'test')
cur_d = conn_d.cursor()
cur_d.executemany(sql , rows)
error info:
Traceback (most recent call last):
File "", line 1, in
File "/usr/local/lib/python2.7/site-packages/pymysql/cursors.py", line 169, in executemany
self.rowcount = sum(self.execute(query, arg) for arg in args)
File "/usr/local/lib/python2.7/site-packages/pymysql/cursors.py", line 169, in
self.rowcount = sum(self.execute(query, arg) for arg in args)
File "/usr/local/lib/python2.7/site-packages/pymysql/cursors.py", line 146, in execute
result = self._query(query)
File "/usr/local/lib/python2.7/site-packages/pymysql/cursors.py", line 296, in _query
conn.query(q)
File "/usr/local/lib/python2.7/site-packages/pymysql/connections.py", line 781, in query
self._affected_rows = self._read_query_result(unbuffered=unbuffered)
File "/usr/local/lib/python2.7/site-packages/pymysql/connections.py", line 942, in _read_query_result
result.read()
File "/usr/local/lib/python2.7/site-packages/pymysql/connections.py", line 1138, in read
first_packet = self.connection._read_packet()
File "/usr/local/lib/python2.7/site-packages/pymysql/connections.py", line 906, in _read_packet
packet.check_error()
File "/usr/local/lib/python2.7/site-packages/pymysql/connections.py", line 367, in check_error
err.raise_mysql_exception(self._data)
File "/usr/local/lib/python2.7/site-packages/pymysql/err.py", line 120, in raise_mysql_exception
_check_mysql_exception(errinfo)
File "/usr/local/lib/python2.7/site-packages/pymysql/err.py", line 115, in _check_mysql_exception
raise InternalError(errno, errorvalue)
pymysql.err.InternalError: (3054, u"Unknown exception: Illegal input, unterminated '''.")
Test2 python driver ------> mysql
connect to mysql
conn_d = get_mysql_connection('10.10.4.xxx:3307', 'test')
cur_d = conn_d.cursor()
cur_d.executemany(sql , rows)
conn_d.commit()
insert sucessfully