| Bug #107853 | Python Shell API Row - extra underscores in property names querying 8.0 servers | ||
|---|---|---|---|
| Submitted: | 13 Jul 2022 0:10 | Modified: | 29 Nov 2022 9:46 |
| Reporter: | Scott Werner | Email Updates: | |
| Status: | Closed | Impact on me: | |
| Category: | MySQL Server: Document Store: MySQL Shell | Severity: | S3 (Non-critical) |
| Version: | 5.7.34-37,8.0.28-19, 8.0.29 | OS: | Linux |
| Assigned to: | CPU Architecture: | x86 | |
[13 Jul 2022 8:09]
MySQL Verification Team
Hello Scott Werner, Thank you for the report and feedback. regards, Umesh
[29 Nov 2022 9:46]
Edward Gilmore
Posted by developer:
Added the following note to the MySQL Shell 8.0.32 release notes:
Extra underscores were added to property names when
querying MySQL 8.0 servers with the MySQL Shell Python
API. In MySQL 8.0, the column names are uppercase, but
Python naming conventions added an underscore before each
uppercase letter, resulting in column names like
row.c_o_l_u_m_n_n_a_m_e.
As of this release, such fields are exposed as properties
in both Python and JavaScript, and the column name takes
precedence over the naming convention.

Description: I'm seeing an issue with one of my MySQL Shell python scripts when switching from MySQL Server version 5.7 to 8.0. result = session.run_sql("select table_name, column_name, referenced_table_name, referenced_column_name " \ "from information_schema.key_column_usage;") for row in result.fetch_all(): row.table_name #Fails in 8.0 The docs state "When a row object is created, its fields are exposed as properties". On 5.7, I can access the following properties: row.table_name row.column_name row.referenced_table_name row.referenced_column_name Running against an 8.0 host, the properties are created as: row.t_a_b_l_e_n_a_m_e row.c_o_l_u_m_n_n_a_m_e row.r_e_f_e_r_e_n_c_e_d_t_a_b_l_e_n_a_m_e row.r_e_f_e_r_e_n_c_e_d_c_o_l_u_m_n_n_a_m_e How to repeat: Run a query using the classic session and try accessing the column value by property vs by index against an 8.0 server