mirror of
https://github.com/MariaDB/server.git
synced 2025-05-28 13:01:41 +03:00
This allows one to run the test suite even if any of the following options are changed: - character-set-server - collation-server - join-cache-level - log-basename - max-allowed-packet - optimizer-switch - query-cache-size and query-cache-type - skip-name-resolve - table-definition-cache - table-open-cache - Some innodb options etc Changes: - Don't print out the value of system variables as one can't depend on them to being constants. - Don't set global variables to 'default' as the default may not be the same as the test was started with if there was an additional option file. Instead save original value and reset it at end of test. - Test that depends on the latin1 character set should include default_charset.inc or set the character set to latin1 - Test that depends on the original optimizer switch, should include default_optimizer_switch.inc - Test that depends on the value of a specific system variable should set it in the test (like optimizer_use_condition_selectivity) - Split subselect3.test into subselect3.test and subselect3.inc to make it easier to set and reset system variables. - Added .opt files for test that required specfic options that could be changed by external configuration files. - Fixed result files in rockdsb & tokudb that had not been updated for a while.
146 lines
6.9 KiB
Plaintext
146 lines
6.9 KiB
Plaintext
############## mysql-test\t\table_definition_cache_basic.test #################
|
|
# #
|
|
# Variable Name: table_definition_cache #
|
|
# Scope: GLOBAL #
|
|
# Access Type: Dynamic #
|
|
# Data Type: Numeric #
|
|
# Default Value: 400 #
|
|
# Range: 1 - 524288 #
|
|
# #
|
|
# #
|
|
# Creation Date: 2008-03-16 #
|
|
# Author: Salman Rawala #
|
|
# #
|
|
# Description: Test Cases of Dynamic System Variable "table_definition_cache" #
|
|
# that checks 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#option_mysqld_table_definition_cache #
|
|
# #
|
|
###############################################################################
|
|
|
|
--source include/load_sysvars.inc
|
|
|
|
###############################################################
|
|
# START OF table_definition_cache TESTS #
|
|
###############################################################
|
|
|
|
##############################################################################
|
|
# Saving initial value of table_definition_cache in a temporary variable #
|
|
##############################################################################
|
|
|
|
SET @start_value = @@global.table_definition_cache;
|
|
|
|
--echo '#--------------------FN_DYNVARS_019_01------------------------#'
|
|
#######################################################################
|
|
# Display the DEFAULT value of table_definition_cache #
|
|
#######################################################################
|
|
|
|
SET @@global.table_definition_cache = 100;
|
|
SET @@global.table_definition_cache = DEFAULT;
|
|
SELECT @@global.table_definition_cache > 0;
|
|
|
|
|
|
--echo '#--------------------FN_DYNVARS_019_03------------------------#'
|
|
##############################################################################
|
|
# Change the value of table_definition_cache to a valid value #
|
|
##############################################################################
|
|
|
|
SET @@global.table_definition_cache = 1;
|
|
SELECT @@global.table_definition_cache;
|
|
SET @@global.table_definition_cache = 2;
|
|
SELECT @@global.table_definition_cache;
|
|
SET @@global.table_definition_cache = 2097151;
|
|
SELECT @@global.table_definition_cache;
|
|
SET @@global.table_definition_cache = 2097152;
|
|
SELECT @@global.table_definition_cache;
|
|
|
|
|
|
--echo '#--------------------FN_DYNVARS_019_04-------------------------#'
|
|
#################################################################################
|
|
# Change the value of table_definition_cache to invalid value #
|
|
#################################################################################
|
|
|
|
SET @@global.table_definition_cache = 0;
|
|
SELECT @@global.table_definition_cache;
|
|
SET @@global.table_definition_cache = -1024;
|
|
SELECT @@global.table_definition_cache;
|
|
SET @@global.table_definition_cache = 2097153;
|
|
SELECT @@global.table_definition_cache;
|
|
SET @@global.table_definition_cache = 42949672950;
|
|
SELECT @@global.table_definition_cache;
|
|
|
|
--Error ER_WRONG_TYPE_FOR_VAR
|
|
SET @@global.table_definition_cache = 21221204.10;
|
|
--Error ER_WRONG_TYPE_FOR_VAR
|
|
SET @@global.table_definition_cache = ON;
|
|
|
|
|
|
--echo '#-------------------FN_DYNVARS_019_05----------------------------#'
|
|
#################################################################################
|
|
# Test if accessing session table_definition_cache gives error #
|
|
#################################################################################
|
|
|
|
--Error ER_GLOBAL_VARIABLE
|
|
SET @@session.table_definition_cache = 0;
|
|
--Error ER_INCORRECT_GLOBAL_LOCAL_VAR
|
|
SELECT @@session.table_definition_cache;
|
|
|
|
|
|
--echo '#----------------------FN_DYNVARS_019_06------------------------#'
|
|
####################################################################
|
|
# Check if the value in GLOBAL Tables matches values in variable #
|
|
####################################################################
|
|
|
|
SELECT @@global.table_definition_cache = VARIABLE_VALUE
|
|
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
|
|
WHERE VARIABLE_NAME='table_definition_cache';
|
|
|
|
|
|
--echo '#---------------------FN_DYNVARS_019_07----------------------#'
|
|
###################################################################
|
|
# Check if TRUE and FALSE values can be used on variable #
|
|
###################################################################
|
|
|
|
SET @@global.table_definition_cache = TRUE;
|
|
SELECT @@global.table_definition_cache;
|
|
SET @@global.table_definition_cache = FALSE;
|
|
SELECT @@global.table_definition_cache;
|
|
|
|
|
|
--echo '#---------------------FN_DYNVARS_019_08----------------------#'
|
|
###############################################################################
|
|
# Check if accessing variable without SCOPE points to same global variable #
|
|
###############################################################################
|
|
|
|
SET @@global.table_definition_cache = 5;
|
|
SELECT @@table_definition_cache = @@global.table_definition_cache;
|
|
|
|
--echo '#---------------------FN_DYNVARS_019_09----------------------#'
|
|
################################################################################
|
|
# Check if table_definition_cache can be accessed with and without @@ sign #
|
|
################################################################################
|
|
|
|
--Error ER_GLOBAL_VARIABLE
|
|
SET table_definition_cache = 1;
|
|
--Error ER_PARSE_ERROR
|
|
SET global.table_definition_cache = 1;
|
|
--Error ER_UNKNOWN_TABLE
|
|
SELECT global.table_definition_cache;
|
|
--Error ER_BAD_FIELD_ERROR
|
|
SELECT table_definition_cache = @@session.table_definition_cache;
|
|
|
|
##############################
|
|
# Restore initial value #
|
|
##############################
|
|
|
|
SET @@global.table_definition_cache = @start_value;
|
|
|
|
################################################################
|
|
# END OF table_definition_cache TESTS #
|
|
################################################################
|