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)))
90
bool logging_query_func_post (Session *thd)
90
bool logging_query_func_post (Session *session)
92
92
char msgbuf[MAX_MSG_LEN];
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,