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

Proposed by fmpwizard on 2009-08-21
Status: Merged
Approved by: Jay Pipes on 2009-08-21
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) 2009-08-21 Approve on 2009-08-21
Review via email: mp+10550@code.launchpad.net
To post a comment you must log in.
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.

Jay Pipes (jaypipes) wrote :

Great work, Diego!

review: Approve
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
1=== modified file 'plugin/logging_gearman/logging_gearman.cc'
2--- plugin/logging_gearman/logging_gearman.cc 2009-08-05 09:29:04 +0000
3+++ plugin/logging_gearman/logging_gearman.cc 2009-08-21 18:11:49 +0000
4@@ -240,21 +240,21 @@
5 if (dbs != NULL)
6 dbl= session->db_length;
7
8- // todo, add hostname, listener port, and server id to this
9+
10
11 msgbuf_len=
12 snprintf(msgbuf, MAX_MSG_LEN,
13 "%"PRIu64",%"PRIu64",%"PRIu64",\"%.*s\",\"%s\",\"%.*s\","
14- "%"PRIu64",%"PRIu64",%"PRIu64",%"PRIu64",%"PRIu64
15- "%"PRIu32",%"PRIu32"",
16+ "%"PRIu64",%"PRIu64",%"PRIu64",%"PRIu64",%"PRIu64","
17+ "%"PRIu32",%"PRIu32",%"PRIu32",\"%s\",%"PRIu32"",
18 t_mark,
19 session->thread_id,
20- session->query_id,
21+ session->getQueryId(),
22 // dont need to quote the db name, always CSV safe
23 dbl, dbs,
24 // do need to quote the query
25- quotify((unsigned char *)session->query,
26- session->query_length, qs, sizeof(qs)),
27+ quotify((unsigned char *)session->getQueryString(),
28+ session->getQueryLength(), qs, sizeof(qs)),
29 // command_name is defined in drizzled/sql_parse.cc
30 // dont need to quote the command name, always CSV safe
31 (int)command_name[session->command].length,
32@@ -266,7 +266,11 @@
33 session->sent_row_count,
34 session->examined_row_count,
35 session->tmp_table,
36- session->total_warn_count);
37+ session->total_warn_count,
38+ session->getServerId(),
39+ glob_hostname,
40+ drizzled_tcp_port
41+ );
42
43 char job_handle[GEARMAN_JOB_HANDLE_SIZE];
44
45
46=== modified file 'plugin/logging_query/logging_query.cc'
47--- plugin/logging_query/logging_query.cc 2009-08-05 09:29:04 +0000
48+++ plugin/logging_query/logging_query.cc 2009-08-21 18:11:49 +0000
49@@ -285,15 +285,15 @@
50 snprintf(msgbuf, MAX_MSG_LEN,
51 "%"PRIu64",%"PRIu64",%"PRIu64",\"%.*s\",\"%s\",\"%.*s\","
52 "%"PRIu64",%"PRIu64",%"PRIu64",%"PRIu64",%"PRIu64","
53- "%"PRIu32",%"PRIu32"\n",
54+ "%"PRIu32",%"PRIu32",%"PRIu32",\"%s\",%"PRIu32"\n",
55 t_mark,
56 session->thread_id,
57- session->query_id,
58+ session->getQueryId(),
59 // dont need to quote the db name, always CSV safe
60 dbl, dbs,
61 // do need to quote the query
62- quotify((unsigned char *)session->query,
63- session->query_length, qs, sizeof(qs)),
64+ quotify((unsigned char *)session->getQueryString(),
65+ session->getQueryLength(), qs, sizeof(qs)),
66 // command_name is defined in drizzled/sql_parse.cc
67 // dont need to quote the command name, always CSV safe
68 (int)command_name[session->command].length,
69@@ -305,7 +305,11 @@
70 session->sent_row_count,
71 session->examined_row_count,
72 session->tmp_table,
73- session->total_warn_count);
74+ session->total_warn_count,
75+ session->getServerId(),
76+ glob_hostname,
77+ drizzled_tcp_port
78+ );
79
80 // a single write has a kernel thread lock, thus no need mutex guard this
81 wrv= write(fd, msgbuf, msgbuf_len);
82
83=== modified file 'plugin/logging_syslog/logging_syslog.cc'
84--- plugin/logging_syslog/logging_syslog.cc 2009-08-05 09:29:04 +0000
85+++ plugin/logging_syslog/logging_syslog.cc 2009-08-21 18:11:49 +0000
86@@ -139,10 +139,10 @@
87 if (dbs)
88 dbl= session->db_length;
89
90- const char *qys= (session->query) ? session->query : "";
91+ const char *qys= (session->getQueryString()) ? session->getQueryString() : "";
92 int qyl= 0;
93 if (qys)
94- qyl= session->query_length;
95+ qyl= session->getQueryLength();
96
97 syslog(syslog_priority,
98 "thread_id=%ld query_id=%ld"
99@@ -153,7 +153,7 @@
100 " rows_sent=%ld rows_examined=%ld"
101 " tmp_table=%ld total_warn_count=%ld\n",
102 (unsigned long) session->thread_id,
103- (unsigned long) session->query_id,
104+ (unsigned long) session->getQueryId(),
105 dbl, dbs,
106 qyl, qys,
107 (int) command_name[session->command].length,