~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/logging_query/logging_query.cc

  • Committer: Brian Aker
  • Date: 2008-10-20 03:40:03 UTC
  • mto: (492.3.21 drizzle-clean-code)
  • mto: This revision was merged to the branch mainline in revision 530.
  • Revision ID: brian@tangent.org-20081020034003-t2dcnl0ayr2ymm8k
THD -> Session rename

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
18
18
 */
19
19
 
20
 
/* need to define DRIZZLE_SERVER to get inside the THD */
 
20
/* need to define DRIZZLE_SERVER to get inside the Session */
21
21
#define DRIZZLE_SERVER 1
22
22
#include <drizzled/server_includes.h>
23
23
#include <drizzled/plugin_logging.h>
59
59
 
60
60
 
61
61
/* stolen from mysys/my_getsystime 
62
 
   until the THD has a good utime "now" we can use
 
62
   until the Session has a good utime "now" we can use
63
63
   will have to use this instead */
64
64
 
65
65
#include <sys/time.h>
82
82
/* we could just not have a pre entrypoint at all,
83
83
   and have logging_pre == NULL
84
84
   but we have this here for the sake of being an example */
85
 
bool logging_query_func_pre (THD *thd __attribute__((unused)))
 
85
bool logging_query_func_pre (Session *thd __attribute__((unused)))
86
86
{
87
87
  return false;
88
88
}
89
89
 
90
 
bool logging_query_func_post (THD *thd)
 
90
bool logging_query_func_post (Session *thd)
91
91
{
92
92
  char msgbuf[MAX_MSG_LEN];
93
93
  int msgbuf_len= 0;
98
98
  assert(thd != NULL);
99
99
 
100
100
  /*
101
 
    here is some time stuff from class THD
 
101
    here is some time stuff from class Session
102
102
      uint64_t connect_utime;
103
103
        todo, looks like this isnt being set
104
104
        we could store the time this plugin was loaded
109
109
        todo, cant get to because of namemangling
110
110
  */
111
111
 
112
 
  /* todo, the THD should have a "utime command completed" inside
 
112
  /* todo, the Session should have a "utime command completed" inside
113
113
     itself, so be more accurate, and so plugins dont have to keep
114
114
     calling current_utime, which can be slow */
115
115
  uint64_t t_mark= get_microtime();