Merge lp:~diego-fmpwizard/drizzle/logging_x_plugin_additions into lp:~drizzle-trunk/drizzle/development

Proposed by fmpwizard
Status: Merged
Approved by: Jay Pipes
Approved revision: 1122
Merged at revision: not available
Proposed branch: lp:~diego-fmpwizard/drizzle/logging_x_plugin_additions
Merge into: lp:~drizzle-trunk/drizzle/development
Diff against target: None lines
To merge this branch: bzr merge lp:~diego-fmpwizard/drizzle/logging_x_plugin_additions
Reviewer Review Type Date Requested Status
Jay Pipes (community) Approve
Review via email: mp+10550@code.launchpad.net
To post a comment you must log in.
Revision history for this message
fmpwizard (diego-fmpwizard) wrote :

Added 3 new fields to the gearman and query logging plugins.
Fixed an unreported bug similar to https://bugs.launchpad.net/drizzle/+bug/402831 that affected the gearman logging plugin.

Revision history for this message
Jay Pipes (jaypipes) wrote :

Great work, Diego!

review: Approve
Revision history for this message
Jay Pipes (jaypipes) wrote :

Pulling into my captain branch now...

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'plugin/logging_gearman/logging_gearman.cc'
--- plugin/logging_gearman/logging_gearman.cc 2009-08-05 09:29:04 +0000
+++ plugin/logging_gearman/logging_gearman.cc 2009-08-21 18:11:49 +0000
@@ -240,21 +240,21 @@
240 if (dbs != NULL)240 if (dbs != NULL)
241 dbl= session->db_length;241 dbl= session->db_length;
242 242
243 // todo, add hostname, listener port, and server id to this243
244 244
245 msgbuf_len=245 msgbuf_len=
246 snprintf(msgbuf, MAX_MSG_LEN,246 snprintf(msgbuf, MAX_MSG_LEN,
247 "%"PRIu64",%"PRIu64",%"PRIu64",\"%.*s\",\"%s\",\"%.*s\","247 "%"PRIu64",%"PRIu64",%"PRIu64",\"%.*s\",\"%s\",\"%.*s\","
248 "%"PRIu64",%"PRIu64",%"PRIu64",%"PRIu64",%"PRIu64248 "%"PRIu64",%"PRIu64",%"PRIu64",%"PRIu64",%"PRIu64","
249 "%"PRIu32",%"PRIu32"",249 "%"PRIu32",%"PRIu32",%"PRIu32",\"%s\",%"PRIu32"",
250 t_mark,250 t_mark,
251 session->thread_id,251 session->thread_id,
252 session->query_id,252 session->getQueryId(),
253 // dont need to quote the db name, always CSV safe253 // dont need to quote the db name, always CSV safe
254 dbl, dbs,254 dbl, dbs,
255 // do need to quote the query255 // do need to quote the query
256 quotify((unsigned char *)session->query,256 quotify((unsigned char *)session->getQueryString(),
257 session->query_length, qs, sizeof(qs)),257 session->getQueryLength(), qs, sizeof(qs)),
258 // command_name is defined in drizzled/sql_parse.cc258 // command_name is defined in drizzled/sql_parse.cc
259 // dont need to quote the command name, always CSV safe259 // dont need to quote the command name, always CSV safe
260 (int)command_name[session->command].length,260 (int)command_name[session->command].length,
@@ -266,7 +266,11 @@
266 session->sent_row_count,266 session->sent_row_count,
267 session->examined_row_count,267 session->examined_row_count,
268 session->tmp_table,268 session->tmp_table,
269 session->total_warn_count);269 session->total_warn_count,
270 session->getServerId(),
271 glob_hostname,
272 drizzled_tcp_port
273 );
270 274
271 char job_handle[GEARMAN_JOB_HANDLE_SIZE];275 char job_handle[GEARMAN_JOB_HANDLE_SIZE];
272 276
273277
=== modified file 'plugin/logging_query/logging_query.cc'
--- plugin/logging_query/logging_query.cc 2009-08-05 09:29:04 +0000
+++ plugin/logging_query/logging_query.cc 2009-08-21 18:11:49 +0000
@@ -285,15 +285,15 @@
285 snprintf(msgbuf, MAX_MSG_LEN,285 snprintf(msgbuf, MAX_MSG_LEN,
286 "%"PRIu64",%"PRIu64",%"PRIu64",\"%.*s\",\"%s\",\"%.*s\","286 "%"PRIu64",%"PRIu64",%"PRIu64",\"%.*s\",\"%s\",\"%.*s\","
287 "%"PRIu64",%"PRIu64",%"PRIu64",%"PRIu64",%"PRIu64","287 "%"PRIu64",%"PRIu64",%"PRIu64",%"PRIu64",%"PRIu64","
288 "%"PRIu32",%"PRIu32"\n",288 "%"PRIu32",%"PRIu32",%"PRIu32",\"%s\",%"PRIu32"\n",
289 t_mark,289 t_mark,
290 session->thread_id,290 session->thread_id,
291 session->query_id,291 session->getQueryId(),
292 // dont need to quote the db name, always CSV safe292 // dont need to quote the db name, always CSV safe
293 dbl, dbs,293 dbl, dbs,
294 // do need to quote the query294 // do need to quote the query
295 quotify((unsigned char *)session->query,295 quotify((unsigned char *)session->getQueryString(),
296 session->query_length, qs, sizeof(qs)),296 session->getQueryLength(), qs, sizeof(qs)),
297 // command_name is defined in drizzled/sql_parse.cc297 // command_name is defined in drizzled/sql_parse.cc
298 // dont need to quote the command name, always CSV safe298 // dont need to quote the command name, always CSV safe
299 (int)command_name[session->command].length,299 (int)command_name[session->command].length,
@@ -305,7 +305,11 @@
305 session->sent_row_count,305 session->sent_row_count,
306 session->examined_row_count,306 session->examined_row_count,
307 session->tmp_table,307 session->tmp_table,
308 session->total_warn_count);308 session->total_warn_count,
309 session->getServerId(),
310 glob_hostname,
311 drizzled_tcp_port
312 );
309 313
310 // a single write has a kernel thread lock, thus no need mutex guard this314 // a single write has a kernel thread lock, thus no need mutex guard this
311 wrv= write(fd, msgbuf, msgbuf_len);315 wrv= write(fd, msgbuf, msgbuf_len);
312316
=== modified file 'plugin/logging_syslog/logging_syslog.cc'
--- plugin/logging_syslog/logging_syslog.cc 2009-08-05 09:29:04 +0000
+++ plugin/logging_syslog/logging_syslog.cc 2009-08-21 18:11:49 +0000
@@ -139,10 +139,10 @@
139 if (dbs)139 if (dbs)
140 dbl= session->db_length;140 dbl= session->db_length;
141 141
142 const char *qys= (session->query) ? session->query : "";142 const char *qys= (session->getQueryString()) ? session->getQueryString() : "";
143 int qyl= 0;143 int qyl= 0;
144 if (qys)144 if (qys)
145 qyl= session->query_length;145 qyl= session->getQueryLength();
146 146
147 syslog(syslog_priority,147 syslog(syslog_priority,
148 "thread_id=%ld query_id=%ld"148 "thread_id=%ld query_id=%ld"
@@ -153,7 +153,7 @@
153 " rows_sent=%ld rows_examined=%ld"153 " rows_sent=%ld rows_examined=%ld"
154 " tmp_table=%ld total_warn_count=%ld\n",154 " tmp_table=%ld total_warn_count=%ld\n",
155 (unsigned long) session->thread_id,155 (unsigned long) session->thread_id,
156 (unsigned long) session->query_id,156 (unsigned long) session->getQueryId(),
157 dbl, dbs,157 dbl, dbs,
158 qyl, qys,158 qyl, qys,
159 (int) command_name[session->command].length,159 (int) command_name[session->command].length,