MCPcopy Create free account
hub / github.com/Meituan-Dianping/SQLAdvisor / general_log_write

Method general_log_write

sql/log.cc:378–410  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

376
377
378bool LOGGER::general_log_write(THD *thd, enum enum_server_command command,
379 const char *query, uint query_length)
380{
381 bool error= FALSE;
382 Log_event_handler **current_handler= general_log_handler_list;
383 char user_host_buff[MAX_USER_HOST_SIZE + 1];
384 uint user_host_len= 0;
385 time_t current_time;
386
387 DBUG_ASSERT(thd);
388
389 lock_shared();
390 if (!opt_log)
391 {
392 unlock();
393 return 0;
394 }
395 user_host_len= make_user_name(thd, user_host_buff);
396
397 current_time= my_time(0);
398
399 while (*current_handler)
400 error|= (*current_handler++)->
401 log_general(thd, current_time, user_host_buff,
402 user_host_len, thd->thread_id,
403 command_name[(uint) command].str,
404 command_name[(uint) command].length,
405 query, query_length,
406 thd->variables.character_set_client) || error;
407 unlock();
408
409 return error;
410}
411
412bool LOGGER::general_log_print(THD *thd, enum enum_server_command command,
413 const char *format, va_list args)

Callers 1

general_log_writeFunction · 0.80

Calls 2

make_user_nameFunction · 0.85
my_timeFunction · 0.85

Tested by

no test coverage detected