| 376 | |
| 377 | |
| 378 | bool 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 | |
| 412 | bool LOGGER::general_log_print(THD *thd, enum enum_server_command command, |
| 413 | const char *format, va_list args) |
no test coverage detected