Skip to content
/ server Public

MDEV-9247: Make default_master_connection settable globally#4630

Open
abhishek593 wants to merge 4 commits intoMariaDB:mainfrom
abhishek593:MDEV-9247
Open

MDEV-9247: Make default_master_connection settable globally#4630
abhishek593 wants to merge 4 commits intoMariaDB:mainfrom
abhishek593:MDEV-9247

Conversation

@abhishek593
Copy link

Change default_master_connection scope from SESSION_ONLY to SESSION_VAR. This allows the variable to be set globally, so that new connections automatically inherit the default master connection name.

Changes:

  • Updated scope macro in sql_vars.cc.
  • Added a new test in default_master_connection_basic.test and updated results of existing tests.

@gkodinov gkodinov added the External Contribution All PRs from entities outside of MariaDB Foundation, Corporation, Codership agreements. label Feb 9, 2026
@ParadoxV5 ParadoxV5 requested a review from andrelkin February 11, 2026 18:32
@ParadoxV5
Copy link
Contributor

I’d self-assign, but… global @@default_master_connection might have implications, so I’ll leave it to the JIRA-assigned senior.

By the way, I recall it’s a known design (limitation?) that changes to global variables are not reflected on session variables.

@abhishek593
Copy link
Author

Yes, that is the standard behaviour for SESSION_VAR. I used that to allow for a global default for new connections, while also having session isolation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

External Contribution All PRs from entities outside of MariaDB Foundation, Corporation, Codership agreements.

Development

Successfully merging this pull request may close these issues.

3 participants