Bug #116559 | ODBC connector uses deprecated mysql_real_escape_string function | ||
---|---|---|---|
Submitted: | 5 Nov 2024 13:00 | Modified: | 4 Mar 21:35 |
Reporter: | Tom Hughes | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | Connector / ODBC | Severity: | S2 (Serious) |
Version: | 9.1.0 | OS: | Any |
Assigned to: | Rafal Somla | CPU Architecture: | Any |
[5 Nov 2024 13:00]
Tom Hughes
[5 Nov 2024 14:04]
MySQL Verification Team
HI Mr. Hughes, Can you send us a full test case ........ Also, let us know if 8.0, 8.4 and 9.0 are affected or not .........
[5 Nov 2024 14:47]
Tom Hughes
Test case
Attachment: odbc116559.c (text/x-csrc), 1.17 KiB.
[5 Nov 2024 14:48]
Tom Hughes
I've attached a test case - compilation instructions are in a comment as are details of creating a test environment. It should fail with: % ./odbc116559 terminate called after throwing an instance of 'std::length_error' what(): basic_string::append [1] 511930 IOT instruction (core dumped) ./odbc116559 Note that this only tests the one code path but all calls to that routine need fixing!
[6 Nov 2024 1:32]
Bogdan Degtyariov
Dear Mr. Hughes, Thank you for the detailed description and the test case for this issue. The bug is confirmed and the status is set to Verified. The developers team is going to work on fixing it in the nearest time.
[26 Feb 5:56]
Bogdan Degtyariov
Posted by developer: All uses of deprecated mysql_real_escape_string() function have been replaced by the internal myodbc_escape_string() implementation, which works similar to mysql_real_escape_string_quote(), but also is able to handle escaping of the patterns ('_' and '%') for the use in LIKE expressions.
[4 Mar 21:35]
Daniel So
Posted by developer: Added the following entry to the C/ODBC 9.3.0 changelog: "All instances of the deprecated function mysql_real_escape_string() in the source code have been replaced by an internal implementation of myodbc_escape_string(), which works similarly and can also handle the escaping of wildcard characters ('_' and '%') in LIKE expressions."