[MDEV-33100] Backport MDEV-20468 to 10.4 Created: 2023-12-20  Updated: 2024-01-03  Resolved: 2024-01-02

Status: Closed
Project: MariaDB Server
Component/s: Optimizer
Fix Version/s: N/A

Type: Task Priority: Major
Reporter: Yuchen Pei Assignee: Yuchen Pei
Resolution: Won't Fix Votes: 0
Labels: None

Issue Links:
Blocks
blocks MDEV-26345 SELECT MIN on Spider table returns mo... Stalled
Relates
relates to MDEV-20468 Allocating more space than required f... Closed

 Description   

A solution for MDEV-26345 works only in 10.5+, because a change in a statement in do_select() seems to be needed. And that change is part of the fix for MDEV-20468 which was fixed for 10.5+ despite affecting 10.1+. So we may want to backport MDEV-20468 to 10.4. I already have a draft backport patch (04899dbba585aff687860a7d193202f3218b51bb) and the new buildbot seems to be happy so far. See also comment https://jira.mariadb.org/browse/MDEV-26345?focusedCommentId=277134&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-277134

The MDEV-20468 commit:

8e92d5e5e3842fbb805304f1d0e4f5b1def9a145
MDEV-20468: Allocating more space than required for JOIN_TAB array for a query with SJM table

The change that is needed for MDEV-26345:

@@ -19772,8 +19774,7 @@ do_select(JOIN *join, Procedure *procedure)
 
     if (join->pushdown_query->store_data_in_temp_table)
     {
-      JOIN_TAB *last_tab= join->join_tab + join->table_count -
-                          join->exec_join_tab_cnt();      
+      JOIN_TAB *last_tab= join->join_tab + join->exec_join_tab_cnt();
       last_tab->next_select= end_send;
 
       enum_nested_loop_state state= last_tab->aggr->end_send();



 Comments   
Comment by Yuchen Pei [ 2024-01-02 ]

Closing as won't fix, see https://jira.mariadb.org/browse/MDEV-26345?focusedCommentId=277578&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-277578

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