Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
3.2.3
-
None
-
Windows
Description
When using MariaDB ODBC connector 3.2.3, strings values are returned with apparently random NUL characters (i.e. '\0').
This issue occurs when string contains accents (french accents : éèàç etc...). There is no problem with older drivers :
- MariaDB ODBC 3.1.19 Driver works fine
- MySQL ODBC 5.1.8 Driver works fine
I attached a sample JSCRIPT to reproduce the bug : run it with CSCRIPT.EXE on a Windows host:
SET MYSQL_PASSWORD=[ROOT_PASSWORD]
|
CSCRIPT.EXE mariadb_nul_char_bug.js >mariadb_nul_char_bug.log
|
You need to redirect the script output to a log file in order to see the string difference (NUL characters are not displayed in a Windows terminal).
The test script usually appends NUL characters at the end of string, but in our real application we got NUL characters randomly within strings (not always trailing NUL characters).
E.
Thank you for the report and for the script in particular. That was a regression, and I was surprised it wasn't covered with any testcase
The problem was that If the field value contained characters represented in utf8mb4(or other selected connection charset, but default in case of unicode part of ODBC API is used is utf8mb4) with more than 1 byte, the driver would return wrong length.