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
=== modified file 'plugin/innobase/handler/ha_innodb.cc'
--- plugin/innobase/handler/ha_innodb.cc 2009-08-20 21:45:52 +0000
+++ plugin/innobase/handler/ha_innodb.cc 2009-09-17 04:08:08 +0000
@@ -877,11 +877,21 @@
877innobase_mysql_print_thd(877innobase_mysql_print_thd(
878/*=====================*/878/*=====================*/
879 FILE * f, /* in: output stream */879 FILE * f, /* in: output stream */
880 void *, /* in: pointer to a MySQL Session object */880 void *session, /* in: pointer to a MySQL Session object */
881 uint) /* in: max query length to print, or 0 to881 uint) /* in: max query length to print, or 0 to
882 use the default max length */882 use the default max length */
883{883{
884 fputs("Unknown thread accessing table", f);884 fprintf(f,
885 "Drizzle thread %"PRIu64", query id %"PRIu64", %s, %s, %s ",
886 static_cast<uint64_t>(session_get_thread_id((Session*) session)),
887 static_cast<uint64_t>(((Session*) session)->getQueryId()),
888 glob_hostname,
889 ((Session*) session)->security_ctx.ip.c_str(),
890 ((Session*) session)->security_ctx.user.c_str()
891 );
892 fprintf(f,
893 "\n%s", ((Session*) session)->getQueryString()
894 );
885 putc('\n', f);895 putc('\n', f);
886}896}
887897