summaryrefslogtreecommitdiff
path: root/mysql-test/main/range.test
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2018-08-28 12:22:56 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2018-08-28 12:22:56 +0300
commit7830fb7f45b3824c0375c00ae2cab357165904cf (patch)
tree730521737fdc48e69f7650819e9a29da6487e1f4 /mysql-test/main/range.test
parentb805ebd7ed49868f83e6fd3fe72a11ddacdce452 (diff)
parent55163ba1bdb1a05daadc66c41c959994231b361c (diff)
downloadmariadb-git-7830fb7f45b3824c0375c00ae2cab357165904cf.tar.gz
Merge 10.2 into 10.3
Diffstat (limited to 'mysql-test/main/range.test')
-rw-r--r--mysql-test/main/range.test33
1 files changed, 33 insertions, 0 deletions
diff --git a/mysql-test/main/range.test b/mysql-test/main/range.test
index 7006f15e320..bd2299bac5f 100644
--- a/mysql-test/main/range.test
+++ b/mysql-test/main/range.test
@@ -2018,5 +2018,38 @@ set optimizer_switch=@save_optimizer_switch;
drop table t1,t2,t3;
--echo #
+--echo # MDEV-16934: using system variable eq_range_index_dive_limit
+--echo # to reduce the number of index dives
+--echo #
+
+create table t1 (a int, b varchar(31), index idx(a));
+
+insert into t1 values
+ (7,'xxxx'), (1,'yy'), (3,'aaa'), (1,'bbb'), (2,'zz'),
+ (4,'vvvvv'), (7,'ddd'), (9,'zzzzz'), (1,'cc'), (5,'ffff');
+insert into t1 select a+10, concat(b,'zz') from t1;
+insert into t1 select a+15, concat(b,'yy') from t1;
+insert into t1 select a+100, concat(b,'xx') from t1;
+
+analyze table t1;
+
+select cast(count(a)/count(distinct a) as unsigned) as rec_per_key from t1;
+
+let $q=
+select * from t1 where a in (8, 15, 31, 1, 9);
+
+set eq_range_index_dive_limit=0;
+eval explain $q;
+eval $q;
+
+set eq_range_index_dive_limit=2;
+eval explain $q;
+eval $q;
+
+set eq_range_index_dive_limit=default;
+
+drop table t1;
+
+--echo #
--echo # End of 10.2 tests
--echo #