1
################### mysql-test\t\slow_query_log_file_basic.test ################
3
# Variable Name: slow_query_log_file #
5
# Access Type: Dynamic #
6
# Data Type: Filename #
7
# Default Value: host_name-slow.log #
11
# Creation Date: 2008-03-16 #
12
# Author: Salman Rawala #
13
# Modified: HHunger 2008-09-11 set system var back to start value #
15
# Description: Test Cases of Dynamic System Variable "slow_query_log_file" #
16
# that checks behavior of this variable in the following ways #
18
# * Valid & Invalid values #
19
# * Scope & Access method #
23
# http://dev.mysql.com/doc/refman/5.1/en/server-system-variables.html
25
################################################################################
27
--source include/load_sysvars.inc
29
###########################################################
30
# START OF slow_query_log_file TESTS #
31
###########################################################
34
###########################################################################
35
# Saving initial value of slow_query_log_file in a temporary variable #
36
###########################################################################
38
SET @start_value = @@global.slow_query_log_file;
40
--echo '#---------------------FN_DYNVARS_004_01-------------------------#'
41
###############################################
42
# Verify default value of variable #
43
###############################################
45
SET @@global.slow_query_log_file = DEFAULT;
46
SET @a=concat(left(@@hostname, instr(concat(@@hostname, '.'), '.')-1), '-slow.log');
47
SELECT RIGHT(@@global.slow_query_log_file, length(@a)) = @a;
50
--echo '#--------------------FN_DYNVARS_004_02------------------------#'
51
#######################################################################
52
# Change the value of slow_query_log_file to a invalid value #
53
#######################################################################
55
# Assumed text if no quotes or numbers.
56
SET @@global.slow_query_log_file = mytest.log;
57
--error ER_WRONG_TYPE_FOR_VAR
58
SET @@global.slow_query_log_file = 12;
60
--echo '#----------------------FN_DYNVARS_004_03------------------------#'
61
##############################################################################
62
# Check if the value in GLOBAL Tables matches values in variable #
63
##############################################################################
65
SELECT @@global.slow_query_log_file = VARIABLE_VALUE
66
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
67
WHERE VARIABLE_NAME='slow_query_log_file';
69
SET @@global.slow_query_log_file= @start_value;
70
#####################################################
71
# END OF slow_query_log_file TESTS #
72
#####################################################