forked from facebook/mysql-5.6
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Summary: This diff provides extensible support for specifying query/connection attributes used as client attributes. Adding a new query attribute name in the future would not require a server code change, it can be done by changing a system variable, client_attribute_names. Reviewed By: george-reynya Differential Revision: D28775765 fbshipit-source-id: 3a77335e3d3
- Loading branch information
Showing
15 changed files
with
231 additions
and
27 deletions.
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
35 changes: 35 additions & 0 deletions
35
mysql-test/suite/sys_vars/r/client_attribute_names_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,35 @@ | ||
Default value of client_attribute_names is caller,async_id | ||
SELECT @@global.client_attribute_names; | ||
@@global.client_attribute_names | ||
caller,async_id | ||
SELECT @@session.client_attribute_names; | ||
ERROR HY000: Variable 'client_attribute_names' is a GLOBAL variable | ||
Expected error 'Variable is a GLOBAL variable' | ||
client_attribute_names is a dynamic variable (change to a valid value) | ||
set @@global.client_attribute_names = 'caller,original_caller,async_id'; | ||
SELECT @@global.client_attribute_names; | ||
@@global.client_attribute_names | ||
caller,original_caller,async_id | ||
set @@global.client_attribute_names = 'caller,original_caller'; | ||
SELECT @@global.client_attribute_names; | ||
@@global.client_attribute_names | ||
caller,original_caller | ||
set @@global.client_attribute_names = 'original_caller,async_id'; | ||
SELECT @@global.client_attribute_names; | ||
@@global.client_attribute_names | ||
original_caller,async_id | ||
restore the default value | ||
SET @@global.client_attribute_names = 'caller,async_id'; | ||
SELECT @@global.client_attribute_names; | ||
@@global.client_attribute_names | ||
caller,async_id | ||
restart the server with non default value (caller,original_caller) | ||
# restart: --client_attribute_names=caller,original_caller | ||
SELECT @@global.client_attribute_names; | ||
@@global.client_attribute_names | ||
caller,original_caller | ||
restart the server with the default value (caller,async_id) | ||
# restart: | ||
SELECT @@global.client_attribute_names; | ||
@@global.client_attribute_names | ||
caller,async_id |
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
Oops, something went wrong.