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

Extended SELECT list contains unusable Item_func_sum when GROUP BY handler is used

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Minor
    • Resolution: Not a Bug
    • 10.2.15
    • N/A
    • Optimizer
    • None

    Description

      Given a query

      select sum(i)+1 from cs1;
      

      There are two elements in the extended SELECT that GROUP BY handler receives: Item_sum for sum(i) and Item_func_sum for sum(i)+1. Item_func_sum has Item_ref as its first argument. In the moment of the query execution this Item_ref references Item_temptable_field. Item_temptable_field corresponds with Item_sum in the SELECT list. This Item_temptable_field has a name attribute = "sum(i)" if the server code is built w/o DBUG_OFF. If DBUG_OFF is present there is no way to correlate this Item_temptable_field with Item_sum that is used by Columnstore semantic parser. Here is the place in sql_select.cc that populates the name attribute in a debug build. Columnstore symantic parser needs a way to correlate this two fields while parsing a query. My suggestion is to remove preprocessor condition if this is cheap in terms of processing overhead.

      Attachments

        Issue Links

          Activity

            People

              sanja Oleksandr Byelkin
              drrtuy Roman
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

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