[MDEV-6134] SUBSTRING_INDEX returns wrong result for 8bit character sets when delimiter is not found Created: 2014-04-18  Updated: 2014-06-02  Resolved: 2014-06-02

Status: Closed
Project: MariaDB Server
Component/s: None
Affects Version/s: 5.3.12, 5.5.37, 10.0.10
Fix Version/s: 5.5.38, 10.0.12, 5.3.13

Type: Bug Priority: Major
Reporter: Alexander Barkov Assignee: Alexander Barkov
Resolution: Fixed Votes: 0
Labels: None


 Description   

SELECT
  SUBSTRING_INDEX(_utf8'.wwwmysqlcom', _utf8'.', -2) AS c1,
  SUBSTRING_INDEX(_latin1'.wwwmysqlcom',_latin1'.', -2) AS c2;

returns

+--------------+----+
| c1           | c2 |
+--------------+----+
| .wwwmysqlcom |    |
+--------------+----+

c1 is correct, c2 is wrong.

MySQL-5.5 has the same problems.
MySQL-5.6 and 5.7 work fine.



 Comments   
Comment by Alexander Barkov [ 2014-04-21 ]

Pushed into 5.3 and 5.5

Generated at Thu Feb 08 07:09:37 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.