summaryrefslogtreecommitdiff
path: root/mysql-test/t/stat_tables.test
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2019-04-25 09:04:09 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2019-04-25 09:04:09 +0300
commitbc145193c164b895a52b943e73fff53952d48a60 (patch)
tree278a02f85834d7ed8fa6933959e9b3b96655d1e1 /mysql-test/t/stat_tables.test
parent1f1a61cfc41a01ffa65d568eebdc037a54b5c463 (diff)
parentbfb0726fc24acb896e54bc7ef7536ad1aab9d574 (diff)
downloadmariadb-git-bc145193c164b895a52b943e73fff53952d48a60.tar.gz
Merge 10.1 into 10.2
Diffstat (limited to 'mysql-test/t/stat_tables.test')
-rw-r--r--mysql-test/t/stat_tables.test55
1 files changed, 55 insertions, 0 deletions
diff --git a/mysql-test/t/stat_tables.test b/mysql-test/t/stat_tables.test
index 89c11ed4acf..93caa47ce79 100644
--- a/mysql-test/t/stat_tables.test
+++ b/mysql-test/t/stat_tables.test
@@ -401,6 +401,61 @@ SELECT MAX(pk) FROM t1;
DROP TABLE t1;
+
+--echo #
+--echo # MDEV-17605: SHOW INDEXES with use_stat_tables='preferably'
+--echo #
+
+set use_stat_tables='preferably';
+
+CREATE DATABASE dbt3_s001;
+
+use dbt3_s001;
+
+set @save_optimizer_switch=@@optimizer_switch;
+set optimizer_switch='extended_keys=off';
+
+--disable_query_log
+--disable_result_log
+--disable_warnings
+--source include/dbt3_s001.inc
+create index i_p_retailprice on part(p_retailprice);
+delete from mysql.table_stats;
+delete from mysql.column_stats;
+delete from mysql.index_stats;
+ANALYZE TABLE lineitem;
+FLUSH TABLE mysql.table_stats, mysql.index_stats;
+--enable_warnings
+--enable_result_log
+--enable_query_log
+
+select * from mysql.table_stats;
+select * from mysql.index_stats;
+
+SHOW INDEXES FROM lineitem;
+
+SELECT * FROM INFORMATION_SCHEMA.STATISTICS WHERE table_name='lineitem';
+
+SELECT
+ COUNT(DISTINCT l_orderkey), COUNT(DISTINCT l_orderkey,l_linenumber),
+ COUNT(DISTINCT l_shipDATE),
+ COUNT(DISTINCT l_partkey), COUNT(DISTINCT l_partkey,l_suppkey),
+ COUNT(DISTINCT l_suppkey), COUNT(DISTINCT l_receiptDATE),
+ COUNT(DISTINCT l_orderkey, l_quantity), COUNT(DISTINCT l_commitDATE)
+FROM lineitem;
+
+set optimizer_switch=@save_optimizer_switch;
+
+DROP DATABASE dbt3_s001;
+USE test;
+
+delete from mysql.table_stats;
+delete from mysql.column_stats;
+delete from mysql.index_stats;
+
+set @save_optimizer_switch=@@optimizer_switch;
+set use_stat_tables=@save_use_stat_tables;
+
--echo #
--echo # MDEV-18899: Server crashes in Field::set_warning_truncated_wrong_value
--echo #