~jlukas79/+junk/mysql-server

« back to all changes in this revision

Viewing changes to mysql-test/t/general_log_func.test

manual merge 6.0-main --> 6.0-bka-review

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
################# mysql-test\t\general_log_func.test ###########################
 
2
#                                                                              #
 
3
# Variable Name: general_log                                                   #
 
4
# Scope: GLOBAL                                                                #
 
5
# Access Type: Dynamic                                                         #
 
6
# Data Type: Boolean                                                           #
 
7
# Default Value: OFF                                                           #
 
8
# Valid Values: ON, OFF                                                        #
 
9
#                                                                              #
 
10
#                                                                              #
 
11
# Creation Date: 2008-03-17                                                    #
 
12
# Author:  Salman Rawala                                                       #
 
13
#                                                                              #
 
14
# Description: Test Cases of Dynamic System Variable "general_log"             #
 
15
#              that checks functionality of this variable                      #
 
16
#                                                                              #
 
17
# Reference: http://dev.mysql.com/doc/refman/5.1/en/                           #
 
18
#    server-system-variables.html#option_mysqld_general_log                    #
 
19
#                                                                              #
 
20
################################################################################
 
21
 
 
22
 
 
23
--disable_warnings
 
24
drop table if exists t1;
 
25
--enable_warnings
 
26
 
 
27
#########################
 
28
#   Creating new table  #
 
29
#########################
 
30
 
 
31
--echo ## Creating new table ##
 
32
CREATE TABLE t1
 
33
(
 
34
id INT NOT NULL auto_increment,
 
35
PRIMARY KEY (id),
 
36
name VARCHAR(30)
 
37
);
 
38
 
 
39
--echo '#--------------------FN_DYNVARS_018_01-------------------------#'
 
40
####################################################################
 
41
#    Setting initial value of general_log to OFF and verifying
 
42
#    its behavior
 
43
####################################################################
 
44
 
 
45
--echo ## Setting initial value of variable to OFF ##
 
46
SET @@global.general_log = OFF;
 
47
SELECT @@general_log;
 
48
 
 
49
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
 
50
--copy_file $MYSQLTEST_VARDIR/log/master.log $MYSQLTEST_VARDIR/log/master-test.log
 
51
 
 
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');
 
55
 
 
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
 
59
 
 
60
 
 
61
--echo '#--------------------FN_DYNVARS_018_01-------------------------#'
 
62
####################################################################
 
63
#    Setting initial value of general_log to ON and verifying
 
64
#    its behavior
 
65
####################################################################
 
66
 
 
67
--echo ## Setting initial value of variable to OFF ##
 
68
SET @@global.general_log = ON;
 
69
SELECT @@general_log;
 
70
 
 
71
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
 
72
--copy_file $MYSQLTEST_VARDIR/log/master.log $MYSQLTEST_VARDIR/log/master-test-1.log
 
73
 
 
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');
 
77
 
 
78
 
 
79
--echo ## There should be no difference, case should pass ##
 
80
#--diff_files var/log/master.log var/log/master-test-1.log
 
81
 
 
82
--echo ## This case is failing which shows that mysql is writing in general ##
 
83
--echo ## log when we set general_log to ON ##
 
84
 
 
85
--echo ## Dropping tables ##
 
86
DROP TABLE t1;
 
87