1
################# mysql-test\t\general_log_func.test ###########################
3
# Variable Name: general_log #
5
# Access Type: Dynamic #
8
# Valid Values: ON, OFF #
11
# Creation Date: 2008-03-17 #
12
# Author: Salman Rawala #
14
# Description: Test Cases of Dynamic System Variable "general_log" #
15
# that checks functionality of this variable #
17
# Reference: http://dev.mysql.com/doc/refman/5.1/en/ #
18
# server-system-variables.html#option_mysqld_general_log #
20
################################################################################
24
drop table if exists t1;
27
#########################
28
# Creating new table #
29
#########################
31
--echo ## Creating new table ##
34
id INT NOT NULL auto_increment,
39
--echo '#--------------------FN_DYNVARS_018_01-------------------------#'
40
####################################################################
41
# Setting initial value of general_log to OFF and verifying
43
####################################################################
45
--echo ## Setting initial value of variable to OFF ##
46
SET @@global.general_log = OFF;
49
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
50
--copy_file $MYSQLTEST_VARDIR/log/master.log $MYSQLTEST_VARDIR/log/master-test.log
52
--echo ## Inserting some Records & Verifying output in log ##
53
INSERT into t1(name) values('Record_1');
54
INSERT into t1(name) values('Record_2');
56
--echo ## There should be no difference, case should pass ##
57
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
58
--diff_files $MYSQLTEST_VARDIR/log/master.log $MYSQLTEST_VARDIR/log/master-test.log
61
--echo '#--------------------FN_DYNVARS_018_01-------------------------#'
62
####################################################################
63
# Setting initial value of general_log to ON and verifying
65
####################################################################
67
--echo ## Setting initial value of variable to OFF ##
68
SET @@global.general_log = ON;
71
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
72
--copy_file $MYSQLTEST_VARDIR/log/master.log $MYSQLTEST_VARDIR/log/master-test-1.log
74
--echo ## Inserting some Records & Verifying output in log ##
75
INSERT into t1(name) values('Record_3');
76
INSERT into t1(name) values('Record_4');
79
--echo ## There should be no difference, case should pass ##
80
#--diff_files var/log/master.log var/log/master-test-1.log
82
--echo ## This case is failing which shows that mysql is writing in general ##
83
--echo ## log when we set general_log to ON ##
85
--echo ## Dropping tables ##