mirror of
https://github.com/MariaDB/server.git
synced 2026-04-19 06:45:32 +02:00
MDEV-30088 Assertion `cond_selectivity <= 1.0' failed in get_range_limit_read_cost
Fixed cost calculation for MERGE tables with 0 tables
This commit is contained in:
parent
3fa99f0c0e
commit
76d2a77d52
3 changed files with 28 additions and 1 deletions
|
|
@ -3925,3 +3925,16 @@ drop table tm, t;
|
|||
#
|
||||
# End of 10.8 tests
|
||||
#
|
||||
#
|
||||
# MDEV-30088 Assertion `cond_selectivity <= 1.0' failed in get_range_limit_read_cost
|
||||
#
|
||||
CREATE TABLE t1 (a TIMESTAMP, KEY(a)) ENGINE=MRG_MyISAM;
|
||||
explain SELECT a, COUNT(*) FROM t1 WHERE a >= '2000-01-01 00:00:00' GROUP BY a;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
|
||||
SELECT a, COUNT(*) FROM t1 WHERE a >= '2000-01-01 00:00:00' GROUP BY a;
|
||||
a COUNT(*)
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# End of 11.0 tests
|
||||
#
|
||||
|
|
|
|||
|
|
@ -2886,3 +2886,16 @@ drop table tm, t;
|
|||
--echo #
|
||||
--echo # End of 10.8 tests
|
||||
--echo #
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-30088 Assertion `cond_selectivity <= 1.0' failed in get_range_limit_read_cost
|
||||
--echo #
|
||||
|
||||
CREATE TABLE t1 (a TIMESTAMP, KEY(a)) ENGINE=MRG_MyISAM;
|
||||
explain SELECT a, COUNT(*) FROM t1 WHERE a >= '2000-01-01 00:00:00' GROUP BY a;
|
||||
SELECT a, COUNT(*) FROM t1 WHERE a >= '2000-01-01 00:00:00' GROUP BY a;
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo #
|
||||
--echo # End of 11.0 tests
|
||||
--echo #
|
||||
|
|
|
|||
|
|
@ -361,7 +361,8 @@ IO_AND_CPU_COST ha_myisammrg::keyread_time(uint index, ulong ranges,
|
|||
cost.cpu*= file->tables;
|
||||
}
|
||||
/* Add the cost of having to do a key lookup in all trees */
|
||||
cost.cpu+= (file->tables-1) * (ranges * KEY_LOOKUP_COST);
|
||||
if (file->tables)
|
||||
cost.cpu+= (file->tables-1) * (ranges * KEY_LOOKUP_COST);
|
||||
return cost;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue