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

In THD::cleanup(), apc_target.destroy() has assertion failure.

Details

    • Bug
    • Status: Closed (View Workflow)
    • Minor
    • Resolution: Not a Bug
    • 10.0(EOL)
    • N/A
    • Server
    • None

    Description

      In sql/sql_class.cc, THD::cleanup() calls apc_target.destroy().

      The latter has:
      DBUG_ASSERT(!enabled) which fails during our test which triggers this code path.

      The fix is to disable apc_target if it is enabled before destroying it.

      Proposed patch:

      void THD::cleanup(void)
      {
      ...
        DBUG_ASSERT(!mdl_context.has_locks());
       
      +  if (apc_target.is_enabled())
      +    apc_target.disable();
        apc_target.destroy();
      ...
      }

      Attachments

        Issue Links

          Activity

            Can you show your tests or explain how to trigger that?
            As far as I can see apt_target should be disabled when lex->explain is destroyed.

            Does it only happen in the context of MDEV-7095 — when you invoke that dead code in Ed_connection::execute_direct() ?

            serg Sergei Golubchik added a comment - Can you show your tests or explain how to trigger that? As far as I can see apt_target should be disabled when lex->explain is destroyed. Does it only happen in the context of MDEV-7095 — when you invoke that dead code in Ed_connection::execute_direct() ?
            minli zhu Minli Zhu added a comment -

            Yes, it is triggered by Ed_connection::execute_direct().

            minli zhu Minli Zhu added a comment - Yes, it is triggered by Ed_connection::execute_direct().
            cstarc chu huaxing added a comment -

            What is the latest development on this issue? I also encountered this problem, and I agree with Minli Zhu .

            cstarc chu huaxing added a comment - What is the latest development on this issue? I also encountered this problem, and I agree with Minli Zhu .

            Ed_connection::execute_direct() was dead code. Now we have a service API for executing SQL statements from inside the server, please, use that

            serg Sergei Golubchik added a comment - Ed_connection::execute_direct() was dead code. Now we have a service API for executing SQL statements from inside the server, please, use that

            People

              serg Sergei Golubchik
              minli zhu Minli Zhu
              Votes:
              0 Vote for this issue
              Watchers:
              4 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.