Bug #113933 Contribution: Fix multibyte bugs in my_instr_mb
Submitted: 8 Feb 15:38 Modified: 11 Jun 16:45
Reporter: OCA Admin (OCA) Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Charsets Severity:S3 (Non-critical)
Version:8.0 OS:Any
Assigned to: CPU Architecture:Any

[8 Feb 15:38] OCA Admin
Description:
This bug tracks a contribution by Dirkjan Bussink (Github user: dbussink) as described in http://github.com/mysql/mysql-server/pull/515

How to repeat:
See description

Suggested fix:
See contribution code attached
[8 Feb 15:38] OCA Admin
Contribution submitted via Github - Fix multibyte bugs in my_instr_mb 
(*) Contribution by Dirkjan Bussink (Github dbussink, mysql-server/pull/515#issuecomment-1933838710): I confirm the code being submitted is offered under the terms of the OCA, and that I am authorized to contribute it.

Contribution: git_patch_1717171812.txt (text/plain), 7.39 KiB.

[8 Feb 17:14] MySQL Verification Team
Thank you for your contribution.

This bug is now verified for version 8.0 and higher.
[11 Jun 16:45] Jon Stephens
Documented fix as follows in the MySQL 9.0.0 changelog:

    The internal function my_instr_mb() assumed incorrectly
    assumption in several places that byte lengths for input strings
    could be used to short-cut certain decisions. In the case of
    multibyte character sets and collations, this cannot be done
    since, under some collation rules, characters with differing
    byte lengths can be considered equal. In addition,
    Item_func_locate() used an incorrect byte length is used.

    Our thanks to Dirkjan Bussink for the contribution.

Closed.
[12 Jun 10:05] MySQL Verification Team
Thank you, Jon.