| 1 |
|
| 2 |
|
| 3 |
################## mysql-test\t\error_count_basic.test ######################## |
| 4 |
# # |
| 5 |
# Variable Name: error_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 error_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 |
# diagnostics can't be prepared |
| 26 |
--disable_ps_protocol |
| 27 |
|
| 28 |
--echo '#---------------------BS_STVARS_005_01----------------------#' |
| 29 |
#################################################################### |
| 30 |
# Displaying default value # |
| 31 |
#################################################################### |
| 32 |
|
| 33 |
SELECT COUNT(@@SESSION.error_count); |
| 34 |
--echo 1 Expected |
| 35 |
|
| 36 |
--echo '#---------------------BS_STVARS_005_02----------------------#' |
| 37 |
#################################################################### |
| 38 |
# Check if Value can set # |
| 39 |
#################################################################### |
| 40 |
|
| 41 |
|
| 42 |
--error ER_INCORRECT_GLOBAL_LOCAL_VAR |
| 43 |
SET @@SESSION.error_count=1; |
| 44 |
--echo Expected error 'Read only variable' |
| 45 |
|
| 46 |
SELECT COUNT(@@SESSION.error_count); |
| 47 |
--echo 1 Expected |
| 48 |
|
| 49 |
|
| 50 |
|
| 51 |
|
| 52 |
--echo '#---------------------BS_STVARS_005_03----------------------#' |
| 53 |
################################################################# |
| 54 |
# Check if the value in SESSION Table matches value in variable # |
| 55 |
################################################################# |
| 56 |
|
| 57 |
--disable_warnings |
| 58 |
SELECT @@SESSION.error_count = VARIABLE_VALUE |
| 59 |
FROM performance_schema.session_variables |
| 60 |
WHERE VARIABLE_NAME='error_count'; |
| 61 |
--enable_warnings |
| 62 |
--echo 1 Expected |
| 63 |
|
| 64 |
SELECT COUNT(@@SESSION.error_count); |
| 65 |
--echo 1 Expected |
| 66 |
|
| 67 |
--disable_warnings |
| 68 |
SELECT COUNT(VARIABLE_VALUE) |
| 69 |
FROM performance_schema.session_variables |
| 70 |
WHERE VARIABLE_NAME='error_count'; |
| 71 |
--enable_warnings |
| 72 |
--echo 1 Expected |
| 73 |
|
| 74 |
|
| 75 |
--echo '#---------------------BS_STVARS_005_04----------------------#' |
| 76 |
################################################################################ |
| 77 |
# Check if accessing variable with and without SESSION point to same variable # |
| 78 |
################################################################################ |
| 79 |
SELECT @@error_count = @@SESSION.error_count; |
| 80 |
--echo 1 Expected |
| 81 |
|
| 82 |
|
| 83 |
|
| 84 |
--echo '#---------------------BS_STVARS_005_05----------------------#' |
| 85 |
################################################################################ |
| 86 |
# Check if error_count can be accessed with and without @@ sign # |
| 87 |
################################################################################ |
| 88 |
|
| 89 |
SELECT COUNT(@@error_count); |
| 90 |
--echo 1 Expected |
| 91 |
SELECT COUNT(@@local.error_count); |
| 92 |
--echo 1 Expected |
| 93 |
SELECT COUNT(@@SESSION.error_count); |
| 94 |
--echo 1 Expected |
| 95 |
|
| 96 |
--error ER_INCORRECT_GLOBAL_LOCAL_VAR |
| 97 |
SELECT COUNT(@@GLOBAL.error_count); |
| 98 |
--echo Expected error 'Variable is a SESSION variable' |
| 99 |
|
| 100 |
--error ER_BAD_FIELD_ERROR |
| 101 |
SELECT COUNT(error_count); |
| 102 |
--echo Expected error 'Unknown column' |
| 103 |
|
| 104 |
--enable_ps_protocol |