Bug #91974 | mysql-connector-python crashes on 0 time value | ||
---|---|---|---|
Submitted: | 11 Aug 2018 0:13 | Modified: | 10 Aug 2022 20:52 |
Reporter: | Robert Walzer | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | Connector / Python | Severity: | S3 (Non-critical) |
Version: | 8.0.12 | OS: | Any |
Assigned to: | CPU Architecture: | Any |
[11 Aug 2018 0:13]
Robert Walzer
[12 Aug 2018 8:43]
MySQL Verification Team
Hello Robert, Thank you for the report and test case! thanks, Umesh
[13 Aug 2018 16:15]
Robert Walzer
I have another test case which causes the connector to crash on a binary column. Would you like me to file a separate bug for this: File "script_tests/binary.py", line 14, in <module> q("select * from db.t") File "script_tests/binary.py", line 7, in q for r in c: File "/usr/local/lib/python2.7/dist-packages/mysql/connector/cursor.py", line 1249, in fetchone return self._fetch_row() or None File "/usr/local/lib/python2.7/dist-packages/mysql/connector/cursor.py", line 851, in _fetch_row binary=self._binary, columns=self.description, raw=raw) File "/usr/local/lib/python2.7/dist-packages/mysql/connector/connection.py", line 465, in get_row raw=raw) File "/usr/local/lib/python2.7/dist-packages/mysql/connector/connection.py", line 491, in get_rows self._socket, columns, count, charset) File "/usr/local/lib/python2.7/dist-packages/mysql/connector/protocol.py", line 478, in read_binary_result values = self._parse_binary_values(columns, packet[5:], charset) File "/usr/local/lib/python2.7/dist-packages/mysql/connector/protocol.py", line 454, in _parse_binary_values values.append(value.decode(charset)) File "/usr/lib/python2.7/encodings/utf_8.py", line 16, in decode return codecs.utf_8_decode(input, errors, True) UnicodeDecodeError: 'utf8' codec can't decode byte 0xd0 in position 2: invalid continuation byte repro: def q(query): c = cnx.cursor(cursor_class=MySQLCursorPrepared) c.execute(query) for r in c: print r cnx = mysql.connector.connect(user='root', database='',port=3306,use_pure=True) q("create database db") q("create table db.t(a binary(16))") q("insert into db.t values(unhex('D0BFD000000000000000000000000000'))") q("select * from db.t")
[12 Jul 2022 21:03]
Oscar Pacheco
Posted by developer: Patch submitted for review.
[10 Aug 2022 20:52]
Philip Olson
Posted by developer: Fixed as of the upcoming MySQL Connector/Python 8.0.31 release, and here's the proposed changelog entry from the documentation team: The binary protocol would unexpectedly halt when given a time value of 0. The expected behavior is to receive a 00:00:00 time when given a 0-time value payload. Thank you for the bug report.