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

@ -383,24 +383,30 @@ static bool audit_open_tables(THD *thd, TABLE_LIST **start, uint *counter, uint
bool res; bool res;
res = trampoline_open_tables (thd, start, counter, flags, prelocking_strategy); res = trampoline_open_tables (thd, start, counter, flags, prelocking_strategy);
//only log if thread id or query id is non 0 (otherwise this is comming from startup activity)
if(Audit_formatter::thd_inst_thread_id(thd) || Audit_formatter::thd_inst_query_id(thd))
{
ThdSesData thd_data (thd); ThdSesData thd_data (thd);
audit(&thd_data); audit(&thd_data);
return res;
} }
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);
//only log if thread id or query id is non 0 (otherwise this is comming from startup activity)
if(Audit_formatter::thd_inst_thread_id(thd) || Audit_formatter::thd_inst_query_id(thd))
{
ThdSesData thd_data (thd); ThdSesData thd_data (thd);
audit(&thd_data); audit(&thd_data);
}
return res; 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