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

SET changes @@default_master_connection’s system variable if the explicit connection name is blank

    XMLWordPrintable

Details

    • Can result in unexpected behaviour
    • Q4/2026 Replic. Development

    Description

      # Setup
      CHANGE MASTER 'name' TO master_host='127.0.0.1', master_user='root';
      SET @@SESSION.default_master_connection= 'name';
       
      SET @@GLOBAL.`name`.replicate_do_db= 'named';
      SET @@GLOBAL.``.replicate_do_db= 'unnamed';
       
      SELECT @@GLOBAL.name.replicate_do_db; #=> ❌ unnamed
      SELECT @@GLOBAL.``.replicate_do_db; #=> ❌ (empty)
       
      # Cleanup
      RESET SLAVE ALL;
      SET @@SESSION.default_master_connection= '';
      SET @@GLOBAL.replicate_do_db= DEFAULT;
      

      Code Analysis

      Sys_var_rpl_filter::global_update() and Sys_var_slave_parallel_mode::global_update() (and also Sys_var_slave_parallel_mode::global_value_ptr()) are detecting implicit @@default_master_connection by checking for zero length rather than null pointer.

      Attachments

        Issue Links

          Activity

            People

              gkodinov Georgi Kodinov
              ParadoxV5 Jimmy Hú
              External_Contributor External_Contributor
              Jimmy Hú Jimmy Hú
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - 0d
                  0d
                  Remaining:
                  Remaining Estimate - 0d
                  0d
                  Logged:
                  Time Spent - 1h 40m
                  1h 40m

                  Git Integration

                    Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.