| 1 |
|
| 2 |
# the variable is controlled in different ways depending on whether |
| 3 |
# gtid_mode=on or off. the behavior when gtid_mode=on is tested in |
| 4 |
# rpl_gtid_execution.test |
| 5 |
|
| 6 |
|
| 7 |
SET @start_global_value = @@global.gtid_owned; |
| 8 |
SELECT @start_global_value; |
| 9 |
|
| 10 |
# |
| 11 |
# exists as global and session. |
| 12 |
# |
| 13 |
select @@global.gtid_owned; |
| 14 |
select @@session.gtid_owned; |
| 15 |
show global variables like 'gtid_owned'; |
| 16 |
show session variables like 'gtid_owned'; |
| 17 |
--disable_warnings |
| 18 |
select * from performance_schema.global_variables where variable_name='gtid_owned'; |
| 19 |
select * from performance_schema.session_variables where variable_name='gtid_owned'; |
| 20 |
--enable_warnings |
| 21 |
|
| 22 |
# |
| 23 |
# It is not writable. |
| 24 |
# |
| 25 |
--error ER_INCORRECT_GLOBAL_LOCAL_VAR |
| 26 |
set @@global.gtid_owned = 1; |
| 27 |
--error ER_INCORRECT_GLOBAL_LOCAL_VAR |
| 28 |
set @@session.gtid_owned = 1; |
| 29 |
|
| 30 |
# |
| 31 |
# With GTID_MODE = OFF, gtid_owned stays empty when setting gtid_next |
| 32 |
# to anonymous or automatic. |
| 33 |
# |
| 34 |
|
| 35 |
set @@session.gtid_next = 'anonymous'; |
| 36 |
select @@session.gtid_owned; |
| 37 |
select @@global.gtid_owned; |
| 38 |
ROLLBACK; |
| 39 |
|
| 40 |
set @@session.gtid_next = 'automatic'; |
| 41 |
select @@session.gtid_owned; |
| 42 |
select @@global.gtid_owned; |
| 43 |
|
| 44 |
# |
| 45 |
# See rpl_gtid_execution.test for a comprehensive test case with gtid_mode=on. |
| 46 |
# |