[MDEV-29480] spider group by handler wrong result on order by aggregate alias Created: 2022-09-07  Updated: 2022-09-22  Resolved: 2022-09-20

Status: Closed
Project: MariaDB Server
Component/s: Storage Engine - Spider
Affects Version/s: 10.3, 10.4, 10.5, 10.6, 10.7, 10.8, 10.9, 10.10
Fix Version/s: 10.3.37, 10.4.27, 10.5.18, 10.6.11, 10.7.7, 10.8.6, 10.9.4, 10.10.2, 10.11.0

Type: Bug Priority: Major
Reporter: Nayuta Yanagisawa (Inactive) Assignee: Nayuta Yanagisawa (Inactive)
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Relates
relates to MDEV-29546 spider group by handler wrong result ... Open

 Description   

http://buildbot.askmonty.org/ci/reports/cross_reference#branch=&revision=&platform=&fail_name=spider/bugfix.mdev_29008&fail_variant=&fail_info_full=&typ=&info=&dt=&limit=100&fail_info_short=



 Comments   
Comment by Elena Stepanova [ 2022-09-12 ]

spider/bugfix.mdev_29008                 w1 [ fail ]
        Test ended at 2022-09-12 07:51:41
 
CURRENT_TEST: spider/bugfix.mdev_29008
--- /usr/share/mysql-test/plugin/spider/spider/bugfix/r/mdev_29008.result	2022-09-12 06:53:40.000000000 +0000
+++ /dev/shm/var/1/log/mdev_29008.reject	2022-09-12 07:51:39.743322459 +0000
@@ -24,8 +24,8 @@
 ) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT='table "tbl_a", srv "s_2_1"';
 SELECT MIN(t2.a) AS f1, t1.b AS f2 FROM tbl_a AS t1 JOIN tbl_a AS t2 GROUP BY f2 ORDER BY f1, f2;
 f1	f2
-1	2
 1	4
+1	2
 connection master_1;
 DROP DATABASE IF EXISTS auto_test_local;
 connection child2_1;
 
mysqltest: Result content mismatch

It looks like the failure happens exclusively on non-x86_64 builders – x86, ppc64le, aarch64.

Comment by Sergei Golubchik [ 2022-09-15 ]

fails the same way on x86_64 under --rr. The generated query is

select min(t1.`a`) `f1`,t0.`b` `b` from `auto_test_remote`.`tbl_a` t0 join `auto_test_remote`.`tbl_a` t1 group by t0.`b` order by `f1`,t1.`b`

note that the second element in the order by is incorrect

Comment by Nayuta Yanagisawa (Inactive) [ 2022-09-20 ]

serg Thank you for your patch. 8f9ac48 looks good to me. I'm pushing it to 10.3+.

Generated at Thu Feb 08 10:08:55 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.