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

Item_direct_view created in statement memory and rolled back

    Details

    • Type: Bug
    • Status: Open (View Workflow)
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 5.5, 10.0, 10.1, 10.2, 10.3
    • Fix Version/s: 10.4
    • Component/s: None
    • Labels:
      None

      Description

      There is following hack:

            // in PS use own arena or data will be freed after prepare
            if (register_tree_change &&
                thd->stmt_arena->is_stmt_prepare_or_first_stmt_execute())
              arena= thd->activate_stmt_arena_if_needed(&backup);
      

      Which create rolled back view reference items but in persistent memory.

      It used (for example) by semijoin expression constructor:

        /*
            Create Item_func_eq. Note that
            1. this is done on the statement, not execution, arena
            2. if it's a PS then this happens only once - on the first execution.
               On following re-executions, the item will be fix_field-ed normally.
            3. Thus it should be created as if it was fix_field'ed, in particular
               all pointers to items in the execution arena should be protected
               with thd->change_item_tree
          */
          Item_func_eq *item_eq=
            new Item_func_eq(subq_pred->left_expr_orig, subq_lex->ref_pointer_array[0]);
          if (!item_eq)
            DBUG_RETURN(TRUE);
          if (subq_pred->left_expr_orig != subq_pred->left_expr)
            thd->change_item_tree(item_eq->arguments(), subq_pred->left_expr);
          item_eq->in_equality_no= 0;
          sj_nest->sj_on_expr= and_items(sj_nest->sj_on_expr, item_eq);
      

      where right part of equality will never rolled back correctly but just will use persistent Item.

      This rolling back was made by historically and is not needed any more so can be removed.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                sanja Oleksandr Byelkin
                Reporter:
                sanja Oleksandr Byelkin
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated: