[MDEV-23921] main.index_intersect_innodb failed with 'index_merge' when expecting 'range' and 'Country,Name' in wrong order on hppa Created: 2020-10-08  Updated: 2023-10-09

Status: Open
Project: MariaDB Server
Component/s: Optimizer, Tests
Affects Version/s: 10.5.5, 10.11.5
Fix Version/s: 10.5

Type: Bug Priority: Minor
Reporter: Otto Kekäläinen Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None


 Description   

While importing MariaDB 10.5.5 to Debian.org, I noticed that the hppa build failed with:

main.index_intersect                     [ fail ]
        Test ended at 2020-10-08 13:21:09
 
CURRENT_TEST: main.index_intersect
--- /<<PKGBUILDDIR>>/mysql-test/main/index_intersect.result	2020-08-07 12:57:35.000000000 +0000
+++ /<<PKGBUILDDIR>>/mysql-test/main/index_intersect.reject	2020-10-08 13:21:09.031562286 +0000
@@ -715,7 +715,7 @@
 SELECT * FROM City 
 WHERE  Name BETWEEN 'G' AND 'J' AND Population > 500000 AND Country LIKE 'C%';
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
-1	SIMPLE	City	range	Population,Country,Name	Name	35	NULL	#	Using index condition; Using where
+1	SIMPLE	City	index_merge	Population,Country,Name	Name,Country	35,3	NULL	#	Using sort_intersect(Name,Country); Using where
 EXPLAIN
 SELECT * FROM City
 WHERE ID BETWEEN 1 AND 500 AND Population > 700000 AND Country LIKE 'C%';

Full log at https://buildd.debian.org/status/fetch.php?pkg=mariadb-10.5&arch=hppa&ver=1%3A10.5.5-3%7Eexp2&stamp=1602164461&raw=0

I noticed very similar issue https://jira.mariadb.org/browse/MDEV-615 (fixed by igor) from 2014 where also the words 'Country,Name' were in wrong order.



 Comments   
Comment by Otto Kekäläinen [ 2020-10-11 ]

I filed this downstream in Debian as https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=972054 in case some hppa experts from Debian could help out.

Comment by Daniel Black [ 2020-11-13 ]

try building under ASAN if supported on hppa, see if a corruption can be detected earlier

Comment by Tuukka Pasanen [ 2022-02-22 ]

danblack What do you mean about building under ASAN?

Comment by Daniel Black [ 2022-02-22 ]

Use compiler address sanitizer flags, but looking back on the comment, it may not be the best way. A check if the bug is still there in the 10.6 version on debian builders.

Comment by Otto Kekäläinen [ 2023-10-09 ]

I saw this again in https://buildd.debian.org/status/fetch.php?pkg=mariadb&arch=hppa&ver=1%3A10.11.5-2&stamp=1696821455&raw=0 (hppa Debian build of 1:10.11.5-2);

main.index_intersect_innodb 'innodb'     w1 [ fail ]
        Test ended at 2023-10-09 03:14:34
 
CURRENT_TEST: main.index_intersect_innodb
--- /<<PKGBUILDDIR>>/mysql-test/main/index_intersect_innodb.result	2023-08-11 06:35:40.000000000 +0000
+++ /<<PKGBUILDDIR>>/mysql-test/main/index_intersect_innodb.reject	2023-10-09 03:14:31.477794336 +0000
@@ -732,7 +732,7 @@
 WHERE ID BETWEEN 3001 AND 4000 AND Population > 600000
 AND Country BETWEEN 'S' AND 'Z';
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
-1	SIMPLE	City	range	PRIMARY,Population,Country	PRIMARY	4	NULL	#	Using where
+1	SIMPLE	City	index_merge	PRIMARY,Population,Country	PRIMARY,Population,Country	4,4,7	NULL	#	Using sort_intersect(PRIMARY,Population,Country); Using where
 SELECT * FROM City WHERE
 Name LIKE 'C%' AND Population > 1000000;
 ID	Name	Country	Population
 
mysqltest: Result length mismatch

Generated at Thu Feb 08 09:26:04 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.