~drizzle-trunk/drizzle/development

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
Log file does not exist
select * from data_dictionary.plugins join data_dictionary.modules on plugins.plugin_name=modules.module_name where plugin_name='query_log';
PLUGIN_NAME	query_log
PLUGIN_TYPE	EventObserver
IS_ACTIVE	YES
MODULE_NAME	query_log
MODULE_NAME	query_log
MODULE_VERSION	1.0
MODULE_AUTHOR	Daniel Nichter
IS_BUILTIN	NO
MODULE_LIBRARY	query_log
MODULE_DESCRIPTION	Query Log
MODULE_LICENSE	GPL
SELECT @@query_log_enabled, @@query_log_file_enabled;
@@query_log_enabled	@@query_log_file_enabled
1	0
SELECT 1;
1
1
SET GLOBAL query_log_file_enabled=TRUE;
SELECT @@query_log_enabled, @@query_log_file_enabled;
@@query_log_enabled	@@query_log_file_enabled
1	1
# start_ts=0-00-00T00:00:00.000000
# session_id=0 query_id=0 rows_examined=0 rows_sent=0 tmp_tables=0 warnings=0
# execution_time=0.000000 lock_time=0.000000 session_time=0.000000
# error=false
# schema="test"
SET GLOBAL query_log_file_enabled=TRUE;
#
# start_ts=0-00-00T00:00:00.000000
# session_id=0 query_id=0 rows_examined=0 rows_sent=0 tmp_tables=0 warnings=0
# execution_time=0.000000 lock_time=0.000000 session_time=0.000000
# error=false
# schema="test"
SELECT @@query_log_enabled, @@query_log_file_enabled;
#
SET GLOBAL query_log_enabled=FALSE;
SELECT @@query_log_enabled, @@query_log_file_enabled;
@@query_log_enabled	@@query_log_file_enabled
0	1
SELECT 2;
2
2
# start_ts=0-00-00T00:00:00.000000
# session_id=0 query_id=0 rows_examined=0 rows_sent=0 tmp_tables=0 warnings=0
# execution_time=0.000000 lock_time=0.000000 session_time=0.000000
# error=false
# schema="test"
SET GLOBAL query_log_file_enabled=TRUE;
#
# start_ts=0-00-00T00:00:00.000000
# session_id=0 query_id=0 rows_examined=0 rows_sent=0 tmp_tables=0 warnings=0
# execution_time=0.000000 lock_time=0.000000 session_time=0.000000
# error=false
# schema="test"
SELECT @@query_log_enabled, @@query_log_file_enabled;
#
SET GLOBAL query_log_file_enabled=FALSE;
SELECT @@query_log_enabled, @@query_log_file_enabled;
@@query_log_enabled	@@query_log_file_enabled
0	0
SET GLOBAL query_log_file="DRIZZLETEST_VARDIR/query-2.log";
SELECT @@query_log_enabled, @@query_log_file_enabled, @@query_log_file;
@@query_log_enabled	@@query_log_file_enabled	@@query_log_file
0	0	DRIZZLETEST_VARDIR/query-2.log
Log file does not exist
SET GLOBAL query_log_enabled=TRUE;
SET GLOBAL query_log_file_enabled=TRUE;
SELECT 'this is the second log file';
this is the second log file
this is the second log file
Log file exists
# start_ts=0-00-00T00:00:00.000000
# session_id=0 query_id=0 rows_examined=0 rows_sent=0 tmp_tables=0 warnings=0
# execution_time=0.000000 lock_time=0.000000 session_time=0.000000
# error=false
# schema="test"
SET GLOBAL query_log_file_enabled=TRUE;
#
# start_ts=0-00-00T00:00:00.000000
# session_id=0 query_id=0 rows_examined=0 rows_sent=0 tmp_tables=0 warnings=0
# execution_time=0.000000 lock_time=0.000000 session_time=0.000000
# error=false
# schema="test"
SELECT 'this is the second log file';
#
SET GLOBAL query_log_file="DRIZZLETEST_VARDIR/query-3.log";
SELECT @@query_log_enabled, @@query_log_file_enabled, @@query_log_file;
@@query_log_enabled	@@query_log_file_enabled	@@query_log_file
1	1	DRIZZLETEST_VARDIR/query-3.log
Log file exists
SELECT 'this is the third log file';
this is the third log file
this is the third log file
# start_ts=0-00-00T00:00:00.000000
# session_id=0 query_id=0 rows_examined=0 rows_sent=0 tmp_tables=0 warnings=0
# execution_time=0.000000 lock_time=0.000000 session_time=0.000000
# error=false
# schema="third-log-file"
SET GLOBAL query_log_file="third-log-file";
#
# start_ts=0-00-00T00:00:00.000000
# session_id=0 query_id=0 rows_examined=0 rows_sent=0 tmp_tables=0 warnings=0
# execution_time=0.000000 lock_time=0.000000 session_time=0.000000
# error=false
# schema="third-log-file"
SELECT @@query_log_enabled, @@query_log_file_enabled, @@query_log_file;
#
# start_ts=0-00-00T00:00:00.000000
# session_id=0 query_id=0 rows_examined=0 rows_sent=0 tmp_tables=0 warnings=0
# execution_time=0.000000 lock_time=0.000000 session_time=0.000000
# error=false
# schema="third-log-file"
SELECT 'this is the third log file';
#
# start_ts=0-00-00T00:00:00.000000
# session_id=0 query_id=0 rows_examined=0 rows_sent=0 tmp_tables=0 warnings=0
# execution_time=0.000000 lock_time=0.000000 session_time=0.000000
# error=false
# schema="test"
SET GLOBAL query_log_file_enabled=TRUE;
#
# start_ts=0-00-00T00:00:00.000000
# session_id=0 query_id=0 rows_examined=0 rows_sent=0 tmp_tables=0 warnings=0
# execution_time=0.000000 lock_time=0.000000 session_time=0.000000
# error=false
# schema="test"
SELECT @@query_log_enabled, @@query_log_file_enabled;
#
# start_ts=0-00-00T00:00:00.000000
# session_id=0 query_id=0 rows_examined=0 rows_sent=0 tmp_tables=0 warnings=0
# execution_time=0.000000 lock_time=0.000000 session_time=0.000000
# error=false
# schema="test"
SET GLOBAL query_log_file_enabled=TRUE;
#
# start_ts=0-00-00T00:00:00.000000
# session_id=0 query_id=0 rows_examined=0 rows_sent=0 tmp_tables=0 warnings=0
# execution_time=0.000000 lock_time=0.000000 session_time=0.000000
# error=false
# schema="test"
SELECT 'this is the second log file';
#
SET GLOBAL query_log_file="DRIZZLETEST_VARDIR/query.log";
Checking attributes and values of query SELECT DATE(NOW());
start_ts value matches OK
Checking attributes and values of query SELECT DATE(NOW());
execution_time value matches OK
lock_time value matches OK
session_time value matches OK
Checking attributes and values of query SELECT DATE(NOW());
rows_examined value equals 0 OK
tmp_tables value equals 0 OK
warnings value equals 0 OK
error value equals false OK
schema value equals test OK
SELECT SLEEP(0.5);
SLEEP(0.5)
0
Checking attributes and values of query SELECT SLEEP(0.5);
execution_time value between 0.5 and 0.59 OK
SET GLOBAL query_log_enabled=TRUE;
SET GLOBAL query_log_file_enabled=FALSE;