| 1 |
################### mysql-test\t\slow_query_log_file_basic.test ################ |
| 2 |
# # |
| 3 |
# Variable Name: slow_query_log_file # |
| 4 |
# Scope: GLOBAL # |
| 5 |
# Access Type: Dynamic # |
| 6 |
# Data Type: Filename # |
| 7 |
# Default Value: host_name-slow.log # |
| 8 |
# Valid Values: # |
| 9 |
# # |
| 10 |
# # |
| 11 |
# Creation Date: 2008-03-16 # |
| 12 |
# Author: Salman Rawala # |
| 13 |
# Modified: HHunger 2008-09-11 set system var back to start value # |
| 14 |
# # |
| 15 |
# Description: Test Cases of Dynamic System Variable "slow_query_log_file" # |
| 16 |
# that checks behavior of this variable in the following ways # |
| 17 |
# * Default Value # |
| 18 |
# * Valid & Invalid values # |
| 19 |
# * Scope & Access method # |
| 20 |
# * Data Integrity # |
| 21 |
# # |
| 22 |
# Reference: # |
| 23 |
# http://dev.mysql.com/doc/refman/5.1/en/server-system-variables.html |
| 24 |
# # |
| 25 |
################################################################################ |
| 26 |
|
| 27 |
--source include/load_sysvars.inc |
| 28 |
|
| 29 |
########################################################### |
| 30 |
# START OF slow_query_log_file TESTS # |
| 31 |
########################################################### |
| 32 |
|
| 33 |
|
| 34 |
########################################################################### |
| 35 |
# Saving initial value of slow_query_log_file in a temporary variable # |
| 36 |
########################################################################### |
| 37 |
|
| 38 |
SET @start_value = @@global.slow_query_log_file; |
| 39 |
|
| 40 |
--echo '#---------------------FN_DYNVARS_004_01-------------------------#' |
| 41 |
############################################### |
| 42 |
# Verify default value of variable # |
| 43 |
############################################### |
| 44 |
|
| 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; |
| 48 |
|
| 49 |
|
| 50 |
--echo '#--------------------FN_DYNVARS_004_02------------------------#' |
| 51 |
####################################################################### |
| 52 |
# Change the value of slow_query_log_file to a invalid value # |
| 53 |
####################################################################### |
| 54 |
|
| 55 |
--error ER_WRONG_TYPE_FOR_VAR |
| 56 |
SET @@global.slow_query_log_file = mytest.log; |
| 57 |
--error ER_WRONG_TYPE_FOR_VAR |
| 58 |
SET @@global.slow_query_log_file = 12; |
| 59 |
|
| 60 |
--echo '#----------------------FN_DYNVARS_004_03------------------------#' |
| 61 |
############################################################################## |
| 62 |
# Check if the value in GLOBAL Tables matches values in variable # |
| 63 |
############################################################################## |
| 64 |
|
| 65 |
--disable_warnings |
| 66 |
SELECT @@global.slow_query_log_file = VARIABLE_VALUE |
| 67 |
FROM performance_schema.global_variables |
| 68 |
WHERE VARIABLE_NAME='slow_query_log_file'; |
| 69 |
--enable_warnings |
| 70 |
|
| 71 |
SET @@global.slow_query_log_file= @start_value; |
| 72 |
##################################################### |
| 73 |
# END OF slow_query_log_file TESTS # |
| 74 |
##################################################### |
| 75 |
|