Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-10873

Analyze setting final result of compound window functions

    XMLWordPrintable

    Details

      Description

      This code is now present, right before sending window function results out:

       
         if (join_tab->window_funcs_step)
            {
              Item **func_ptr= join_tab->tmp_table_param->items_to_copy;
              Item *func;
              for (; (func = *func_ptr) ; func_ptr++)
              {
                if (func->with_window_func) // Without this if statement results are wrong for other items without win_funcs
                  func->save_in_result_field(true);
              }
            }
       

      a + b, win_func(a+b) over () ...
      fails without that last if statement. This should be investigated further to understand the exact reason why this works, and if it covers all use cases.

      Later addition:
      The "if" approach is inefficient. We should try to make it such that we have the "compiled" list at setup time and then just iterate over them directly. Check MDEV-11907 fix.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              cvicentiu Vicențiu Ciorbaru
              Reporter:
              cvicentiu Vicențiu Ciorbaru
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:

                  Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.