Debian Codegraph @

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

raw
1
2
3 ################## mysql-test\t\warning_count_basic.test ######################
4 # #
5 # Variable Name: warning_count #
6 # Scope: Session #
7 # Access Type: Static #
8 # Data Type: numeric #
9 # #
10 # #
11 # Creation Date: 2008-02-07 #
12 # Author : Sharique Abdullah #
13 # #
14 # #
15 # Description:Test Cases of Dynamic System Variable warning_count #
16 # that checks the behavior of this variable in the following ways #
17 # * Value Check #
18 # * Scope Check #
19 # #
20 # Reference: http://dev.mysql.com/doc/refman/5.1/en/ #
21 # server-system-variables.html #
22 # #
23 ###############################################################################
24
25 --echo '#---------------------BS_STVARS_057_01----------------------#'
26 ####################################################################
27 # Displaying default value #
28 ####################################################################
29
30 SELECT COUNT(@@SESSION.warning_count);
31 --echo 1 Expected
32
33 --echo '#---------------------BS_STVARS_057_02----------------------#'
34 ####################################################################
35 # Check if Value can set #
36 ####################################################################
37
38
39 --error ER_INCORRECT_GLOBAL_LOCAL_VAR
40 SET @@SESSION.warning_count=1;
41 --echo Expected error 'Read only variable'
42
43 SELECT COUNT(@@SESSION.warning_count);
44 --echo 1 Expected
45
46
47
48
49 --echo '#---------------------BS_STVARS_057_03----------------------#'
50 #################################################################
51 # Check if the value in SESSION Table matches value in variable #
52 #################################################################
53
54 SELECT @@SESSION.warning_count = VARIABLE_VALUE
55 FROM INFORMATION_SCHEMA.SESSION_VARIABLES
56 WHERE VARIABLE_NAME='warning_count';
57 --echo 1 Expected
58
59 SELECT COUNT(@@SESSION.warning_count);
60 --echo 1 Expected
61
62 SELECT COUNT(VARIABLE_VALUE)
63 FROM INFORMATION_SCHEMA.SESSION_VARIABLES
64 WHERE VARIABLE_NAME='warning_count';
65 --echo 1 Expected
66
67
68 --echo '#---------------------BS_STVARS_057_04----------------------#'
69 ################################################################################
70 # Check if accessing variable with and without SESSION point to same variable #
71 ################################################################################
72 SELECT @@warning_count = @@SESSION.warning_count;
73 --echo 1 Expected
74
75
76
77 --echo '#---------------------BS_STVARS_057_05----------------------#'
78 ################################################################################
79 # Check if warning_count can be accessed with and without @@ sign #
80 ################################################################################
81
82 SELECT COUNT(@@warning_count);
83 --echo 1 Expected
84 SELECT COUNT(@@local.warning_count);
85 --echo 1 Expected
86 SELECT COUNT(@@SESSION.warning_count);
87 --echo 1 Expected
88
89 --error ER_INCORRECT_GLOBAL_LOCAL_VAR
90 SELECT COUNT(@@GLOBAL.warning_count);
91 --echo Expected error 'Variable is a SESSION variable'
92
93 --error ER_BAD_FIELD_ERROR
94 SELECT COUNT(warning_count = @@GLOBAL.warning_count);
95 --echo Expected error 'Readonly variable'
96
97