Merge lp:~daniel-nichter/drizzle/query-log-ts into lp:~drizzle-trunk/drizzle/development
- query-log-ts
- Merge into development
Proposed by
Daniel Nichter
Status: | Merged |
---|---|
Approved by: | Mark Atwood |
Approved revision: | 2421 |
Merged at revision: | 2422 |
Proposed branch: | lp:~daniel-nichter/drizzle/query-log-ts |
Merge into: | lp:~drizzle-trunk/drizzle/development |
Diff against target: |
385 lines (+64/-42) 8 files modified
plugin/query_log/docs/index.rst (+42/-18) plugin/query_log/file.cc (+2/-1) plugin/query_log/tests/check-query-log-attribute.pl (+1/-4) plugin/query_log/tests/r/check_query_log_attribute.result (+1/-1) plugin/query_log/tests/r/file.result (+14/-14) plugin/query_log/tests/r/thresholds.result (+2/-2) plugin/query_log/tests/samples/sample-event.log (+1/-1) plugin/query_log/tests/t/file.test (+1/-1) |
To merge this branch: | bzr merge lp:~daniel-nichter/drizzle/query-log-ts |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Drizzle Merge Team | Pending | ||
Review via email: mp+75924@code.launchpad.net |
Commit message
Description of the change
Just changes to query_log plugin, primarily: make first line of events "start_ts=VALUE" instead of a special bare "VALUE". This makes it possible to match/parse all attributes with one pattern because they are now all of the form ATTRIBUTE=VALUE. Documented meta-format of query log file.
To post a comment you must log in.
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'plugin/query_log/docs/index.rst' | |||
2 | --- plugin/query_log/docs/index.rst 2011-09-03 22:25:16 +0000 | |||
3 | +++ plugin/query_log/docs/index.rst 2011-09-18 20:15:24 +0000 | |||
4 | @@ -116,7 +116,7 @@ | |||
5 | 116 | * ``query_log_enabled`` | 116 | * ``query_log_enabled`` |
6 | 117 | 117 | ||
7 | 118 | :Scope: Global | 118 | :Scope: Global |
9 | 119 | :Dynamic: No | 119 | :Dynamic: Yes |
10 | 120 | :Option: | 120 | :Option: |
11 | 121 | 121 | ||
12 | 122 | If query logging is globally enabled or not. | 122 | If query logging is globally enabled or not. |
13 | @@ -126,7 +126,7 @@ | |||
14 | 126 | * ``query_log_file`` | 126 | * ``query_log_file`` |
15 | 127 | 127 | ||
16 | 128 | :Scope: Global | 128 | :Scope: Global |
18 | 129 | :Dynamic: No | 129 | :Dynamic: Yes |
19 | 130 | :Option: :option:`--query-log.file` | 130 | :Option: :option:`--query-log.file` |
20 | 131 | 131 | ||
21 | 132 | Query log file. | 132 | Query log file. |
22 | @@ -136,7 +136,7 @@ | |||
23 | 136 | * ``query_log_file_enabled`` | 136 | * ``query_log_file_enabled`` |
24 | 137 | 137 | ||
25 | 138 | :Scope: Global | 138 | :Scope: Global |
27 | 139 | :Dynamic: No | 139 | :Dynamic: Yes |
28 | 140 | :Option: :option:`--query-log.file-enabled` | 140 | :Option: :option:`--query-log.file-enabled` |
29 | 141 | 141 | ||
30 | 142 | If query logging to a file is enabled. | 142 | If query logging to a file is enabled. |
31 | @@ -146,7 +146,7 @@ | |||
32 | 146 | * ``query_log_threshold_execution_time`` | 146 | * ``query_log_threshold_execution_time`` |
33 | 147 | 147 | ||
34 | 148 | :Scope: Global | 148 | :Scope: Global |
36 | 149 | :Dynamic: No | 149 | :Dynamic: Yes |
37 | 150 | :Option: :option:`--query-log.threshold-execution-time` | 150 | :Option: :option:`--query-log.threshold-execution-time` |
38 | 151 | 151 | ||
39 | 152 | Threshold for logging slow queries. | 152 | Threshold for logging slow queries. |
40 | @@ -156,7 +156,7 @@ | |||
41 | 156 | * ``query_log_threshold_lock_time`` | 156 | * ``query_log_threshold_lock_time`` |
42 | 157 | 157 | ||
43 | 158 | :Scope: Global | 158 | :Scope: Global |
45 | 159 | :Dynamic: No | 159 | :Dynamic: Yes |
46 | 160 | :Option: :option:`--query-log.threshold-lock-time` | 160 | :Option: :option:`--query-log.threshold-lock-time` |
47 | 161 | 161 | ||
48 | 162 | Threshold for logging long locking queries. | 162 | Threshold for logging long locking queries. |
49 | @@ -166,7 +166,7 @@ | |||
50 | 166 | * ``query_log_threshold_rows_examined`` | 166 | * ``query_log_threshold_rows_examined`` |
51 | 167 | 167 | ||
52 | 168 | :Scope: Global | 168 | :Scope: Global |
54 | 169 | :Dynamic: No | 169 | :Dynamic: Yes |
55 | 170 | :Option: :option:`--query-log.threshold-rows-examined` | 170 | :Option: :option:`--query-log.threshold-rows-examined` |
56 | 171 | 171 | ||
57 | 172 | Threshold for logging queries that examine too many rows. | 172 | Threshold for logging queries that examine too many rows. |
58 | @@ -176,7 +176,7 @@ | |||
59 | 176 | * ``query_log_threshold_rows_sent`` | 176 | * ``query_log_threshold_rows_sent`` |
60 | 177 | 177 | ||
61 | 178 | :Scope: Global | 178 | :Scope: Global |
63 | 179 | :Dynamic: No | 179 | :Dynamic: Yes |
64 | 180 | :Option: :option:`--query-log.threshold-rows-sent` | 180 | :Option: :option:`--query-log.threshold-rows-sent` |
65 | 181 | 181 | ||
66 | 182 | Threshold for logging queries that return too many rows. | 182 | Threshold for logging queries that return too many rows. |
67 | @@ -186,7 +186,7 @@ | |||
68 | 186 | * ``query_log_threshold_session_time`` | 186 | * ``query_log_threshold_session_time`` |
69 | 187 | 187 | ||
70 | 188 | :Scope: Global | 188 | :Scope: Global |
72 | 189 | :Dynamic: No | 189 | :Dynamic: Yes |
73 | 190 | :Option: :option:`--query-log.threshold-session-time` | 190 | :Option: :option:`--query-log.threshold-session-time` |
74 | 191 | 191 | ||
75 | 192 | Threshold for logging queries that are active too long. | 192 | Threshold for logging queries that are active too long. |
76 | @@ -196,7 +196,7 @@ | |||
77 | 196 | * ``query_log_threshold_tmp_tables`` | 196 | * ``query_log_threshold_tmp_tables`` |
78 | 197 | 197 | ||
79 | 198 | :Scope: Global | 198 | :Scope: Global |
81 | 199 | :Dynamic: No | 199 | :Dynamic: Yes |
82 | 200 | :Option: :option:`--query-log.threshold-tmp-tables` | 200 | :Option: :option:`--query-log.threshold-tmp-tables` |
83 | 201 | 201 | ||
84 | 202 | Threshold for logging queries that use too many temporary tables. | 202 | Threshold for logging queries that use too many temporary tables. |
85 | @@ -206,7 +206,7 @@ | |||
86 | 206 | * ``query_log_threshold_warnings`` | 206 | * ``query_log_threshold_warnings`` |
87 | 207 | 207 | ||
88 | 208 | :Scope: Global | 208 | :Scope: Global |
90 | 209 | :Dynamic: No | 209 | :Dynamic: Yes |
91 | 210 | :Option: :option:`--query-log.threshold-warnings` | 210 | :Option: :option:`--query-log.threshold-warnings` |
92 | 211 | 211 | ||
93 | 212 | Threshold for logging queries that cause too many warnings. | 212 | Threshold for logging queries that cause too many warnings. |
94 | @@ -214,7 +214,7 @@ | |||
95 | 214 | Examples | 214 | Examples |
96 | 215 | -------- | 215 | -------- |
97 | 216 | 216 | ||
99 | 217 | Start Drizzle with the query plugin and log queries that take longer than 1 second to execute to the default log file: | 217 | Start Drizzle with the query plugin and log queries that take longer than 1 second to execute to the default query log file: |
100 | 218 | 218 | ||
101 | 219 | .. code-block:: none | 219 | .. code-block:: none |
102 | 220 | 220 | ||
103 | @@ -257,20 +257,20 @@ | |||
104 | 257 | Log File | 257 | Log File |
105 | 258 | ^^^^^^^^ | 258 | ^^^^^^^^ |
106 | 259 | 259 | ||
108 | 260 | The log file destination is enabled when both ``query_log_enabled`` and ``query_log_file_enabled`` are true (``SHOW VARIABLES`` lists ``ON`` and ``OFF`` instead of ``TRUE`` and ``FASLE``). When ``query_log_file_enabled`` is true, the ``query_log_file`` is open. When ``query_log_file_enabled`` is set false, the log file is closed. This is helpful if you want to rotate the log file. | 260 | The query log file destination is enabled when both ``query_log_enabled`` and ``query_log_file_enabled`` are true (``SHOW VARIABLES`` lists ``ON`` and ``OFF`` instead of ``TRUE`` and ``FASLE``). When ``query_log_file_enabled`` is true, the ``query_log_file`` is open. When ``query_log_file_enabled`` is set false, the query log file is closed. This is helpful if you want to rotate the query log file. |
109 | 261 | 261 | ||
111 | 262 | The log file is a plain text, structured file that is readable by humans and easily parsable by tools. It looks like: | 262 | The query log file is a plain text, structured file that is readable by humans and easily parsable by tools. It looks like: |
112 | 263 | 263 | ||
113 | 264 | .. code-block:: none | 264 | .. code-block:: none |
114 | 265 | 265 | ||
116 | 266 | # 2011-05-15T01:48:17.814985 | 266 | # start_ts=2011-05-15T01:48:17.814985 |
117 | 267 | # session_id=1 query_id=6 rows_examined=0 rows_sent=0 tmp_tables=0 warnings=1 | 267 | # session_id=1 query_id=6 rows_examined=0 rows_sent=0 tmp_tables=0 warnings=1 |
118 | 268 | # execution_time=0.000315 lock_time=0.000315 session_time=16.723020 | 268 | # execution_time=0.000315 lock_time=0.000315 session_time=16.723020 |
119 | 269 | # error=true | 269 | # error=true |
120 | 270 | # schema="" | 270 | # schema="" |
121 | 271 | set query_log_file_enabled=true; | 271 | set query_log_file_enabled=true; |
122 | 272 | # | 272 | # |
124 | 273 | # 2011-05-15T01:48:21.526746 | 273 | # start_ts=2011-05-15T01:48:21.526746 |
125 | 274 | # session_id=1 query_id=7 rows_examined=10 rows_sent=10 tmp_tables=0 warnings=0 | 274 | # session_id=1 query_id=7 rows_examined=10 rows_sent=10 tmp_tables=0 warnings=0 |
126 | 275 | # execution_time=0.000979 lock_time=0.000562 session_time=20.435445 | 275 | # execution_time=0.000979 lock_time=0.000562 session_time=20.435445 |
127 | 276 | # error=false | 276 | # error=false |
128 | @@ -280,7 +280,31 @@ | |||
129 | 280 | 280 | ||
130 | 281 | Events are separated by a single ``#`` character. This record separator can be used by programs like :program:`awk` and :program:`perl` to easily separate events in a log. | 281 | Events are separated by a single ``#`` character. This record separator can be used by programs like :program:`awk` and :program:`perl` to easily separate events in a log. |
131 | 282 | 282 | ||
133 | 283 | The first line line of each event is a UTC/GMT timestamp with microsecond precision; the timezone cannot be changed. The second line has attributes with integer values. The third line has attributes with high-precision time values, always with six decimals places of precision. The fourth line has attributes with boolean values, either ``true`` or ``false``. The fifth line has attributes with string values, always double-quoted. Remaining lines are the query which can contain multiple lines, blank lines, et. The record separator marks the event of the event. | 283 | The first line of each event has UTC/GMT timestamps with microsecond precision; the timezone cannot be changed. The second line has attributes with integer values. The third line has attributes with high-precision time values, always with six decimals places of precision. The fourth line has attributes with boolean values, either ``true`` or ``false``. The fifth line has attributes with string values, always double-quoted. Remaining lines are the query which can contain multiple lines, blank lines, et. The record separator marks the event of the event. |
134 | 284 | |||
135 | 285 | As the example above demonstrates, the meta-format for each event in the query log is:: | ||
136 | 286 | |||
137 | 287 | # attribute=value | ||
138 | 288 | query | ||
139 | 289 | # | ||
140 | 290 | |||
141 | 291 | Parsing a query log file should be easy since the format is static, consistent, and follows | ||
142 | 292 | these rules: | ||
143 | 293 | |||
144 | 294 | * Attribute-value pairs are on comment lines that begin with one ``#`` character followed | ||
145 | 295 | by a space. | ||
146 | 296 | * Comment lines have one or more attribute-value pairs. | ||
147 | 297 | * Attribute-value pairs are separated by one space. | ||
148 | 298 | * Attribute names are lowercase with only characters ``a`` to ``z`` and ``_`` (underscore). | ||
149 | 299 | * Attribute names with suffix ``_ts`` have microsecond UTC/GMT timestamp values. | ||
150 | 300 | * Attribute names with suffix ``_time`` have values with an amount of time in seconds with | ||
151 | 301 | microsecond precision. | ||
152 | 302 | * One or more comment line precedes the query. | ||
153 | 303 | * A query is always printed; there are no "admin commands" or special queries. | ||
154 | 304 | * Every query is terminated by one ``#`` character followed by a newline (``\n``), | ||
155 | 305 | even the last query in the log file. | ||
156 | 306 | * There are no blank lines between events. | ||
157 | 307 | * Only events with this format are printed; there are no special or "fluff" lines. | ||
158 | 284 | 308 | ||
159 | 285 | Bugs and Limitations | 309 | Bugs and Limitations |
160 | 286 | -------------------- | 310 | -------------------- |
161 | @@ -316,7 +340,7 @@ | |||
162 | 316 | Version | 340 | Version |
163 | 317 | ------- | 341 | ------- |
164 | 318 | 342 | ||
166 | 319 | This documentation applies to **query_log 0.1**. | 343 | This documentation applies to **query_log 1.0**. |
167 | 320 | 344 | ||
168 | 321 | To see which version of the plugin a Drizzle server is running, execute: | 345 | To see which version of the plugin a Drizzle server is running, execute: |
169 | 322 | 346 | ||
170 | @@ -327,6 +351,6 @@ | |||
171 | 327 | Changelog | 351 | Changelog |
172 | 328 | --------- | 352 | --------- |
173 | 329 | 353 | ||
175 | 330 | v0.1 | 354 | v1.0 |
176 | 331 | ^^^^ | 355 | ^^^^ |
177 | 332 | * First release. | 356 | * First release. |
178 | 333 | 357 | ||
179 | === modified file 'plugin/query_log/file.cc' | |||
180 | --- plugin/query_log/file.cc 2011-07-30 21:28:21 +0000 | |||
181 | +++ plugin/query_log/file.cc 2011-09-18 20:15:24 +0000 | |||
182 | @@ -37,7 +37,8 @@ | |||
183 | 37 | { | 37 | { |
184 | 38 | if (_fh.is_open()) | 38 | if (_fh.is_open()) |
185 | 39 | { | 39 | { |
187 | 40 | _fh << "# " << event->ts << "\n" | 40 | _fh << "# start_ts=" << event->ts |
188 | 41 | << "\n" | ||
189 | 41 | << "# session_id=" << event->session_id | 42 | << "# session_id=" << event->session_id |
190 | 42 | << " query_id=" << event->query_id | 43 | << " query_id=" << event->query_id |
191 | 43 | << " rows_examined=" << event->rows_examined | 44 | << " rows_examined=" << event->rows_examined |
192 | 44 | 45 | ||
193 | === modified file 'plugin/query_log/tests/check-query-log-attribute.pl' | |||
194 | --- plugin/query_log/tests/check-query-log-attribute.pl 2011-05-15 17:58:28 +0000 | |||
195 | +++ plugin/query_log/tests/check-query-log-attribute.pl 2011-09-18 20:15:24 +0000 | |||
196 | @@ -103,10 +103,7 @@ | |||
197 | 103 | my $lineno = 1; | 103 | my $lineno = 1; |
198 | 104 | foreach my $line ( @event_lines ) { | 104 | foreach my $line ( @event_lines ) { |
199 | 105 | next if $line =~ m/^$/; | 105 | next if $line =~ m/^$/; |
204 | 106 | if ( $lineno == 1 ) { # timestamp | 106 | if ( $lineno <= 4 ) { # ts, ints, floats and bools |
201 | 107 | push @props, 'ts', $line =~ m/^# (\S+)/; | ||
202 | 108 | } | ||
203 | 109 | elsif ( $lineno >= 2 && $lineno <= 4 ) { # ints, floats and bools | ||
205 | 110 | push @props, $line =~ m/([a-z_]+)=(\S+)/g; | 107 | push @props, $line =~ m/([a-z_]+)=(\S+)/g; |
206 | 111 | } | 108 | } |
207 | 112 | elsif ( $lineno == 5 ) { # strings | 109 | elsif ( $lineno == 5 ) { # strings |
208 | 113 | 110 | ||
209 | === modified file 'plugin/query_log/tests/r/check_query_log_attribute.result' | |||
210 | --- plugin/query_log/tests/r/check_query_log_attribute.result 2011-05-15 17:58:28 +0000 | |||
211 | +++ plugin/query_log/tests/r/check_query_log_attribute.result 2011-09-18 20:15:24 +0000 | |||
212 | @@ -9,6 +9,6 @@ | |||
213 | 9 | schema=test | 9 | schema=test |
214 | 10 | session_id=1 | 10 | session_id=1 |
215 | 11 | session_time=1.234567 | 11 | session_time=1.234567 |
216 | 12 | start_ts=1234-56-78T90:12:34.567890 | ||
217 | 12 | tmp_tables=5 | 13 | tmp_tables=5 |
218 | 13 | ts=1234-56-78T90:12:34.567890 | ||
219 | 14 | warnings=6 | 14 | warnings=6 |
220 | 15 | 15 | ||
221 | === modified file 'plugin/query_log/tests/r/file.result' | |||
222 | --- plugin/query_log/tests/r/file.result 2011-08-03 16:10:06 +0000 | |||
223 | +++ plugin/query_log/tests/r/file.result 2011-09-18 20:15:24 +0000 | |||
224 | @@ -21,14 +21,14 @@ | |||
225 | 21 | SELECT @@query_log_enabled, @@query_log_file_enabled; | 21 | SELECT @@query_log_enabled, @@query_log_file_enabled; |
226 | 22 | @@query_log_enabled @@query_log_file_enabled | 22 | @@query_log_enabled @@query_log_file_enabled |
227 | 23 | 1 1 | 23 | 1 1 |
229 | 24 | # 0000-00-00T00:00:00.000000 | 24 | # start_ts=0-00-00T00:00:00.000000 |
230 | 25 | # session_id=0 query_id=0 rows_examined=0 rows_sent=0 tmp_tables=0 warnings=0 | 25 | # session_id=0 query_id=0 rows_examined=0 rows_sent=0 tmp_tables=0 warnings=0 |
231 | 26 | # execution_time=0.000000 lock_time=0.000000 session_time=0.000000 | 26 | # execution_time=0.000000 lock_time=0.000000 session_time=0.000000 |
232 | 27 | # error=false | 27 | # error=false |
233 | 28 | # schema="test" | 28 | # schema="test" |
234 | 29 | SET GLOBAL query_log_file_enabled=TRUE; | 29 | SET GLOBAL query_log_file_enabled=TRUE; |
235 | 30 | # | 30 | # |
237 | 31 | # 0000-00-00T00:00:00.000000 | 31 | # start_ts=0-00-00T00:00:00.000000 |
238 | 32 | # session_id=0 query_id=0 rows_examined=0 rows_sent=0 tmp_tables=0 warnings=0 | 32 | # session_id=0 query_id=0 rows_examined=0 rows_sent=0 tmp_tables=0 warnings=0 |
239 | 33 | # execution_time=0.000000 lock_time=0.000000 session_time=0.000000 | 33 | # execution_time=0.000000 lock_time=0.000000 session_time=0.000000 |
240 | 34 | # error=false | 34 | # error=false |
241 | @@ -42,14 +42,14 @@ | |||
242 | 42 | SELECT 2; | 42 | SELECT 2; |
243 | 43 | 2 | 43 | 2 |
244 | 44 | 2 | 44 | 2 |
246 | 45 | # 0000-00-00T00:00:00.000000 | 45 | # start_ts=0-00-00T00:00:00.000000 |
247 | 46 | # session_id=0 query_id=0 rows_examined=0 rows_sent=0 tmp_tables=0 warnings=0 | 46 | # session_id=0 query_id=0 rows_examined=0 rows_sent=0 tmp_tables=0 warnings=0 |
248 | 47 | # execution_time=0.000000 lock_time=0.000000 session_time=0.000000 | 47 | # execution_time=0.000000 lock_time=0.000000 session_time=0.000000 |
249 | 48 | # error=false | 48 | # error=false |
250 | 49 | # schema="test" | 49 | # schema="test" |
251 | 50 | SET GLOBAL query_log_file_enabled=TRUE; | 50 | SET GLOBAL query_log_file_enabled=TRUE; |
252 | 51 | # | 51 | # |
254 | 52 | # 0000-00-00T00:00:00.000000 | 52 | # start_ts=0-00-00T00:00:00.000000 |
255 | 53 | # session_id=0 query_id=0 rows_examined=0 rows_sent=0 tmp_tables=0 warnings=0 | 53 | # session_id=0 query_id=0 rows_examined=0 rows_sent=0 tmp_tables=0 warnings=0 |
256 | 54 | # execution_time=0.000000 lock_time=0.000000 session_time=0.000000 | 54 | # execution_time=0.000000 lock_time=0.000000 session_time=0.000000 |
257 | 55 | # error=false | 55 | # error=false |
258 | @@ -71,14 +71,14 @@ | |||
259 | 71 | this is the second log file | 71 | this is the second log file |
260 | 72 | this is the second log file | 72 | this is the second log file |
261 | 73 | Log file exists | 73 | Log file exists |
263 | 74 | # 0000-00-00T00:00:00.000000 | 74 | # start_ts=0-00-00T00:00:00.000000 |
264 | 75 | # session_id=0 query_id=0 rows_examined=0 rows_sent=0 tmp_tables=0 warnings=0 | 75 | # session_id=0 query_id=0 rows_examined=0 rows_sent=0 tmp_tables=0 warnings=0 |
265 | 76 | # execution_time=0.000000 lock_time=0.000000 session_time=0.000000 | 76 | # execution_time=0.000000 lock_time=0.000000 session_time=0.000000 |
266 | 77 | # error=false | 77 | # error=false |
267 | 78 | # schema="test" | 78 | # schema="test" |
268 | 79 | SET GLOBAL query_log_file_enabled=TRUE; | 79 | SET GLOBAL query_log_file_enabled=TRUE; |
269 | 80 | # | 80 | # |
271 | 81 | # 0000-00-00T00:00:00.000000 | 81 | # start_ts=0-00-00T00:00:00.000000 |
272 | 82 | # session_id=0 query_id=0 rows_examined=0 rows_sent=0 tmp_tables=0 warnings=0 | 82 | # session_id=0 query_id=0 rows_examined=0 rows_sent=0 tmp_tables=0 warnings=0 |
273 | 83 | # execution_time=0.000000 lock_time=0.000000 session_time=0.000000 | 83 | # execution_time=0.000000 lock_time=0.000000 session_time=0.000000 |
274 | 84 | # error=false | 84 | # error=false |
275 | @@ -93,49 +93,49 @@ | |||
276 | 93 | SELECT 'this is the third log file'; | 93 | SELECT 'this is the third log file'; |
277 | 94 | this is the third log file | 94 | this is the third log file |
278 | 95 | this is the third log file | 95 | this is the third log file |
280 | 96 | # 0000-00-00T00:00:00.000000 | 96 | # start_ts=0-00-00T00:00:00.000000 |
281 | 97 | # session_id=0 query_id=0 rows_examined=0 rows_sent=0 tmp_tables=0 warnings=0 | 97 | # session_id=0 query_id=0 rows_examined=0 rows_sent=0 tmp_tables=0 warnings=0 |
282 | 98 | # execution_time=0.000000 lock_time=0.000000 session_time=0.000000 | 98 | # execution_time=0.000000 lock_time=0.000000 session_time=0.000000 |
283 | 99 | # error=false | 99 | # error=false |
284 | 100 | # schema="third-log-file" | 100 | # schema="third-log-file" |
285 | 101 | SET GLOBAL query_log_file="third-log-file"; | 101 | SET GLOBAL query_log_file="third-log-file"; |
286 | 102 | # | 102 | # |
288 | 103 | # 0000-00-00T00:00:00.000000 | 103 | # start_ts=0-00-00T00:00:00.000000 |
289 | 104 | # session_id=0 query_id=0 rows_examined=0 rows_sent=0 tmp_tables=0 warnings=0 | 104 | # session_id=0 query_id=0 rows_examined=0 rows_sent=0 tmp_tables=0 warnings=0 |
290 | 105 | # execution_time=0.000000 lock_time=0.000000 session_time=0.000000 | 105 | # execution_time=0.000000 lock_time=0.000000 session_time=0.000000 |
291 | 106 | # error=false | 106 | # error=false |
292 | 107 | # schema="third-log-file" | 107 | # schema="third-log-file" |
293 | 108 | SELECT @@query_log_enabled, @@query_log_file_enabled, @@query_log_file; | 108 | SELECT @@query_log_enabled, @@query_log_file_enabled, @@query_log_file; |
294 | 109 | # | 109 | # |
296 | 110 | # 0000-00-00T00:00:00.000000 | 110 | # start_ts=0-00-00T00:00:00.000000 |
297 | 111 | # session_id=0 query_id=0 rows_examined=0 rows_sent=0 tmp_tables=0 warnings=0 | 111 | # session_id=0 query_id=0 rows_examined=0 rows_sent=0 tmp_tables=0 warnings=0 |
298 | 112 | # execution_time=0.000000 lock_time=0.000000 session_time=0.000000 | 112 | # execution_time=0.000000 lock_time=0.000000 session_time=0.000000 |
299 | 113 | # error=false | 113 | # error=false |
300 | 114 | # schema="third-log-file" | 114 | # schema="third-log-file" |
301 | 115 | SELECT 'this is the third log file'; | 115 | SELECT 'this is the third log file'; |
302 | 116 | # | 116 | # |
304 | 117 | # 0000-00-00T00:00:00.000000 | 117 | # start_ts=0-00-00T00:00:00.000000 |
305 | 118 | # session_id=0 query_id=0 rows_examined=0 rows_sent=0 tmp_tables=0 warnings=0 | 118 | # session_id=0 query_id=0 rows_examined=0 rows_sent=0 tmp_tables=0 warnings=0 |
306 | 119 | # execution_time=0.000000 lock_time=0.000000 session_time=0.000000 | 119 | # execution_time=0.000000 lock_time=0.000000 session_time=0.000000 |
307 | 120 | # error=false | 120 | # error=false |
308 | 121 | # schema="test" | 121 | # schema="test" |
309 | 122 | SET GLOBAL query_log_file_enabled=TRUE; | 122 | SET GLOBAL query_log_file_enabled=TRUE; |
310 | 123 | # | 123 | # |
312 | 124 | # 0000-00-00T00:00:00.000000 | 124 | # start_ts=0-00-00T00:00:00.000000 |
313 | 125 | # session_id=0 query_id=0 rows_examined=0 rows_sent=0 tmp_tables=0 warnings=0 | 125 | # session_id=0 query_id=0 rows_examined=0 rows_sent=0 tmp_tables=0 warnings=0 |
314 | 126 | # execution_time=0.000000 lock_time=0.000000 session_time=0.000000 | 126 | # execution_time=0.000000 lock_time=0.000000 session_time=0.000000 |
315 | 127 | # error=false | 127 | # error=false |
316 | 128 | # schema="test" | 128 | # schema="test" |
317 | 129 | SELECT @@query_log_enabled, @@query_log_file_enabled; | 129 | SELECT @@query_log_enabled, @@query_log_file_enabled; |
318 | 130 | # | 130 | # |
320 | 131 | # 0000-00-00T00:00:00.000000 | 131 | # start_ts=0-00-00T00:00:00.000000 |
321 | 132 | # session_id=0 query_id=0 rows_examined=0 rows_sent=0 tmp_tables=0 warnings=0 | 132 | # session_id=0 query_id=0 rows_examined=0 rows_sent=0 tmp_tables=0 warnings=0 |
322 | 133 | # execution_time=0.000000 lock_time=0.000000 session_time=0.000000 | 133 | # execution_time=0.000000 lock_time=0.000000 session_time=0.000000 |
323 | 134 | # error=false | 134 | # error=false |
324 | 135 | # schema="test" | 135 | # schema="test" |
325 | 136 | SET GLOBAL query_log_file_enabled=TRUE; | 136 | SET GLOBAL query_log_file_enabled=TRUE; |
326 | 137 | # | 137 | # |
328 | 138 | # 0000-00-00T00:00:00.000000 | 138 | # start_ts=0-00-00T00:00:00.000000 |
329 | 139 | # session_id=0 query_id=0 rows_examined=0 rows_sent=0 tmp_tables=0 warnings=0 | 139 | # session_id=0 query_id=0 rows_examined=0 rows_sent=0 tmp_tables=0 warnings=0 |
330 | 140 | # execution_time=0.000000 lock_time=0.000000 session_time=0.000000 | 140 | # execution_time=0.000000 lock_time=0.000000 session_time=0.000000 |
331 | 141 | # error=false | 141 | # error=false |
332 | @@ -144,7 +144,7 @@ | |||
333 | 144 | # | 144 | # |
334 | 145 | SET GLOBAL query_log_file="DRIZZLETEST_VARDIR/query.log"; | 145 | SET GLOBAL query_log_file="DRIZZLETEST_VARDIR/query.log"; |
335 | 146 | Checking attributes and values of query SELECT DATE(NOW()); | 146 | Checking attributes and values of query SELECT DATE(NOW()); |
337 | 147 | ts value matches OK | 147 | start_ts value matches OK |
338 | 148 | Checking attributes and values of query SELECT DATE(NOW()); | 148 | Checking attributes and values of query SELECT DATE(NOW()); |
339 | 149 | execution_time value matches OK | 149 | execution_time value matches OK |
340 | 150 | lock_time value matches OK | 150 | lock_time value matches OK |
341 | 151 | 151 | ||
342 | === modified file 'plugin/query_log/tests/r/thresholds.result' | |||
343 | --- plugin/query_log/tests/r/thresholds.result 2011-08-03 16:10:06 +0000 | |||
344 | +++ plugin/query_log/tests/r/thresholds.result 2011-09-18 20:15:24 +0000 | |||
345 | @@ -26,7 +26,7 @@ | |||
346 | 26 | Checking attributes and values of query SELECT SLEEP(0.5); | 26 | Checking attributes and values of query SELECT SLEEP(0.5); |
347 | 27 | arg value equals SELECT SLEEP(0.5); OK | 27 | arg value equals SELECT SLEEP(0.5); OK |
348 | 28 | 28 | ||
350 | 29 | # 0000-00-00T00:00:00.000000 | 29 | # start_ts=0-00-00T00:00:00.000000 |
351 | 30 | # session_id=0 query_id=0 rows_examined=0 rows_sent=0 tmp_tables=0 warnings=0 | 30 | # session_id=0 query_id=0 rows_examined=0 rows_sent=0 tmp_tables=0 warnings=0 |
352 | 31 | # execution_time=0.000000 lock_time=0.000000 session_time=0.000000 | 31 | # execution_time=0.000000 lock_time=0.000000 session_time=0.000000 |
353 | 32 | # error=false | 32 | # error=false |
354 | @@ -45,7 +45,7 @@ | |||
355 | 45 | Checking attributes and values of query SELECT 'one'; | 45 | Checking attributes and values of query SELECT 'one'; |
356 | 46 | arg value equals SELECT 'one'; OK | 46 | arg value equals SELECT 'one'; OK |
357 | 47 | 47 | ||
359 | 48 | # 0000-00-00T00:00:00.000000 | 48 | # start_ts=0-00-00T00:00:00.000000 |
360 | 49 | # session_id=0 query_id=0 rows_examined=0 rows_sent=0 tmp_tables=0 warnings=0 | 49 | # session_id=0 query_id=0 rows_examined=0 rows_sent=0 tmp_tables=0 warnings=0 |
361 | 50 | # execution_time=0.000000 lock_time=0.000000 session_time=0.000000 | 50 | # execution_time=0.000000 lock_time=0.000000 session_time=0.000000 |
362 | 51 | # error=false | 51 | # error=false |
363 | 52 | 52 | ||
364 | === modified file 'plugin/query_log/tests/samples/sample-event.log' | |||
365 | --- plugin/query_log/tests/samples/sample-event.log 2011-05-15 17:58:28 +0000 | |||
366 | +++ plugin/query_log/tests/samples/sample-event.log 2011-09-18 20:15:24 +0000 | |||
367 | @@ -1,4 +1,4 @@ | |||
369 | 1 | # 1234-56-78T90:12:34.567890 | 1 | # start_ts=1234-56-78T90:12:34.567890 |
370 | 2 | # session_id=1 query_id=2 rows_examined=3 rows_sent=4 tmp_tables=5 warnings=6 | 2 | # session_id=1 query_id=2 rows_examined=3 rows_sent=4 tmp_tables=5 warnings=6 |
371 | 3 | # execution_time=7.890123 lock_time=4.567890 session_time=1.234567 | 3 | # execution_time=7.890123 lock_time=4.567890 session_time=1.234567 |
372 | 4 | # error=false | 4 | # error=false |
373 | 5 | 5 | ||
374 | === modified file 'plugin/query_log/tests/t/file.test' | |||
375 | --- plugin/query_log/tests/t/file.test 2011-08-03 16:10:06 +0000 | |||
376 | +++ plugin/query_log/tests/t/file.test 2011-09-18 20:15:24 +0000 | |||
377 | @@ -100,7 +100,7 @@ | |||
378 | 100 | # YYYY-MM-DDTHH:MM:SS.uuuuuu. We just check that the start of the ts | 100 | # YYYY-MM-DDTHH:MM:SS.uuuuuu. We just check that the start of the ts |
379 | 101 | # matches today's date. | 101 | # matches today's date. |
380 | 102 | let $today= `SELECT DATE(NOW())`; | 102 | let $today= `SELECT DATE(NOW())`; |
382 | 103 | --exec $TOP_SRCDIR/plugin/query_log/tests/check-query-log-attribute.pl $DRIZZLETEST_VARDIR/query.log ts matches "^$today" | 103 | --exec $TOP_SRCDIR/plugin/query_log/tests/check-query-log-attribute.pl $DRIZZLETEST_VARDIR/query.log start_ts matches "^$today" |
383 | 104 | 104 | ||
384 | 105 | # The 3rd line of an event should be microsecond times like 1.123456 | 105 | # The 3rd line of an event should be microsecond times like 1.123456 |
385 | 106 | --exec $TOP_SRCDIR/plugin/query_log/tests/check-query-log-attribute.pl $DRIZZLETEST_VARDIR/query.log execution_time,lock_time,session_time matches '\d\.\d{6}','\d\.\d{6}','\d\.\d{6}' | 106 | --exec $TOP_SRCDIR/plugin/query_log/tests/check-query-log-attribute.pl $DRIZZLETEST_VARDIR/query.log execution_time,lock_time,session_time matches '\d\.\d{6}','\d\.\d{6}','\d\.\d{6}' |