bruceyan1220 opened a new issue #2007: The field contains single quotation marks. It is written by proxy and will report an error. URL: https://github.com/apache/incubator-shardingsphere/issues/2007 ## 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 "<stdin>", line 1, in <module> 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 <genexpr> 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
---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services
