3
################## mysql-test\t\error_count_basic.test ########################
5
# Variable Name: error_count #
7
# Access Type: Static #
11
# Creation Date: 2008-02-07 #
12
# Author : Sharique Abdullah #
15
# Description:Test Cases of Dynamic System Variable error_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_005_01----------------------#'
26
####################################################################
27
# Displaying default value #
28
####################################################################
30
SELECT COUNT(@@SESSION.error_count);
33
--echo '#---------------------BS_STVARS_005_02----------------------#'
34
####################################################################
35
# Check if Value can set #
36
####################################################################
39
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
40
SET @@SESSION.error_count=1;
41
--echo Expected error 'Read only variable'
43
SELECT COUNT(@@SESSION.error_count);
49
--echo '#---------------------BS_STVARS_005_03----------------------#'
50
#################################################################
51
# Check if the value in SESSION Table matches value in variable #
52
#################################################################
54
SELECT @@SESSION.error_count = VARIABLE_VALUE
55
FROM INFORMATION_SCHEMA.SESSION_VARIABLES
56
WHERE VARIABLE_NAME='error_count';
59
SELECT COUNT(@@SESSION.error_count);
62
SELECT COUNT(VARIABLE_VALUE)
63
FROM INFORMATION_SCHEMA.SESSION_VARIABLES
64
WHERE VARIABLE_NAME='error_count';
68
--echo '#---------------------BS_STVARS_005_04----------------------#'
69
################################################################################
70
# Check if accessing variable with and without SESSION point to same variable #
71
################################################################################
72
SELECT @@error_count = @@SESSION.error_count;
77
--echo '#---------------------BS_STVARS_005_05----------------------#'
78
################################################################################
79
# Check if error_count can be accessed with and without @@ sign #
80
################################################################################
82
SELECT COUNT(@@error_count);
84
SELECT COUNT(@@local.error_count);
86
SELECT COUNT(@@SESSION.error_count);
89
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
90
SELECT COUNT(@@GLOBAL.error_count);
91
--echo Expected error 'Variable is a SESSION variable'
93
--error ER_BAD_FIELD_ERROR
94
SELECT COUNT(error_count = @@GLOBAL.error_count);
95
--echo Expected error 'Readonly variable'