Bug #79884 "SUBSTRING_INDEX( 'a', 'b', 6192449487634432 )" returns '',not expected 'a'
Submitted: 8 Jan 2016 9:33 Modified: 9 Dec 2019 21:02
Reporter: Su Dylan Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: DML Severity:S3 (Non-critical)
Version:5.7.8, 5.5.48, 5.6.28, 5.7.10 OS:Any
Assigned to: CPU Architecture:Any

[8 Jan 2016 9:33] Su Dylan
Description:
Output:
=====
mysql> SELECT SUBSTRING_INDEX( 'a', 'b', 6192449487634431 ), SUBSTRING_INDEX( 'a', 'b', 6192449487634432 ), SUBSTRING_INDEX( 'a', 'b', 6192449487634433 );
+-----------------------------------------------+-----------------------------------------------+-----------------------------------------------+
| SUBSTRING_INDEX( 'a', 'b', 6192449487634431 ) | SUBSTRING_INDEX( 'a', 'b', 6192449487634432 ) | SUBSTRING_INDEX( 'a', 'b', 6192449487634433 ) |
+-----------------------------------------------+-----------------------------------------------+-----------------------------------------------+
| a                                             |                                               | a                                             |
+-----------------------------------------------+-----------------------------------------------+-----------------------------------------------+
1 row in set (0.00 sec)

mysql> select version();
+-----------+
| version() |
+-----------+
| 5.7.8-rc  |
+-----------+
1 row in set (0.00 sec)

Problem:
=====

How to repeat:
SELECT SUBSTRING_INDEX( 'a', 'b', 6192449487634431 ), SUBSTRING_INDEX( 'a', 'b', 6192449487634432 ), SUBSTRING_INDEX( 'a', 'b', 6192449487634433 );

Suggested fix:
SUBSTRING_INDEX( 'a', 'b', 6192449487634432 ) returns 'a'.
[8 Jan 2016 11:06] MySQL Verification Team
Thank you for the report.
Observed this with 5.5.48, 5.6.28 and 5.7.10 builds.

Thanks,
Umesh
[9 Dec 2019 21:02] Roy Lyseng
Posted by developer:
 
Fixed in 8.0.18