Merge lp://staging/~diego-fmpwizard/drizzle/plugin-innodb-fixes into lp://staging/~drizzle-trunk/drizzle/development

Proposed by fmpwizard
Status: Superseded
Proposed branch: lp://staging/~diego-fmpwizard/drizzle/plugin-innodb-fixes
Merge into: lp://staging/~drizzle-trunk/drizzle/development
Diff against target: None lines
To merge this branch: bzr merge lp://staging/~diego-fmpwizard/drizzle/plugin-innodb-fixes
Reviewer Review Type Date Requested Status
Jay Pipes (community) Needs Information
Review via email: mp+11977@code.staging.launchpad.net

This proposal has been superseded by a proposal from 2009-09-18.

To post a comment you must log in.
Revision history for this message
fmpwizard (diego-fmpwizard) wrote :

The output from SHOW ENGINE INNODB STATUS does not show thread information under the Transactions section.

This patch adds the following:

* Thread ID
* Query ID
* Hostname
* Client IP
* Username
* Query text

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

Hi! Cool stuff, Diego.

Any way we can get rid of the void* in the parameter list and just pass a Session pointer? It would get rid of all those ugly (Session *)session-> stuff.

Other than that small suggestion, nothing wrong with the code. :)

Cheers!

jay

review: Needs Information
1128. By Diego Medina <email address hidden>

* Replaced some ugly code for nicer one :)

1129. By Diego Medina <email address hidden>

merge from trunk

Unmerged revisions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'plugin/innobase/handler/ha_innodb.cc'
2--- plugin/innobase/handler/ha_innodb.cc 2009-08-20 21:45:52 +0000
3+++ plugin/innobase/handler/ha_innodb.cc 2009-09-17 04:08:08 +0000
4@@ -877,11 +877,21 @@
5 innobase_mysql_print_thd(
6 /*=====================*/
7 FILE * f, /* in: output stream */
8- void *, /* in: pointer to a MySQL Session object */
9+ void *session, /* in: pointer to a MySQL Session object */
10 uint) /* in: max query length to print, or 0 to
11 use the default max length */
12 {
13- fputs("Unknown thread accessing table", f);
14+ fprintf(f,
15+ "Drizzle thread %"PRIu64", query id %"PRIu64", %s, %s, %s ",
16+ static_cast<uint64_t>(session_get_thread_id((Session*) session)),
17+ static_cast<uint64_t>(((Session*) session)->getQueryId()),
18+ glob_hostname,
19+ ((Session*) session)->security_ctx.ip.c_str(),
20+ ((Session*) session)->security_ctx.user.c_str()
21+ );
22+ fprintf(f,
23+ "\n%s", ((Session*) session)->getQueryString()
24+ );
25 putc('\n', f);
26 }
27