Debian Codegraph @

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

raw
1 # bool global
2
3 SET @start_global_value = @@global.userstat;
4 #
5 # exists as global only
6 #
7 select @@global.userstat = 0 or @@global.userstat = 1;
8 --error ER_INCORRECT_GLOBAL_LOCAL_VAR
9 select @@session.userstat;
10
11 SET @@global.userstat=0;
12 show global variables like 'userstat';
13 show session variables like 'userstat';
14 select * from information_schema.global_variables where variable_name='userstat';
15 select * from information_schema.session_variables where variable_name='userstat';
16
17 #
18 # show that it's writable
19 #
20 set global userstat=ON;
21 select @@global.userstat;
22 set global userstat=OFF;
23 select @@global.userstat;
24 set global userstat=1;
25 select @@global.userstat;
26 --error ER_GLOBAL_VARIABLE
27 set session userstat=1;
28
29 #
30 # incorrect types
31 #
32 --error ER_WRONG_TYPE_FOR_VAR
33 set global userstat=1.1;
34 --error ER_WRONG_TYPE_FOR_VAR
35 set global userstat=1e1;
36 --error ER_WRONG_VALUE_FOR_VAR
37 set global userstat="foo";
38
39 SET @@global.userstat = @start_global_value;