[CONPY-277] Queries fail when sql_mode=ANSI_QUOTES Created: 2023-12-26 Updated: 2024-02-05 Resolved: 2024-02-05 |
|
| Status: | Closed |
| Project: | MariaDB Connector/Python |
| Component/s: | DBAPI 2.0 |
| Affects Version/s: | 1.1.9 |
| Fix Version/s: | 1.1.10 |
| Type: | Bug | Priority: | Major |
| Reporter: | Hristo Venev | Assignee: | Georg Richter |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Python Version: | 3.11 |
| Description |
|
In Cursor._substitute_parameters, double quotes are used unconditionally to quote strings. Single quotes should be used instead, preferably via mysql_real_escape_string_quote for compatibility with NO_BACKSLASH_ESCAPES. |
| Comments |
| Comment by Georg Richter [ 2024-01-31 ] | |||||
|
Thanks for your report. Can you please provide a short reproducible example? | |||||
| Comment by Hristo Venev [ 2024-02-01 ] | |||||
|
On a database with sql-mode=TRADITIONAL,ANSI_QUOTES,ONLY_FULL_GROUP_BY,PIPES_AS_CONCAT:
Setting binary=True works around the issue, but the default binary=False is broken. |