Debian Codegraph @

mysql-test/suite/sys_vars/t/server_uuid_basic.test

raw
1
2
3 ################## mysql-test\t\server_uuid_basic.test ########################
4 # #
5 # Variable Name: server_uuid #
6 # Scope: Global #
7 # Access Type: Static #
8 # Data Type: filename #
9 # #
10 # #
11 # Creation Date: 2010-06-22 #
12 # Author : Libing Song #
13 # #
14 # #
15 #
16 # Description:Test Cases of Static System Variable server_uuid #
17 # that checks the behavior of this variable in the following ways #
18 # * Value Check #
19 # * Scope Check #
20 # #
21 # Reference: http://dev.mysql.com/doc/refman/6.0/en/ #
22 # server-system-variables.html #
23 # #
24 ###############################################################################
25
26 --echo '#---------------------BS_STVARS_004_01----------------------#'
27 ####################################################################
28 # Displaying default value #
29 ####################################################################
30 SELECT COUNT(@@GLOBAL.server_uuid);
31 --echo 1 Expected
32
33
34 --echo '#---------------------BS_STVARS_004_02----------------------#'
35 ####################################################################
36 # Check if Value can set #
37 ####################################################################
38
39 --error ER_INCORRECT_GLOBAL_LOCAL_VAR
40 SET @@GLOBAL.server_uuid=1;
41 --echo Expected error 'Read only variable'
42
43 SELECT COUNT(@@GLOBAL.server_uuid);
44 --echo 1 Expected
45
46
47
48
49 --echo '#---------------------BS_STVARS_004_03----------------------#'
50 #################################################################
51 # Check if the value in GLOBAL Table matches value in variable #
52 #################################################################
53
54 --disable_warnings
55 SELECT @@GLOBAL.server_uuid = VARIABLE_VALUE
56 FROM performance_schema.global_variables
57 WHERE VARIABLE_NAME='server_uuid';
58 --enable_warnings
59 --echo 1 Expected
60
61 SELECT COUNT(@@GLOBAL.server_uuid);
62 --echo 1 Expected
63
64 --disable_warnings
65 SELECT COUNT(VARIABLE_VALUE)
66 FROM performance_schema.global_variables
67 WHERE VARIABLE_NAME='server_uuid';
68 --enable_warnings
69 --echo 1 Expected
70
71
72
73 --echo '#---------------------BS_STVARS_004_04----------------------#'
74 ################################################################################
75 # Check if accessing variable with and without GLOBAL point to same variable #
76 ################################################################################
77 SELECT @@server_uuid = @@GLOBAL.datadir;
78 --echo 1 Expected
79
80
81
82 --echo '#---------------------BS_STVARS_004_05----------------------#'
83 ################################################################################
84 # Check if server_uuid can be accessed with and without @@ sign #
85 ################################################################################
86
87 SELECT COUNT(@@server_uuid);
88 --echo 1 Expected
89
90 --Error ER_INCORRECT_GLOBAL_LOCAL_VAR
91 SELECT COUNT(@@local.server_uuid);
92 --echo Expected error 'Variable is a GLOBAL variable'
93
94 --Error ER_INCORRECT_GLOBAL_LOCAL_VAR
95 SELECT COUNT(@@SESSION.server_uuid);
96 --echo Expected error 'Variable is a GLOBAL variable'
97
98 SELECT COUNT(@@GLOBAL.server_uuid);
99 --echo 1 Expected