[MDEV-3734] LP:637978 - Wrong result with maria-5.1-wl24 and index_merge / sort_union Created: 2010-09-14  Updated: 2015-02-02  Resolved: 2012-10-04

Status: Closed
Project: MariaDB Server
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major
Reporter: Philip Stoev (Inactive) Assignee: Igor Babaev
Resolution: Fixed Votes: 0
Labels: Launchpad

Attachments: XML File LPexportBug637978.xml     File LPexportBug637978_bug637978-2.dump     Zip Archive LPexportBug637978_bug637978.dump.zip    

 Description   

The following query:

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 ))

returns 3212 when executed with index_merge and sort_union in maria-5.1-wl24 and 3379 when executed with maria-5.1 or with IGNORE INDEX and a full table scan.



 Comments   
Comment by Philip Stoev (Inactive) [ 2010-09-14 ]

Re: Wrong result with maria-5.1-wl24 and index_merge / sort_union

Comment by Philip Stoev (Inactive) [ 2010-09-14 ]

mysqldump of table
LPexportBug637978_bug637978.dump.zip

Comment by Philip Stoev (Inactive) [ 2010-09-15 ]

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 ));

Comment by Philip Stoev (Inactive) [ 2010-09-15 ]

Re: Wrong result with maria-5.1-wl24 and index_merge / sort_union

Comment by Philip Stoev (Inactive) [ 2010-09-15 ]

table with 1000 rows and just the 4 required columns
LPexportBug637978_bug637978-2.dump

Comment by Rasmus Johansson (Inactive) [ 2011-12-13 ]

Launchpad bug id: 637978

Generated at Thu Feb 08 06:50:49 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.