[CONPY-169] Parser error when parsing multibyte strings Created: 2021-09-30  Updated: 2021-10-03  Resolved: 2021-10-03

Status: Closed
Project: MariaDB Connector/Python
Component/s: Parser
Affects Version/s: 1.1.0b1
Fix Version/s: 1.1.0b2

Type: Bug Priority: Major
Reporter: Georg Richter Assignee: Georg Richter
Resolution: Fixed Votes: 0
Labels: None

Python Version: 3.9

 Description   

When parsing multibyte strings, the offsets for placeholder are delivered as byte position instead of character position.

How to repeat:

import mariadb
 
c=mariadb.connect(db="test")
 
cursor=c.cursor()
cursor.execute("SELECT `Unitéble2`.`測試` AS `Unitéble2_測試`, `Unitéble2`.`測試_2` AS `Unitéble2_測試_2`, `Unitéble2`.`méil` AS `Unitéble2_méil` FROM `Unitéble2` WHERE ? = `Unitéble2`.`測試`",(1,))

Error:
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 '? = `Unitéble2`.`測試`2' at line 1


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