mariadb/mysql-test/t/query_cache_wlock_invalidate_basic.test
unknown b00c536378 System variable tests delivered by Folio3 (see WL4288).
BitKeeper/etc/ignore:
  Added mysql-test/linux_sys_vars.inc mysql-test/load_sysvars.inc mysql-test/windows_sys_vars.inc to the ignore list
2008-04-10 15:14:28 +02:00

231 lines
10 KiB
Text
Raw Blame History

########### mysql-test\t\query_cache_wlock_invalidate_basic.test ##############
# #
# Variable Name: query_cache_wlock_invalidate #
# Scope: GLOBAL | SESSION #
# Access Type: Dynamic #
# Data Type: boolean #
# Default Value: FALSE #
# Range: TRUE, FALSE #
# #
# #
# Creation Date: 2008-02-07 #
# Author: Rizwan #
# #
# Description: Test Cases of Dynamic System Variable #
# query_cache_wlock_invalidate that checks the behavior of this #
# variable in the following ways #
# * Default Value #
# * Valid & Invalid values #
# * Scope & Access method #
# * Data Integrity #
# #
# Reference: http://dev.mysql.com/doc/refman/5.1/en/ #
# server-system-variables.html #
# #
###############################################################################
--source include/load_sysvars.inc
########################################################################
# START OF query_cache_wlock_invalidate TESTS #
########################################################################
###############################################################################
# Saving initial value of query_cache_wlock_invalidate in a temporary variable#
###############################################################################
SET @session_start_value = @@session.query_cache_wlock_invalidate;
SELECT @session_start_value;
SET @global_start_value = @@global.query_cache_wlock_invalidate;
SELECT @global_start_value;
--echo '#--------------------FN_DYNVARS_135_01------------------------#'
########################################################################
# Display the DEFAULT value of query_cache_wlock_invalidate #
########################################################################
SET @@session.query_cache_wlock_invalidate = 1;
SET @@session.query_cache_wlock_invalidate = DEFAULT;
SELECT @@session.query_cache_wlock_invalidate;
SET @@global.query_cache_wlock_invalidate = 1;
SET @@global.query_cache_wlock_invalidate = DEFAULT;
SELECT @@global.query_cache_wlock_invalidate;
--echo '#---------------------FN_DYNVARS_135_02-------------------------#'
###########################################################################
# Check if query_cache_wlock_invalidate can be accessed with and without
# @@ sign
###########################################################################
SET query_cache_wlock_invalidate = 1;
SELECT @@query_cache_wlock_invalidate;
--Error ER_UNKNOWN_TABLE
SELECT session.query_cache_wlock_invalidate;
--Error ER_UNKNOWN_TABLE
SELECT local.query_cache_wlock_invalidate;
--Error ER_UNKNOWN_TABLE
SELECT global.query_cache_wlock_invalidate;
#using another syntax for accessing system variables
SET session query_cache_wlock_invalidate = 0;
SELECT @@session.query_cache_wlock_invalidate;
SET global query_cache_wlock_invalidate = 0;
SELECT @@global.query_cache_wlock_invalidate;
--echo '#--------------------FN_DYNVARS_135_03------------------------#'
##########################################################################
# change the value of query_cache_wlock_invalidate to a valid value #
##########################################################################
# for session
SET @@session.query_cache_wlock_invalidate = 0;
SELECT @@session.query_cache_wlock_invalidate;
SET @@session.query_cache_wlock_invalidate = 1;
SELECT @@session.query_cache_wlock_invalidate;
# for global
SET @@global.query_cache_wlock_invalidate = 0;
SELECT @@global.query_cache_wlock_invalidate;
SET @@global.query_cache_wlock_invalidate = 1;
SELECT @@global.query_cache_wlock_invalidate;
--echo '#--------------------FN_DYNVARS_135_04-------------------------#'
###########################################################################
# Change the value of query_cache_wlock_invalidate to invalid value #
###########################################################################
# for session
--Error ER_WRONG_VALUE_FOR_VAR
SET @@session.query_cache_wlock_invalidate = -1;
--Error ER_WRONG_VALUE_FOR_VAR
SET @@session.query_cache_wlock_invalidate = 1.6;
--Error ER_WRONG_VALUE_FOR_VAR
SET @@session.query_cache_wlock_invalidate = "T";
--Error ER_WRONG_VALUE_FOR_VAR
SET @@session.query_cache_wlock_invalidate = "Y";
--Error ER_WRONG_VALUE_FOR_VAR
SET @@session.query_cache_wlock_invalidate = TR<54>E;
--Error ER_WRONG_VALUE_FOR_VAR
SET @@session.query_cache_wlock_invalidate = <20>N;
SET @@session.query_cache_wlock_invalidate = OF;
SELECT @@session.query_cache_wlock_invalidate;
--echo 'Bug# 34828: OF is taken as OFF and a value of 0 is set.'
--Error ER_WRONG_VALUE_FOR_VAR
SET @@session.query_cache_wlock_invalidate = <20>FF;
# for global
--Error ER_WRONG_VALUE_FOR_VAR
SET @@global.query_cache_wlock_invalidate = -1;
--Error ER_WRONG_VALUE_FOR_VAR
SET @@global.query_cache_wlock_invalidate = 2;
--Error ER_WRONG_VALUE_FOR_VAR
SET @@global.query_cache_wlock_invalidate = "T";
--Error ER_WRONG_VALUE_FOR_VAR
SET @@global.query_cache_wlock_invalidate = "Y";
--Error ER_WRONG_VALUE_FOR_VAR
SET @@global.query_cache_wlock_invalidate = TR<54>E;
--Error ER_WRONG_VALUE_FOR_VAR
SET @@global.query_cache_wlock_invalidate = <20>N;
SET @@global.query_cache_wlock_invalidate = OF;
SELECT @@global.query_cache_wlock_invalidate;
--echo 'Bug 34828: OF is taken as OFF and a value of 0 is set.'
--Error ER_WRONG_VALUE_FOR_VAR
SET @@global.query_cache_wlock_invalidate = <20>FF;
--echo '#-------------------FN_DYNVARS_135_05----------------------------#'
###########################################################################
# Test if changing global variable effects session and vice versa #
###########################################################################
SET @@global.query_cache_wlock_invalidate = 0;
SET @@session.query_cache_wlock_invalidate = 1;
SELECT @@global.query_cache_wlock_invalidate AS res_is_0;
SET @@global.query_cache_wlock_invalidate = 0;
SELECT @@session.query_cache_wlock_invalidate AS res_is_1;
--echo '#----------------------FN_DYNVARS_135_06------------------------#'
#########################################################################
# Check if the value in GLOBAL Table matches value in variable #
#########################################################################
SELECT @@global.query_cache_wlock_invalidate = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='query_cache_wlock_invalidate';
SELECT @@global.query_cache_wlock_invalidate;
SELECT VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='query_cache_wlock_invalidate';
--echo '#----------------------FN_DYNVARS_135_07------------------------#'
#########################################################################
# Check if the value in SESSION Table matches value in variable #
#########################################################################
SELECT @@session.query_cache_wlock_invalidate = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.SESSION_VARIABLES
WHERE VARIABLE_NAME='query_cache_wlock_invalidate';
SELECT @@session.query_cache_wlock_invalidate;
SELECT VARIABLE_VALUE
FROM INFORMATION_SCHEMA.SESSION_VARIABLES
WHERE VARIABLE_NAME='query_cache_wlock_invalidate';
--echo '#---------------------FN_DYNVARS_135_08-------------------------#'
###################################################################
# Check if ON and OFF values can be used on variable #
###################################################################
SET @@session.query_cache_wlock_invalidate = OFF;
SELECT @@session.query_cache_wlock_invalidate;
SET @@session.query_cache_wlock_invalidate = ON;
SELECT @@session.query_cache_wlock_invalidate;
SET @@global.query_cache_wlock_invalidate = OFF;
SELECT @@global.query_cache_wlock_invalidate;
SET @@global.query_cache_wlock_invalidate = ON;
SELECT @@global.query_cache_wlock_invalidate;
--echo '#---------------------FN_DYNVARS_135_09----------------------#'
###################################################################
# Check if TRUE and FALSE values can be used on variable #
###################################################################
SET @@session.query_cache_wlock_invalidate = TRUE;
SELECT @@session.query_cache_wlock_invalidate;
SET @@session.query_cache_wlock_invalidate = FALSE;
SELECT @@session.query_cache_wlock_invalidate;
SET @@global.query_cache_wlock_invalidate = TRUE;
SELECT @@global.query_cache_wlock_invalidate;
SET @@global.query_cache_wlock_invalidate = FALSE;
SELECT @@global.query_cache_wlock_invalidate;
##############################
# Restore initial value #
##############################
SET @@session.query_cache_wlock_invalidate = @session_start_value;
SELECT @@session.query_cache_wlock_invalidate;
SET @@global.query_cache_wlock_invalidate = @global_start_value;
SELECT @@global.query_cache_wlock_invalidate;
###############################################################
# END OF query_cache_wlock_invalidate TESTS #
###############################################################