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

Remove unneeded extra call to engine->exec() in Item_subselect::exec, remove enum store_key_result

    Details

    • Type: Task
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Fix Version/s: 5.5.28a
    • Component/s: None
    • Labels:
      None

      Description

      In MariaDB 5.3 I introduced early subquery optimization. As a result the logic
      in Item_subselect::exec that calls engine->exec second time if the engine was
      changed is not needed. The reason is that in the past optimization and engine
      change was done lazily during the first call to engine->exec(). From 5.3 this is
      not true, the engine is changed before execution, so even the first execution is
      done with the right engine.

      We cannot simply remove this logic completely, because there are still few
      border cases when optimization is done lazily. However Item_subselect::exec
      should check if the engine was chosen within itself (and then re-execute),
      or if the engine was chosen before execution, and then do not re-execute.

      In addition, this task will change

      enum store_key_result

      { STORE_KEY_OK, STORE_KEY_FATAL, STORE_KEY_CONV }

      into a boolean because STORE_KEY_CONV is not used anywhere, and
      the above enum has only two values.

        Gliffy Diagrams

          Attachments

            Activity

            Hide
            sanja Oleksandr Byelkin added a comment -

            The patch is OK.

            Show
            sanja Oleksandr Byelkin added a comment - The patch is OK.
            Hide
            timour Timour Katchaounov added a comment -

            Pushed to MariaDB 5.5.29

            Show
            timour Timour Katchaounov added a comment - Pushed to MariaDB 5.5.29

              People

              • Assignee:
                timour Timour Katchaounov
                Reporter:
                timour Timour Katchaounov
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Due:
                  Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - 1 day
                  1d
                  Remaining:
                  Time Spent - 4 hours Remaining Estimate - 4 hours
                  4h
                  Logged:
                  Time Spent - 4 hours Remaining Estimate - 4 hours
                  4h