Bug #104964 | When setting sql_mode as 'PIPES_AS_CONCAT', order by lose effectiveness | ||
---|---|---|---|
Submitted: | 17 Sep 2021 8:07 | Modified: | 17 Sep 2021 13:05 |
Reporter: | yi qian | Email Updates: | |
Status: | Not a Bug | Impact on me: | |
Category: | MySQL Server | Severity: | S3 (Non-critical) |
Version: | 8.0.24 | OS: | Linux |
Assigned to: | CPU Architecture: | x86 | |
Tags: | sql_mode,PIPES_AS_CONCAT,order by |
[17 Sep 2021 8:07]
yi qian
[17 Sep 2021 13:05]
MySQL Verification Team
Hi Mr. qian, Thank you for your bug report. However, this is not a bug. When PIPES_AS_CONCAT are enabled in the sql_mode, then all expressions of the kind : x || y become the identical to: concat(x,y); When you use integer or integer constants as the operands, then MySQL is forced to transform them first into the strings, since CONCAT() can be applied to strings only. In that case, you get ORDER by string values and not by integer values. Hence, what you are doing is totally expected behaviour, as described in our Reference Manual. Not a bug.