diff options
author | Sergei Petrunia <sergey@mariadb.com> | 2023-02-22 12:11:55 +0300 |
---|---|---|
committer | Sergei Petrunia <sergey@mariadb.com> | 2023-03-16 22:33:04 +0300 |
commit | ef5bb0814a2fe9093f48ed155b2cf179a8fd14c9 (patch) | |
tree | 2c909b0fed20b1388314d56837132844116a0a27 /mysql-test/main/selectivity_innodb.test | |
parent | 1310b3a02fe6c5eb14d61adbe13453ee0ab966fa (diff) | |
download | mariadb-git-ef5bb0814a2fe9093f48ed155b2cf179a8fd14c9.tar.gz |
MDEV-30693: Assertion `dbl_records <= s->records' failed in apply_selectivity_for_table on SELECT
The crash happened due to rows=2 vs rows=1 difference between how the
estimate of number of rows in a derived table is computed in
TABLE_LIST::fetch_number_of_rows() and JOIN::add_keyuses_for_splitting().
Made JOIN::add_keyuses_for_splitting() use the result of computations in
TABLE_LIST::fetch_number_of_rows().
Diffstat (limited to 'mysql-test/main/selectivity_innodb.test')
-rw-r--r-- | mysql-test/main/selectivity_innodb.test | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/mysql-test/main/selectivity_innodb.test b/mysql-test/main/selectivity_innodb.test index dc06287a1f9..efdb3c1853b 100644 --- a/mysql-test/main/selectivity_innodb.test +++ b/mysql-test/main/selectivity_innodb.test @@ -283,5 +283,14 @@ SELECT b FROM t WHERE a > 'a' GROUP BY b HAVING b >= 6 OR b <= 0; DROP TABLE t; --echo # +--echo # MDEV-30693: Assertion `dbl_records <= s->records' failed in apply_selectivity_for_table on SELECT +--echo # +set @tmp_oucs= @@optimizer_use_condition_selectivity; +CREATE TABLE t1 (c INT KEY) ENGINE=InnoDB; +SELECT * FROM (SELECT * FROM t1) a JOIN (SELECT * FROM (SELECT * FROM t1 GROUP BY c) d WHERE c>1) b ON a.c=b.c; +DROP TABLE t1; +SET optimizer_use_condition_selectivity=1; + +--echo # --echo # End of 11.0 tests --echo # |