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

Correlated subquery problems causing wrong results and server crash

    XMLWordPrintable

Details

    • Can result in hang or crash
    • Correlated subqueries causing incorrect results and crashes

    Description

      We have a general problem with relationship attribute data relating to Items representing subselects, particularly when these subselects are correlated to upper level selects via the use of outer references. How these attributes change during the various phases of execution, i.e.

      {prepare, optimize, execute}

      within each of

      {conventional, stored procedure, prepared statement, 1st execution, subsequent execution}

      is inconsistent.

      In this series of commits

      1 & 2) trivial changes to restrict building of lists not needed during certain operations.

      3) MDEV-30073. Igor's commit dealing with Items that need to survive between executions being allocated in statement memory.

      4 & 5) some fix-ups and suggestions from Monty.

      6) MDEV-32294. Code directly "inspired" by mysql's collapsing structures during query merges.

      7) MDEV-35673 during the development of main.outer_reference MTR file, a number of problems were encountered with correlated subselects. Searching outstanding issues revealed a number of similar problems. This patch deals with most of those issues by

      • Correcting the used table map for subquery/expressions which is currently, at times, incorrect. This involves allocating some items on statement memory, building and managing a list of items resolved in inner subqueries, and altering how table maps are accumulated in expressions.
      • Extending the structures updated when queries are merged, an extension of MDEV-32294 but this code is unrelated to mysql.
      • Avoiding un-needed processing during (re-)fixing items, solving many crashes. We have enough information gathered during the first fix_fields call to avoid calling fix_outer_field during any subsequent fix_fields call.

      Attachments

        Issue Links

          Activity

            People

              psergei Sergei Petrunia
              Johnston Rex Johnston
              Votes:
              0 Vote for this issue
              Watchers:
              2 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.