fix for empty "Connect" entries at startup. issue #40 and pr #103 :

pull/141/head
Guy Lichtman 2015-02-10 00:04:21 +02:00
parent 00194ab4bb
commit 56462bd9d4
1 changed files with 20 additions and 14 deletions

View File

@ -381,26 +381,32 @@ static bool audit_open_tables(THD *thd, TABLE_LIST **start, uint *counter, uint
Prelocking_strategy *prelocking_strategy) Prelocking_strategy *prelocking_strategy)
{ {
bool res; bool res;
res = trampoline_open_tables (thd, start, counter, flags, prelocking_strategy); res = trampoline_open_tables (thd, start, counter, flags, prelocking_strategy);
ThdSesData thd_data (thd); //only log if thread id or query id is non 0 (otherwise this is comming from startup activity)
audit(&thd_data); if(Audit_formatter::thd_inst_thread_id(thd) || Audit_formatter::thd_inst_query_id(thd))
return res; {
ThdSesData thd_data (thd);
audit(&thd_data);
}
return res;
} }
static unsigned int trampoline_open_tables_size =0;
#else #else
static int audit_open_tables(THD *thd, TABLE_LIST **start, uint *counter, uint flags) static int audit_open_tables(THD *thd, TABLE_LIST **start, uint *counter, uint flags)
{ {
bool res; bool res;
res = trampoline_open_tables (thd, start, counter, flags); res = trampoline_open_tables (thd, start, counter, flags);
ThdSesData thd_data (thd); //only log if thread id or query id is non 0 (otherwise this is comming from startup activity)
audit(&thd_data); if(Audit_formatter::thd_inst_thread_id(thd) || Audit_formatter::thd_inst_query_id(thd))
return res; {
ThdSesData thd_data (thd);
audit(&thd_data);
}
return res;
} }
static unsigned int trampoline_open_tables_size =0;
#endif #endif
static unsigned int trampoline_open_tables_size =0;
//called by log_slow_statement and general audit event caught by audit interface //called by log_slow_statement and general audit event caught by audit interface