Debian Codegraph @

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

raw
1
2 #
3 # exists as a session only
4 #
5 # 2010-01-20 OBN - Added check for variable value matching I_S tables
6 #
7 --error ER_INCORRECT_GLOBAL_LOCAL_VAR
8 select @@global.last_insert_id;
9 select @@session.last_insert_id;
10 show global variables like 'last_insert_id';
11 show session variables like 'last_insert_id';
12 --disable_warnings
13 select * from performance_schema.global_variables where variable_name='last_insert_id';
14 select * from performance_schema.session_variables where variable_name='last_insert_id';
15 --enable_warnings
16
17 #
18 # show that it's writable
19 #
20 --error ER_LOCAL_VARIABLE
21 set global last_insert_id=99;
22 set session last_insert_id=42;
23 --error ER_INCORRECT_GLOBAL_LOCAL_VAR
24 select @@global.last_insert_id;
25 select @@session.last_insert_id;
26 show global variables like 'last_insert_id';
27 show session variables like 'last_insert_id';
28 --disable_warnings
29 select * from performance_schema.global_variables where variable_name='last_insert_id';
30 select * from performance_schema.session_variables where variable_name='last_insert_id';
31 --enable_warnings
32
33 #
34 # incorrect types
35 #
36 --error ER_WRONG_TYPE_FOR_VAR
37 set session last_insert_id=1.1;
38 --error ER_WRONG_TYPE_FOR_VAR
39 set session last_insert_id=1e1;
40 --error ER_WRONG_TYPE_FOR_VAR
41 set session last_insert_id="foo";
42