Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
2.0.0-rc
-
None
-
3.13
Description
In Version 1.0 and 1.1 MariaDB Connector/Python raised an exception if the character set for connection changed to non utf8mb4 which might end up in corrupted data.
Example:
import mariadb |
|
|
conn=mariadb.connect(user="georg", db="test") |
cursor=conn.cursor()
|
cursor.execute("CREATE OR REPLACE TABLE t1 (a varchar(100) charset latin1)"); |
b='\xc3\x28' |
cursor.execute("insert into t1 values (?)", (b,)) |
cursor.execute("select * from t1") |
row= cursor.fetchone()
|
print(row)
|
cursor.execute("set names latin1") |
cursor.execute("select * from t1") |
row= cursor.fetchone()
|
print(row)
|
Output:
('Ã(',) |
('(',) |