Bug #80535 _batch_insert uses mysql encoding instead of python encoding & fails w/ utf8mb4
| Submitted: | 26 Feb 2016 19:46 | Modified: | 11 Sep 2017 6:27 |
|---|---|---|---|
| Reporter: | Imre Fitos (OCA) | Email Updates: | |
| Status: | Duplicate | Impact on me: | |
| Category: | Connector / Python | Severity: | S2 (Serious) |
| Version: | 2.1.3 | OS: | Any |
| Assigned to: | CPU Architecture: | Any | |
| Tags: | utf8 | ||
[9 Mar 2016 9:24]
Chiranjeevi Battula
Hello Imre Fitos, Thank you for the bug report. Could you please provide repeatable test case (sample code, connection parameters etc. - please make it as private if you prefer) to confirm this issue at our end? Thanks, Chiranjeevi.
[10 Apr 2016 1:00]
Bugs System
No feedback was provided for this bug for over a month, so it is being suspended automatically. If you are able to provide the information that was originally requested, please do so and change the status of the bug back to "Open".
[8 Sep 2017 23:39]
Imre Fitos
I see this was finally fixed in 2.1.7, can I get credit for it?
[11 Sep 2017 6:27]
Chiranjeevi Battula
Hello Imre Fitos, Thank you for your feedback. Imho, your contribution triggered 2 bugs, first BugĀ #80535 and later Bug #80897. Bug #80897, is in verified state and not yet closed. I'll pass on your feedback to development through Bug #80897 and I request you to add further comments to Bug #80897 if any. For now, I'll mark this bug as duplicate of Bug #80897. Ideally newer bug is marked as duplicate of older but since Bug #80897 is already in verified state and hence marking other one as duplicate. Thanks, Chiranjeevi.
[9 May 2022 22:07]
Philip Olson
The release note was updated to include "Thanks to Imre Fitos for the patch." and the associated bugs were added. Related bugs: MySQL Bug #80897, MySQL Bug #82948
Portions of this website are copyright © 2001, 2002 The PHP Group
Page generated in 0.064 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: _batch_insert in cursor.py tries to encode the statement with the defined character set. If the mysql connection character set is defined as utf8mb4, a character set that python doesn't know, all batch inserts fail. How to repeat: specify utf8mb4 as the connection charset, use _batch_insert, see the following error: /opt/actmd/act-env/local/lib/python2.7/site-packages/mysql/connector/cursor.py', 569, '_batch_insert', '"Failed executing the operation; %s" % err)'), "InterfaceError('(mysql.connector.errors.InterfaceError) Failed executing the operation; unknown encoding: utf8mb4',)"]] Suggested fix: https://github.com/mysql/mysql-connector-python/pull/14 already submitted the OCA contributor agreement.