Bug #75294 LEAST() works incorrectly on MySQL 5.6 with expression using other functions

Submitted: 23 Dec 2014 3:32 Modified: 25 Nov 2019 21:56
Reporter: Su Dylan Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: DML Severity:S3 (Non-critical)
Version:5.6.22, 5.6.23, 5.7.6 OS:Any
Assigned to: CPU Architecture:Any
Tags: LEAST

[23 Dec 2014 3:32] Su Dylan
Description:
A bug on LEAST():
mysql> select LEAST( SUBSTR( CONCAT('BBION' , 'OMRDL' ) , 4 ) ,CONCAT('VDACJ' ,'TEHQFTEHQF' ) );
+-----------------------------------------------------------------------------------+
| LEAST( SUBSTR( CONCAT('BBION' , 'OMRDL' ) , 4 ) ,CONCAT('VDACJ' ,'TEHQFTEHQF' ) ) |
+-----------------------------------------------------------------------------------+
| CJTEHQF                                                                           |
+-----------------------------------------------------------------------------------+
1 row in set (0.00 sec)

How to repeat:
mysql> select LEAST( SUBSTR( CONCAT('BBION' , 'OMRDL' ) , 4 ) ,CONCAT('VDACJ' ,'TEHQFTEHQF' ) );
+-----------------------------------------------------------------------------------+
| LEAST( SUBSTR( CONCAT('BBION' , 'OMRDL' ) , 4 ) ,CONCAT('VDACJ' ,'TEHQFTEHQF' ) ) |
+-----------------------------------------------------------------------------------+
| CJTEHQF                                                                           |
+-----------------------------------------------------------------------------------+
1 row in set (0.00 sec)
[23 Dec 2014 7:05] MySQL Verification Team
Hello!

Thank you for the report.

Thanks,
Umesh
[5 Sep 2017 15:38] Alexey Kopytov
This is not reproducible with MySQL 8.0.2.

Portions of this website are copyright © 2001, 2002 The PHP Group

Page generated in 0.042 sec. using MySQL 8.4.7-u6-cloud

Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.