Bug #117455 MEMORY engine CHAR type comparison results differ from expectations.
Submitted: 13 Feb 2:13 Modified: 13 Feb 5:50
Reporter: wang jack Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Memory storage engine Severity:S2 (Serious)
Version:8.4.1 9.1.0, 8.4.4, 8.0.41 OS:Windows (windows 11)
Assigned to: CPU Architecture:x86 (x86_64)

[13 Feb 2:13] wang jack
Description:
From my understanding, the first query below should return 4 rows, but it is actually return 3 rows.

mysql> SELECT ALL t0.c0 FROM t0 WHERE (NOT ((t0.c0) <= ("")));
+--------------------+
| c0                 |
+--------------------+
| ?b,k               |
| [>cu,?             |
| 0.5799393086757669 |
+--------------------+
3 rows in set (0.00 sec)

mysql> SELECT SUM(((NOT ((t0.c0) <= ("")))) IS TRUE) FROM t0;
+----------------------------------------+
| SUM(((NOT ((t0.c0) <= ("")))) IS TRUE) |
+----------------------------------------+
|                                      4 |
+----------------------------------------+
1 row in set (0.00 sec)

How to repeat:
DROP TABLE IF EXISTS t0; 
CREATE TABLE IF NOT EXISTS t0(c0 CHAR(230)) ENGINE = MEMORY;
CREATE INDEX i1 USING BTREE ON t0(c0 ASC);
REPLACE INTO t0(c0) VALUES("[>cu,᠈");
INSERT DELAYED INTO t0(c0) VALUES('\n5');
INSERT INTO t0(c0) VALUES('ῑb,k');
REPLACE INTO t0(c0) VALUES('0.5799393086757669');

SELECT ALL t0.c0 FROM t0 WHERE (NOT ((t0.c0) <= ("")));
SELECT SUM(((NOT ((t0.c0) <= ("")))) IS TRUE) FROM t0;
[13 Feb 5:50] MySQL Verification Team
Hello wang jack,

Thank you for the report and test case.
Verified as described.

regards,
Umesh