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

Refactor: clean up THD::decide_logging_format() checks

    XMLWordPrintable

Details

    • Q1/2026 Server Development

    Description

      The logic of THD::decide_logging_format() can be simplified (and these patterns can be used to clean-up other code as well).

      1. Checks for whether or not binary logging is enabled server-wide are not consistent. Usually mysql_bin_log.is_open() is used, but there are other checks used elsewhere in the codebase inconsistently (e.g. wsrep_emulate_bin_log). This should be made into an inline function, and used everywhere so the checks are consistent.
      2. There are cases when binlogging is dynamically decided to not be used (e.g. if an error is detected). There is no set convention when this happens, which complicates further checks/assertions. As a general policy, binlog_format can be set to BINLOG_FORMAT_UNSPEC to indicate that binary logging should be disabled for the current transaction.
      3. THD::decide_logging_format should be skipped when binary logging is disabled.
      4. WSREP only works when binlog_format=BINLOG_FORMAT_ROW. Various pieces of logic can be simplified because of this (e.g. wsrep_forced_binlog_format, wsrep_binlog_format()).

      Attachments

        Issue Links

          Activity

            People

              monty Michael Widenius
              bnestere Brandon Nesterenko
              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.