Re: Wrong result with maria-5.1-wl24 and index_merge / sort_union
Shorter, if not prettier, test case:
--disable_query_log
--disable_result_log
CREATE TABLE `table100000_myisam_int_autoinc` (
`col_smallint_key` smallint(6) DEFAULT NULL,
`pk` int(11) NOT NULL AUTO_INCREMENT,
`col_varchar_10_key` varchar(10) DEFAULT NULL,
`col_varchar_64_key` varchar(64) DEFAULT NULL,
PRIMARY KEY (`pk`),
KEY `col_smallint_key` (`col_smallint_key`),
KEY `col_varchar_10_key` (`col_varchar_10_key`),
KEY `col_varchar_64_key` (`col_varchar_64_key`)
) ENGINE=MyISAM AUTO_INCREMENT=100001 DEFAULT CHARSET=latin1;
INSERT INTO `table100000_myisam_int_autoinc` VALUES (30371,99001,'dl','e');
INSERT INTO `table100000_myisam_int_autoinc` VALUES (3,99002,'Ohio','t');
INSERT INTO `table100000_myisam_int_autoinc` VALUES (9,99003,'Delaware','xb');
INSERT INTO `table100000_myisam_int_autoinc` VALUES (0,99004,'Pennsylvan','i');
INSERT INTO `table100000_myisam_int_autoinc` VALUES (179,99427,'fliq','because');
INSERT INTO `table100000_myisam_int_autoinc` VALUES (16636,99428,'North Dako','quqfliqfccziolgabsnmondcxpgfp');
INSERT INTO `table100000_myisam_int_autoinc` VALUES (NULL,99429,'Maryland','vxquq');
INSERT INTO `table100000_myisam_int_autoinc` VALUES (0,99430,'i','l');
INSERT INTO `table100000_myisam_int_autoinc` VALUES (195,99431,'m','me');
INSERT INTO `table100000_myisam_int_autoinc` VALUES (19123,99432,'up','lb');
INSERT INTO `table100000_myisam_int_autoinc` VALUES (8,99433,'it\'s','j');
INSERT INTO `table100000_myisam_int_autoinc` VALUES (7,99434,'now','one');
INSERT INTO `table100000_myisam_int_autoinc` VALUES (0,99995,'rtcfyygbit','m');
INSERT INTO `table100000_myisam_int_autoinc` VALUES (0,99996,'sxnmrtcfyy','Maryland');
INSERT INTO `table100000_myisam_int_autoinc` VALUES (NULL,99997,'usxnmrtcfy','North Carolina');
INSERT INTO `table100000_myisam_int_autoinc` VALUES (210,99998,'e','k');
INSERT INTO `table100000_myisam_int_autoinc` VALUES (10958,99999,'gz','Wisconsin');
INSERT INTO `table100000_myisam_int_autoinc` VALUES (38,100000,'ihgzkeausx','di');
--enable_query_log
--enable_result_log
SELECT COUNT
FROM `table100000_myisam_int_autoinc` IGNORE KEY (col_varchar_64_key,col_varchar_10_key) WHERE ( ( `col_varchar_64_key` = 'i' ) OR `col_varchar_10_key` IN ( 'Arkansas' , 'd' , 'pdib' , 'can' ) ) OR ( `pk` BETWEEN 120 AND 79 + 255 OR `col_smallint_key` IN ( 4 , 179 , 1 ) ) AND ( ( `col_smallint_key` > 8 ));
SELECT COUNT
FROM `table100000_myisam_int_autoinc` WHERE ( ( `col_varchar_64_key` = 'i' ) OR `col_varchar_10_key` IN ( 'Arkansas' , 'd' , 'pdib' , 'can' ) ) OR ( `pk` BETWEEN 120 AND 79 + 255 OR `col_smallint_key` IN ( 4 , 179 , 1 ) ) AND ( ( `col_smallint_key` > 8 ));
Re: Wrong result with maria-5.1-wl24 and index_merge / sort_union