Skip to content

Commit 6606abb

Browse files
committed
MDEV-18319 BIGINT UNSIGNED Performance issue
The patch for MDEV-18319 BIGINT UNSIGNED Performance issue fixed this problem in 10.5.23. This patch adds only an MTR test to cover MDEV-18319.
1 parent 09bae92 commit 6606abb

File tree

2 files changed

+45
-0
lines changed

2 files changed

+45
-0
lines changed

mysql-test/main/func_in.result

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -979,5 +979,29 @@ c1
979979
9223372036854775808
980980
drop table `a`;
981981
#
982+
# MDEV-18319 BIGINT UNSIGNED Performance issue
983+
#
984+
CREATE OR REPLACE TABLE t1 (
985+
id bigint(20) unsigned NOT NULL AUTO_INCREMENT PRIMARY KEY
986+
);
987+
FOR i IN 0..255
988+
DO
989+
INSERT INTO t1 VALUES ();
990+
END FOR
991+
$$
992+
SELECT MIN(id), MAX(id), COUNT(*) FROM t1;
993+
MIN(id) MAX(id) COUNT(*)
994+
1 256 256
995+
EXPLAIN SELECT id FROM t1 WHERE id IN (1,2);
996+
id select_type table type possible_keys key key_len ref rows Extra
997+
1 SIMPLE t1 range PRIMARY PRIMARY 8 NULL 2 Using where; Using index
998+
EXPLAIN SELECT id FROM t1 WHERE id IN (9223372036854775806, 9223372036854775807);
999+
id select_type table type possible_keys key key_len ref rows Extra
1000+
1 SIMPLE t1 range PRIMARY PRIMARY 8 NULL 2 Using where; Using index
1001+
EXPLAIN SELECT id FROM t1 WHERE id IN (9223372036854775807, 9223372036854775808);
1002+
id select_type table type possible_keys key key_len ref rows Extra
1003+
1 SIMPLE t1 range PRIMARY PRIMARY 8 NULL 2 Using where; Using index
1004+
DROP TABLE t1;
1005+
#
9821006
# End of 10.5 tests
9831007
#

mysql-test/main/func_in.test

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -756,6 +756,27 @@ SELECT c1 FROM a WHERE c1 IN ( 1, 9223372036854775807 );
756756
SELECT c1 FROM a WHERE c1 IN ( 1, 9223372036854775808 );
757757
drop table `a`;
758758

759+
--echo #
760+
--echo # MDEV-18319 BIGINT UNSIGNED Performance issue
761+
--echo #
762+
763+
CREATE OR REPLACE TABLE t1 (
764+
id bigint(20) unsigned NOT NULL AUTO_INCREMENT PRIMARY KEY
765+
);
766+
DELIMITER $$;
767+
FOR i IN 0..255
768+
DO
769+
INSERT INTO t1 VALUES ();
770+
END FOR
771+
$$
772+
DELIMITER ;$$
773+
SELECT MIN(id), MAX(id), COUNT(*) FROM t1;
774+
EXPLAIN SELECT id FROM t1 WHERE id IN (1,2);
775+
EXPLAIN SELECT id FROM t1 WHERE id IN (9223372036854775806, 9223372036854775807);
776+
EXPLAIN SELECT id FROM t1 WHERE id IN (9223372036854775807, 9223372036854775808);
777+
DROP TABLE t1;
778+
779+
759780
--echo #
760781
--echo # End of 10.5 tests
761782
--echo #

0 commit comments

Comments
 (0)