summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVarun Gupta <varun.gupta@mariadb.com>2020-07-17 22:00:36 +0530
committerVarun Gupta <varun.gupta@mariadb.com>2020-07-18 10:19:13 +0530
commitc400ef2586bd188858ff43f2120fdf17475f2fdb (patch)
tree76d7b604ff0293155887c4e2843f8fa353a409df
parent1ba8df4c60cd0e149c5a37ef88bee96dfd7cd95d (diff)
downloadmariadb-git-c400ef2586bd188858ff43f2120fdf17475f2fdb.tar.gz
Making the stat_tables_innodb test deterministic
-rw-r--r--mysql-test/r/stat_tables_innodb.result21
-rw-r--r--mysql-test/t/stat_tables_innodb.test15
2 files changed, 15 insertions, 21 deletions
diff --git a/mysql-test/r/stat_tables_innodb.result b/mysql-test/r/stat_tables_innodb.result
index 5f393dde05e..fd9f337c30d 100644
--- a/mysql-test/r/stat_tables_innodb.result
+++ b/mysql-test/r/stat_tables_innodb.result
@@ -773,30 +773,25 @@ set optimizer_switch=@save_optimizer_switch_for_stat_tables_test;
#
# MDEV-22851: Engine independent index statistics are incorrect for large tables on Windows.
#
-CREATE TABLE t1 AS SELECT TABLE_CATALOG FROM INFORMATION_SCHEMA.COLUMNS;
-INSERT INTO t1 SELECT * FROM t1;
-INSERT INTO t1 SELECT * FROM t1;
-INSERT INTO t1 SELECT * FROM t1;
-INSERT INTO t1 SELECT * FROM t1;
-INSERT INTO t1 SELECT * FROM t1;
+CREATE TABLE t1(a INT) ENGINE=INNODB;
+INSERT INTO t1 SELECT 1 FROM seq_1_to_60000;
SET @save_use_stat_tables= @@use_stat_tables;
SET use_stat_tables= preferably;
SELECT count(*) FROM t1;
count(*)
-54336
-CREATE INDEX idx ON t1(TABLE_CATALOG);
-Warnings:
-Warning 1071 Specified key was too long; max key length is 767 bytes
-ANALYZE TABLE t1 PERSISTENT FOR COLUMNS (TABLE_CATALOG) INDEXES (idx);
+60000
+CREATE INDEX idx ON t1(a);
+ANALYZE TABLE t1 PERSISTENT FOR COLUMNS (a) INDEXES (idx);
Table Op Msg_type Msg_text
test.t1 analyze status Engine-independent statistics collected
test.t1 analyze status OK
SELECT * FROM mysql.index_stats where table_name='t1';
db_name table_name index_name prefix_arity avg_frequency
-test t1 idx 1 NULL
+test t1 idx 1 60000.0000
SELECT * FROM mysql.column_stats where table_name='t1';
db_name table_name column_name min_value max_value nulls_ratio avg_length avg_frequency hist_size hist_type histogram
-test t1 TABLE_CATALOG def def 0.0000 3.0000 54336.0000 0 NULL NULL
+test t1 a 1 1 0.0000 4.0000 60000.0000 0 NULL NULL
SET use_stat_tables= @save_use_stat_tables;
DROP TABLE t1;
+# end of 10.1 tests
SET SESSION STORAGE_ENGINE=DEFAULT;
diff --git a/mysql-test/t/stat_tables_innodb.test b/mysql-test/t/stat_tables_innodb.test
index e4a11955aba..008ca6911e9 100644
--- a/mysql-test/t/stat_tables_innodb.test
+++ b/mysql-test/t/stat_tables_innodb.test
@@ -1,4 +1,5 @@
--source include/have_innodb.inc
+--source include/have_sequence.inc
SET SESSION STORAGE_ENGINE='InnoDB';
@@ -13,21 +14,19 @@ set optimizer_switch=@save_optimizer_switch_for_stat_tables_test;
--echo # MDEV-22851: Engine independent index statistics are incorrect for large tables on Windows.
--echo #
-CREATE TABLE t1 AS SELECT TABLE_CATALOG FROM INFORMATION_SCHEMA.COLUMNS;
-INSERT INTO t1 SELECT * FROM t1;
-INSERT INTO t1 SELECT * FROM t1;
-INSERT INTO t1 SELECT * FROM t1;
-INSERT INTO t1 SELECT * FROM t1;
-INSERT INTO t1 SELECT * FROM t1;
+CREATE TABLE t1(a INT) ENGINE=INNODB;
+INSERT INTO t1 SELECT 1 FROM seq_1_to_60000;
SET @save_use_stat_tables= @@use_stat_tables;
SET use_stat_tables= preferably;
SELECT count(*) FROM t1;
-CREATE INDEX idx ON t1(TABLE_CATALOG);
-ANALYZE TABLE t1 PERSISTENT FOR COLUMNS (TABLE_CATALOG) INDEXES (idx);
+CREATE INDEX idx ON t1(a);
+ANALYZE TABLE t1 PERSISTENT FOR COLUMNS (a) INDEXES (idx);
SELECT * FROM mysql.index_stats where table_name='t1';
SELECT * FROM mysql.column_stats where table_name='t1';
SET use_stat_tables= @save_use_stat_tables;
DROP TABLE t1;
+--echo # end of 10.1 tests
+
SET SESSION STORAGE_ENGINE=DEFAULT;