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

Per-row bulk execution is not reprepared on Galera

    XMLWordPrintable

Details

    Description

      Found by code review, not reproduced (no Galera setup).

      In Prepared_statement::execute_bulk_loop() the reprepare is in the else branch of the WSREP check:

      #ifdef WITH_WSREP
          if (!bulk_optimized && WSREP(thd))      // !CF_PS_ARRAY_BINDING_OPTIMIZED before MDEV-23864
          {
            if (wsrep_after_statement(thd))
            { ... }
          }
          else
      #endif /* WITH_WSREP */
          if (unlikely(error) &&
              (sql_command_flags[lex->sql_command] & CF_REEXECUTION_FRAGILE) &&
              ... reprepare_observer.is_invalidated() ...)
          {
            thd->clear_error();
            error= reprepare();
            ...

      So on a Galera node a bulk UPDATE/DELETE (and, after MDEV-23864, INSERT/REPLACE with a subquery depending on a parameter) whose tables changed after PREPARE should return ER_NEED_REPREPARE to the client instead of being reprepared. Prepared_statement::execute_loop() reprepares in this case.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              sanja Oleksandr Byelkin
              Votes:
              0 Vote for this issue
              Watchers:
              1 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.