3
################## mysql-test\t\warning_count_basic.test ######################
5
# Variable Name: warning_count #
7
# Access Type: Static #
11
# Creation Date: 2008-02-07 #
12
# Author : Sharique Abdullah #
15
# Description:Test Cases of Dynamic System Variable warning_count #
16
# that checks the behavior of this variable in the following ways #
20
# Reference: http://dev.mysql.com/doc/refman/5.1/en/ #
21
# server-system-variables.html #
23
###############################################################################
25
--echo '#---------------------BS_STVARS_057_01----------------------#'
26
####################################################################
27
# Displaying default value #
28
####################################################################
30
SELECT COUNT(@@SESSION.warning_count);
33
--echo '#---------------------BS_STVARS_057_02----------------------#'
34
####################################################################
35
# Check if Value can set #
36
####################################################################
39
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
40
SET @@SESSION.warning_count=1;
41
--echo Expected error 'Read only variable'
43
SELECT COUNT(@@SESSION.warning_count);
49
--echo '#---------------------BS_STVARS_057_03----------------------#'
50
#################################################################
51
# Check if the value in SESSION Table matches value in variable #
52
#################################################################
54
SELECT @@SESSION.warning_count = VARIABLE_VALUE
55
FROM INFORMATION_SCHEMA.SESSION_VARIABLES
56
WHERE VARIABLE_NAME='warning_count';
59
SELECT COUNT(@@SESSION.warning_count);
62
SELECT COUNT(VARIABLE_VALUE)
63
FROM INFORMATION_SCHEMA.SESSION_VARIABLES
64
WHERE VARIABLE_NAME='warning_count';
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;
77
--echo '#---------------------BS_STVARS_057_05----------------------#'
78
################################################################################
79
# Check if warning_count can be accessed with and without @@ sign #
80
################################################################################
82
SELECT COUNT(@@warning_count);
84
SELECT COUNT(@@local.warning_count);
86
SELECT COUNT(@@SESSION.warning_count);
89
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
90
SELECT COUNT(@@GLOBAL.warning_count);
91
--echo Expected error 'Variable is a SESSION variable'
93
--error ER_BAD_FIELD_ERROR
94
SELECT COUNT(warning_count = @@GLOBAL.warning_count);
95
--echo Expected error 'Readonly variable'