Debian Codegraph @

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

raw
1
2
3 ################## mysql-test\t\bind_address_basic.test ############################
4 # #
5 # Variable Name: bind_address #
6 # Scope: Global #
7 # Access Type: Static #
8 # Data Type: filename #
9 ###############################################################################
10
11 --source include/not_embedded.inc
12
13 --echo '#---------------------BS_STVARS_001_01----------------------#'
14 ####################################################################
15 # Displaying default value #
16 ####################################################################
17 SELECT COUNT(@@GLOBAL.bind_address);
18 --echo 1 Expected
19
20
21 --echo '#---------------------BS_STVARS_001_02----------------------#'
22 ####################################################################
23 # Check if Value can set #
24 ####################################################################
25
26 --error ER_INCORRECT_GLOBAL_LOCAL_VAR
27 SET @@GLOBAL.bind_address=1;
28 --echo Expected error 'Read only variable'
29
30 SELECT COUNT(@@GLOBAL.bind_address);
31 --echo 1 Expected
32
33
34
35
36 --echo '#---------------------BS_STVARS_001_03----------------------#'
37 #################################################################
38 # Check if the value in GLOBAL Table matches value in variable #
39 #################################################################
40
41 --disable_warnings
42 SELECT VARIABLE_VALUE = ''
43 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
44 WHERE VARIABLE_NAME='bind_address';
45 --enable_warnings
46 --echo 0 Expected
47
48 SELECT COUNT(@@GLOBAL.bind_address);
49 --echo 1 Expected
50
51 --disable_warnings
52 SELECT COUNT(VARIABLE_VALUE)
53 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
54 WHERE VARIABLE_NAME='bind_address';
55 --enable_warnings
56 --echo 1 Expected
57
58
59
60 --echo '#---------------------BS_STVARS_001_04----------------------#'
61 ################################################################################
62 # Check if accessing variable with and without GLOBAL point to same variable #
63 ################################################################################
64 SELECT @@bind_address is NULL AND @@GLOBAL.bind_address is NULL;
65 --echo 0 Expected
66
67 SELECT @@bind_address is NOT NULL AND @@GLOBAL.bind_address is NOT NULL;
68 --echo 1 Expected
69
70
71
72 --echo '#---------------------BS_STVARS_001_05----------------------#'
73 ################################################################################
74 # Check if bind_address can be accessed with and without @@ sign #
75 ################################################################################
76
77 SELECT COUNT(@@bind_address);
78 --echo 1 Expected
79
80 --Error ER_INCORRECT_GLOBAL_LOCAL_VAR
81 SELECT COUNT(@@local.bind_address);
82 --echo Expected error 'Variable is a GLOBAL variable'
83
84 --Error ER_INCORRECT_GLOBAL_LOCAL_VAR
85 SELECT COUNT(@@SESSION.bind_address);
86 --echo Expected error 'Variable is a GLOBAL variable'
87
88 SELECT COUNT(@@GLOBAL.bind_address);
89 --echo 1 Expected
90
91 --Error ER_BAD_FIELD_ERROR
92 SELECT bind_address = @@SESSION.bind_address;
93 --echo Expected error 'Readonly variable'
94
95