Bug #98035 ORDER BY does not work for a column with a string function and utf8mb4_0900_ai_c
| Submitted: | 20 Dec 2019 5:25 | Modified: | 22 Jan 2020 3:49 |
|---|---|---|---|
| Reporter: | Yuichi SUGIYAMA | Email Updates: | |
| Status: | Closed | Impact on me: | |
| Category: | MySQL Server: Optimizer | Severity: | S2 (Serious) |
| Version: | 8.0.18, 8.0.11 | OS: | Any |
| Assigned to: | CPU Architecture: | Any |
[20 Dec 2019 5:25]
Yuichi SUGIYAMA
[20 Dec 2019 6:07]
MySQL Verification Team
Hello SUGIYAMA-San, Thank you for the report and test case. Verified as described. regards, Umesh
[22 Jan 2020 3:49]
Jon Stephens
Documented fix as follows in the MySQL 8.0.20 changelog:
The NULL indicator was not properly written for items used as
variable-length keys, such that all such items were assumed to
be not NULL, which was considered equal to the empty string when
using certain collations. One visible effect of this issue was
that ordering by an expression using a nullable string was
sometimes not performed correctly. An example of such a query,
where c1 contained both NULL and empty string values, is shown
here:
SELECT c1, SUBSTR(c1,1) AS c2 FROM t ORDER BY c2;
Closed.
Portions of this website are copyright © 2001, 2002 The PHP Group
Page generated in 0.054 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.