summaryrefslogtreecommitdiff
path: root/mysql-test/main/innodb_ext_key.test
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test/main/innodb_ext_key.test')
-rw-r--r--mysql-test/main/innodb_ext_key.test23
1 files changed, 21 insertions, 2 deletions
diff --git a/mysql-test/main/innodb_ext_key.test b/mysql-test/main/innodb_ext_key.test
index 413d5570be5..4e04f032864 100644
--- a/mysql-test/main/innodb_ext_key.test
+++ b/mysql-test/main/innodb_ext_key.test
@@ -620,6 +620,25 @@ select * from t1 force index(k1) where f2 <= 5 and pk2 <=5 and pk1 = 'abc' and
drop table t1;
SET optimizer_use_condition_selectivity=@save_optimizer_use_condition_selectivity;
+
+--echo #
+--echo # MDEV-11172: EXPLAIN shows non-sensical value for key_len with type=index
+--echo #
+
+CREATE TABLE t1(a INT);
+INSERT INTO t1 VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
+
+CREATE TABLE t2 (
+ pk VARCHAR(50),
+ a VARCHAR(20),
+ KEY k1(a),
+ PRIMARY KEY(pk)
+)ENGINE=INNODB;
+
+INSERT INTO t2 SELECT a,a FROM t1;
+EXPLAIN SELECT pk FROM t2 FORCE INDEX(k1);
+
+DROP TABLE t1,t2;
+
set global innodb_stats_persistent= @innodb_stats_persistent_save;
-set global innodb_stats_persistent_sample_pages=
- @innodb_stats_persistent_sample_pages_save;
+set global innodb_stats_persistent_sample_pages= @innodb_stats_persistent_sample_pages_save;