-
Notifications
You must be signed in to change notification settings - Fork 713
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FB8-76: Add current master host:port to server read only error when available #958
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
mysql-test/suite/sys_vars/r/read_only_error_msg_extra_basic.result
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
set @@global.read_only_error_msg_extra='Custom message before read_only'; | ||
select @@global.read_only_error_msg_extra; | ||
@@global.read_only_error_msg_extra | ||
Custom message before read_only | ||
set global read_only = true; | ||
set @@global.read_only_error_msg_extra = default; | ||
select @@global.read_only_error_msg_extra; | ||
@@global.read_only_error_msg_extra | ||
|
||
set @saved_read_only_error_msg_extra = @@global.read_only_error_msg_extra; | ||
set @@global.read_only_error_msg_extra='This is a custom message'; | ||
set global super_read_only = true; | ||
set @@global.read_only_error_msg_extra='This is another custom message'; | ||
set @@global.read_only_error_msg_extra=1; | ||
ERROR 42000: Incorrect argument type to variable 'read_only_error_msg_extra' | ||
select @@session.read_only_error_msg_extra; | ||
ERROR HY000: Variable 'read_only_error_msg_extra' is a GLOBAL variable | ||
set @@session.read_only_error_msg_extra='This is a custom message'; | ||
ERROR HY000: Variable 'read_only_error_msg_extra' is a GLOBAL variable and should be set with SET GLOBAL | ||
set global read_only_error_msg_extra = @saved_read_only_error_msg_extra; | ||
set global super_read_only = false; | ||
set global read_only = false; |
25 changes: 25 additions & 0 deletions
25
mysql-test/suite/sys_vars/t/read_only_error_msg_extra_basic.test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
set @@global.read_only_error_msg_extra='Custom message before read_only'; | ||
select @@global.read_only_error_msg_extra; | ||
|
||
set global read_only = true; | ||
set @@global.read_only_error_msg_extra = default; | ||
select @@global.read_only_error_msg_extra; | ||
set @saved_read_only_error_msg_extra = @@global.read_only_error_msg_extra; | ||
|
||
set @@global.read_only_error_msg_extra='This is a custom message'; | ||
|
||
set global super_read_only = true; | ||
set @@global.read_only_error_msg_extra='This is another custom message'; | ||
|
||
--error ER_WRONG_TYPE_FOR_VAR | ||
set @@global.read_only_error_msg_extra=1; | ||
|
||
--error ER_INCORRECT_GLOBAL_LOCAL_VAR | ||
select @@session.read_only_error_msg_extra; | ||
--error ER_GLOBAL_VARIABLE | ||
set @@session.read_only_error_msg_extra='This is a custom message'; | ||
|
||
set global read_only_error_msg_extra = @saved_read_only_error_msg_extra; | ||
|
||
set global super_read_only = false; | ||
set global read_only = false; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The original code added a new ER_OPTION_PREVENTS_STATEMENT_EXTRA_INFO code. It would be better to keep to the original code instead. The value of the error code returned would match the existing 5.6 version. The return codes would be different between servers that have a master vs. those that do not, without having to parse the return string to determine if host:port were appended to it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change matches existing 5.6 version:
ER_OPTION_PREVENTS_STATEMENT_EXTRA_INFO
was removed with 9f18725 in favor ofER_OPTION_PREVENTS_STATEMENT
with additional string param.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I only changed output to match upstream when additional parameter is an empty string e.g.
instead of
in 5.6 with additional
.
at the end.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, thanks. I missed checking the last diff that reverted this behavior.