Debian Codegraph @

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

raw
1
2 #
3 # exists as a session only
4 #
5 # 2010-01-20 OBN - Added check for session I_S values being equal to variable value
6 # - Added check for session variable value being numberic
7 #
8
9 --error ER_INCORRECT_GLOBAL_LOCAL_VAR
10 select @@global.pseudo_thread_id;
11
12 # Check the variable has a valid numeric value (assumed to be less then 10000)
13 select @@session.pseudo_thread_id between 1 and 10000;
14
15 --echo should be empty
16 show global variables like 'pseudo_thread_id';
17
18 # Check that shows returns a value (can't confirm the actual one)
19 --replace_column 2 #
20 show session variables like 'pseudo_thread_id';
21
22 # Global I_S variable is empty
23 --echo should be empty
24 --disable_warnings
25 select * from performance_schema.global_variables where variable_name='pseudo_thread_id';
26 --enable_warnings
27
28 # Check that I_S value is same as variable
29 --disable_warnings
30 select @@session.pseudo_thread_id = variable_value from performance_schema.session_variables where variable_name='pseudo_thread_id';
31 --enable_warnings
32
33 #
34 # show that it's writable
35 #
36 set session pseudo_thread_id=42;
37 select @@session.pseudo_thread_id;
38 --disable_warnings
39 select * from performance_schema.global_variables where variable_name='pseudo_thread_id';
40 select variable_value from performance_schema.session_variables where variable_name='pseudo_thread_id';
41 --enable_warnings
42 --error ER_LOCAL_VARIABLE
43 set global pseudo_thread_id=1;
44
45 #
46 # incorrect types
47 #
48 --error ER_WRONG_TYPE_FOR_VAR
49 set session pseudo_thread_id=1.1;
50 --error ER_WRONG_TYPE_FOR_VAR
51 set session pseudo_thread_id=1e1;
52 --error ER_WRONG_TYPE_FOR_VAR
53 set session pseudo_thread_id="foo";
54