3
################## mysql-test\t\innodb_checksums_basic.test ###################
5
# Variable Name: innodb_checksums #
7
# Access Type: Static #
11
# Creation Date: 2008-02-07 #
12
# Author : Sharique Abdullah #
15
# Description:Test Cases of Dynamic System Variable innodb_checksums #
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
--source include/have_innodb.inc
27
--echo '#---------------------BS_STVARS_023_01----------------------#'
28
####################################################################
29
# Displaying default value #
30
####################################################################
31
SELECT COUNT(@@GLOBAL.innodb_checksums);
35
--echo '#---------------------BS_STVARS_023_02----------------------#'
36
####################################################################
37
# Check if Value can set #
38
####################################################################
40
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
41
SET @@GLOBAL.innodb_checksums=1;
42
--echo Expected error 'Read only variable'
44
SELECT COUNT(@@GLOBAL.innodb_checksums);
50
--echo '#---------------------BS_STVARS_023_03----------------------#'
51
#################################################################
52
# Check if the value in GLOBAL Table matches value in variable #
53
#################################################################
55
SELECT @@GLOBAL.innodb_checksums = VARIABLE_VALUE
56
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
57
WHERE VARIABLE_NAME='innodb_checksums';
60
SELECT COUNT(@@GLOBAL.innodb_checksums);
63
SELECT COUNT(VARIABLE_VALUE)
64
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
65
WHERE VARIABLE_NAME='innodb_checksums';
70
--echo '#---------------------BS_STVARS_023_04----------------------#'
71
################################################################################
72
# Check if accessing variable with and without GLOBAL point to same variable #
73
################################################################################
74
SELECT @@innodb_checksums = @@GLOBAL.innodb_checksums;
79
--echo '#---------------------BS_STVARS_023_05----------------------#'
80
################################################################################
81
# Check if innodb_checksums can be accessed with and without @@ sign #
82
################################################################################
84
SELECT COUNT(@@innodb_checksums);
87
--Error ER_INCORRECT_GLOBAL_LOCAL_VAR
88
SELECT COUNT(@@local.innodb_checksums);
89
--echo Expected error 'Variable is a GLOBAL variable'
91
--Error ER_INCORRECT_GLOBAL_LOCAL_VAR
92
SELECT COUNT(@@SESSION.innodb_checksums);
93
--echo Expected error 'Variable is a GLOBAL variable'
95
SELECT COUNT(@@GLOBAL.innodb_checksums);
98
--Error ER_BAD_FIELD_ERROR
99
SELECT innodb_checksums = @@SESSION.innodb_checksums;
100
--echo Expected error 'Readonly variable'