mirror of
https://github.com/MariaDB/server.git
synced 2025-07-27 18:02:13 +03:00
MDEV-34474 InnoDB: Failing assertion: stat_n_leaf_pages > 0 in ha_innobase::estimate_rows_upper_bound
- Column stat_value and sample_size in mysql.innodb_index_stats table is declared as BIGINT UNSIGNED without any check constraint. user manually updates the value of stat_value and sample_size to zero. InnoDB aborts the server while reading the statistics information because InnoDB expects at least one leaf page to exist for the index. - To fix this issue, InnoDB should interpret the value of stat_n_leaf_pages, stat_index_size in innodb_index_stats stat_clustered_index_size, stat_sum_of_other_index_sizes in innodb_table_stats as valid one even though user mentioned it as 0.
This commit is contained in:
@ -174,3 +174,13 @@ SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_VIRTUAL LIMIT ROWS EXAMINED 5;
|
||||
SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_FOREIGN LIMIT ROWS EXAMINED 5;
|
||||
SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_FOREIGN_COLS LIMIT ROWS EXAMINED 5;
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# MDEV-34474 InnoDB: Failing assertion: stat_n_leaf_pages > 0
|
||||
# in ha_innobase::estimate_rows_upper_bound
|
||||
#
|
||||
CREATE TABLE t (c1 INT,c2 INT,
|
||||
INDEX(c1))STATS_PERSISTENT=1 ENGINE=INNODB;
|
||||
UPDATE mysql.innodb_index_stats SET stat_value=0 WHERE database_name like "test" and table_name like 't';
|
||||
UPDATE mysql.innodb_table_stats SET clustered_index_size= 0, sum_of_other_index_sizes=0 WHERE database_name like "test" and table_name like 't';
|
||||
UPDATE t SET c1=+1 ORDER BY c2;
|
||||
DROP TABLE t;
|
||||
|
Reference in New Issue
Block a user