mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
MDEV-31237 Assertion `!(tab->select && tab->select->quick)' failed in make_join_readinfo
The problem was a wrong assert. I changed it to match the code in best_access_path(). The given test case was a bit tricky for the optimizer, which first decided on using a index scan (because of force index), but then test_if_skip_sort_order() decided to use range anyway to handle distinct.
This commit is contained in:
@ -3824,5 +3824,20 @@ id MIN(id)
|
||||
8 8
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# MDEV-31237 Assertion `!(tab->select && tab->select->quick)' failed
|
||||
# in make_join_readinfo
|
||||
#
|
||||
CREATE TABLE lineitem (l_orderkey int, l_linenumber int, l_receiptDATE date DEFAULT NULL, PRIMARY KEY (l_orderkey,l_linenumber), KEY i_l_receiptdate (l_receiptDATE), KEY i_l_orderkey (l_orderkey)) ENGINE=InnoDB;
|
||||
INSERT INTO lineitem VALUES (291,1,'1994-06-23'),(291,2,'1994-06-19'),
|
||||
(291,3,'1994-03-24'),(292,1,'1992-03-18'),(292,2,'1992-04-20');
|
||||
EXPLAIN SELECT DISTINCT l_orderkey FROM lineitem FORCE KEY (i_l_orderkey, i_l_receiptdate) WHERE l_orderkey > 1 ORDER BY l_receiptdate;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE lineitem range i_l_orderkey i_l_orderkey 4 NULL 5 Using where; Using temporary; Using filesort
|
||||
SELECT DISTINCT l_orderkey FROM lineitem FORCE KEY (i_l_orderkey, i_l_receiptdate) WHERE l_orderkey > 1 ORDER BY l_receiptdate;
|
||||
l_orderkey
|
||||
292
|
||||
291
|
||||
DROP TABLE lineitem;
|
||||
#
|
||||
# End of 11.0 tests
|
||||
#
|
||||
|
Reference in New Issue
Block a user