1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
SET @@global.general_log= 0;
SET @start_global_value = @@global.server_id;
SELECT @start_global_value;
@start_global_value
1
'#--------------------FN_DYNVARS_144_01-------------------------#'
SET @@global.server_id = 500000;
SET @@global.server_id = DEFAULT;
SELECT @@global.server_id;
@@global.server_id
0
'#--------------------FN_DYNVARS_144_02-------------------------#'
SET @@global.server_id = DEFAULT;
SELECT @@global.server_id = 0;
@@global.server_id = 0
1
'#--------------------FN_DYNVARS_144_03-------------------------#'
SET @@global.server_id = 0;
SELECT @@global.server_id;
@@global.server_id
0
SET @@global.server_id = 1;
SELECT @@global.server_id;
@@global.server_id
1
SET @@global.server_id = 15;
SELECT @@global.server_id;
@@global.server_id
15
SET @@global.server_id = 1024;
SELECT @@global.server_id;
@@global.server_id
1024
SET @@global.server_id = 123456789;
SELECT @@global.server_id;
@@global.server_id
123456789
SET @@global.server_id = 2147483648;
SELECT @@global.server_id;
@@global.server_id
2147483648
SET @@global.server_id = 2147483648*2-1;
SELECT @@global.server_id;
@@global.server_id
4294967295
'#--------------------FN_DYNVARS_144_04-------------------------#'
SET @@server_id = 2;
ERROR HY000: Variable 'server_id' is a GLOBAL variable and should be set with SET GLOBAL
SET @@session.server_id = 3;
ERROR HY000: Variable 'server_id' is a GLOBAL variable and should be set with SET GLOBAL
SET @@local.server_id = 4;
ERROR HY000: Variable 'server_id' is a GLOBAL variable and should be set with SET GLOBAL
'#------------------FN_DYNVARS_144_05-----------------------#'
SET @@global.server_id = -1;
SELECT @@global.server_id;
@@global.server_id
0
SET @@global.server_id = -2147483648;
SELECT @@global.server_id;
@@global.server_id
0
SET @@global.server_id = 2147483649*2;
SELECT @@global.server_id;
@@global.server_id
4294967298
SET @@global.server_id = 65530.34.;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
SET @@global.server_id = '125';
ERROR 42000: Incorrect argument type to variable 'server_id'
SET @@global.server_id = 7483649.56;
ERROR 42000: Incorrect argument type to variable 'server_id'
SET @@global.server_id = 1G;
ERROR 42000: Incorrect argument type to variable 'server_id'
'Bug# 34877: Invalid Values are coming in variable on assigning valid values';
'#------------------FN_DYNVARS_144_06-----------------------#'
SET @@global.server_id = 3000;
SELECT @@global.server_id = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='server_id';
@@global.server_id = VARIABLE_VALUE
1
'#------------------FN_DYNVARS_144_07-----------------------#'
SELECT count(VARIABLE_VALUE)
FROM INFORMATION_SCHEMA.SESSION_VARIABLES
WHERE VARIABLE_NAME='server_id';
count(VARIABLE_VALUE)
1
'#------------------FN_DYNVARS_144_08-----------------------#'
SET @@global.server_id = TRUE;
SELECT @@global.server_id;
@@global.server_id
1
SET @@global.server_id = FALSE;
SELECT @@global.server_id;
@@global.server_id
0
'#---------------------FN_DYNVARS_001_09----------------------#'
SET @@global.server_id = 512;
SELECT @@server_id = @@global.server_id;
@@server_id = @@global.server_id
1
'#---------------------FN_DYNVARS_001_10----------------------#'
SET server_id = 2048;
ERROR HY000: Variable 'server_id' is a GLOBAL variable and should be set with SET GLOBAL
SELECT server_id;
ERROR 42S22: Unknown column 'server_id' in 'field list'
SELECT @@server_id;
@@server_id
512
SET global server_id = 99;
SET @@global.server_id = @start_global_value;
SELECT @@global.server_id;
@@global.server_id
1
SET @@global.general_log= 1;