mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
Bug #42760: Select doesn't return desired results when we have null values
Part 2 : There was a special optimization on the ref access method for ORDER BY ... DESC that was set without actually looking on the type of the selected index for ORDER BY. Fixed the SELECT ... ORDER BY .. DESC (it uses a different code path compared to the ASC that has been fixed with the previous fix).
This commit is contained in:
@ -778,6 +778,15 @@ SELECT 1 AS col FROM t1 WHERE a=2 AND (c=10 OR c IS NULL) ORDER BY c;
|
||||
--echo # Must return 1 row
|
||||
SELECT 1 AS col FROM t1 WHERE a=2 AND (c=10 OR c IS NULL) ORDER BY c;
|
||||
|
||||
# part 2 of the problem : DESC test cases
|
||||
--echo # Must use ref-or-null on the a_c index
|
||||
--replace_column 1 x 2 x 3 x 6 x 7 x 8 x 9 x 10 x
|
||||
EXPLAIN
|
||||
SELECT 1 AS col FROM t1 WHERE a=2 AND (c=10 OR c IS NULL) ORDER BY c DESC;
|
||||
--echo # Must return 1 row
|
||||
SELECT 1 AS col FROM t1 WHERE a=2 AND (c=10 OR c IS NULL) ORDER BY c DESC;
|
||||
|
||||
|
||||
DROP TABLE t1;
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user