~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 04:28:21 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-20081020042821-rqqdrccuu8195k3y
Second pass of thd cleanup

Show diffs side-by-side

added added

removed removed

Lines of Context:
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 (Session *thd __attribute__((unused)))
 
85
bool logging_query_func_pre (Session *session __attribute__((unused)))
86
86
{
87
87
  return false;
88
88
}
89
89
 
90
 
bool logging_query_func_post (Session *thd)
 
90
bool logging_query_func_post (Session *session)
91
91
{
92
92
  char msgbuf[MAX_MSG_LEN];
93
93
  int msgbuf_len= 0;
95
95
 
96
96
  if (fd < 0) return false;
97
97
 
98
 
  assert(thd != NULL);
 
98
  assert(session != NULL);
99
99
 
100
100
  /*
101
101
    here is some time stuff from class Session
121
121
               " command=%.*s"
122
122
               " rows_sent=%ld rows_examined=%u\n"
123
123
               " db=\"%.*s\" query=\"%.*s\"\n"),
124
 
             (unsigned long) thd->thread_id, 
125
 
             (unsigned long) thd->query_id,
126
 
             (unsigned long long)(t_mark - thd->connect_utime),
127
 
             (unsigned long long)(t_mark - thd->start_utime),
128
 
             (unsigned long long)(t_mark - thd->utime_after_lock),
129
 
             (uint32_t)command_name[thd->command].length,
130
 
             command_name[thd->command].str,
131
 
             (unsigned long) thd->sent_row_count,
132
 
             (uint32_t) thd->examined_row_count,
133
 
             thd->db_length, thd->db,
134
 
             thd->query_length, thd->query);
 
124
             (unsigned long) session->thread_id, 
 
125
             (unsigned long) session->query_id,
 
126
             (unsigned long long)(t_mark - session->connect_utime),
 
127
             (unsigned long long)(t_mark - session->start_utime),
 
128
             (unsigned long long)(t_mark - session->utime_after_lock),
 
129
             (uint32_t)command_name[session->command].length,
 
130
             command_name[session->command].str,
 
131
             (unsigned long) session->sent_row_count,
 
132
             (uint32_t) session->examined_row_count,
 
133
             session->db_length, session->db,
 
134
             session->query_length, session->query);
135
135
  /* a single write has a OS level thread lock
136
136
     so there is no need to have mutexes guarding this write,
137
137
  */