[CONPY-209] mariadb connector fails on information schema query containing non-ascii characters Created: 2022-06-28  Updated: 2022-06-29  Resolved: 2022-06-29

Status: Closed
Project: MariaDB Connector/Python
Component/s: DBAPI 2.0
Affects Version/s: 1.1.2
Fix Version/s: 1.1.3

Type: Bug Priority: Critical
Reporter: Mike Bayer Assignee: Georg Richter
Resolution: Fixed Votes: 0
Labels: None
Environment:

mariadb-connector-c was upgraded from 3.1.13 to 3.2.7, Fedora linux mariadb server 10.5 and 10.6


Python Version: 3.10

 Description   

query containing non-ascii characters fails as of 1.1.2, no issues previously, works with other DB libraries, replace `col_Unitéble_id_seq` with an all ascii name and no issue

import mariadb
 
 
conn = mariadb.connect(
    user="scott", password="tiger", host="localhost", db="test",
)
 
 
cursor = conn.cursor()
 
cursor.execute(
    f"SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE "
    f"TABLE_TYPE='SEQUENCE' and TABLE_NAME=? and TABLE_SCHEMA=?",
    ("col_Unitéble_id_seq", "foobar")
)
 
cursor.close()
 
conn.close()
 

output:

Traceback (most recent call last):
  File "/home/classic/dev/sqlalchemy/test3.py", line 11, in <module>
    cursor.execute(
  File "/home/classic/.venv3/lib/python3.10/site-packages/mariadb/cursors.py", line 293, in execute
    self._readresponse()
mariadb.ProgrammingError: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '"foobar"?' at line 1



 Comments   
Comment by Mike Bayer [ 2022-06-28 ]

issue does not appear in any previous mariadb-connector version including 1.1.0rc1, all other 1.1.0 prereleases, 1.0.11

Generated at Thu Feb 08 03:31:04 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.