| 1 |
################### mysql-test\t\general_log_file_basic.test ################### |
| 2 |
# # |
| 3 |
# Variable Name: general_log_file # |
| 4 |
# Scope: GLOBAL # |
| 5 |
# Access Type: Dynamic # |
| 6 |
# Data Type: Filename # |
| 7 |
# Default Value: host_name.log # |
| 8 |
# Valid Values: # |
| 9 |
# # |
| 10 |
# # |
| 11 |
# Creation Date: 2008-03-16 # |
| 12 |
# Author: Salman Rawala # |
| 13 |
# Modified: HHunger 2008-09-11 Set system variable back to the start value # |
| 14 |
# # |
| 15 |
# Description: Test Cases of Dynamic System Variable "general_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 general_log_file TESTS # |
| 31 |
########################################################### |
| 32 |
|
| 33 |
|
| 34 |
######################################################################## |
| 35 |
# Saving initial value of general_log_file in a temporary variable # |
| 36 |
######################################################################## |
| 37 |
|
| 38 |
SET @start_value = @@global.general_log_file; |
| 39 |
SELECT @start_value; |
| 40 |
|
| 41 |
|
| 42 |
--echo '#---------------------FN_DYNVARS_004_01-------------------------#' |
| 43 |
############################################### |
| 44 |
# Verify default value of variable # |
| 45 |
############################################### |
| 46 |
|
| 47 |
SET @@global.general_log_file = DEFAULT; |
| 48 |
SET @a=concat(left(@@hostname, instr(concat(@@hostname, '.'), '.')-1), '.log'); |
| 49 |
SELECT RIGHT(@@global.general_log_file, length(@a)) = @a; |
| 50 |
|
| 51 |
|
| 52 |
--echo '#--------------------FN_DYNVARS_004_02------------------------#' |
| 53 |
####################################################################### |
| 54 |
# Change the value of general_log_file to a invalid value # |
| 55 |
####################################################################### |
| 56 |
|
| 57 |
--error ER_WRONG_TYPE_FOR_VAR |
| 58 |
SET @@global.general_log_file = mytest.log; |
| 59 |
--error ER_WRONG_TYPE_FOR_VAR |
| 60 |
SET @@global.general_log_file = 12; |
| 61 |
|
| 62 |
|
| 63 |
--echo '#----------------------FN_DYNVARS_004_03------------------------#' |
| 64 |
############################################################################## |
| 65 |
# Check if the value in GLOBAL Tables matches values in variable # |
| 66 |
############################################################################## |
| 67 |
|
| 68 |
--disable_warnings |
| 69 |
SELECT @@global.general_log_file = VARIABLE_VALUE |
| 70 |
FROM performance_schema.global_variables |
| 71 |
WHERE VARIABLE_NAME='general_log_file'; |
| 72 |
--enable_warnings |
| 73 |
|
| 74 |
SET @@global.general_log_file= @start_value; |
| 75 |
|
| 76 |
##################################################### |
| 77 |
# END OF general_log_file TESTS # |
| 78 |
##################################################### |
| 79 |
|