| 1656 | |
| 1657 | |
| 1658 | static int log_table(const struct connection_info *cn, |
| 1659 | const struct mysql_event_table *event, const char *type) |
| 1660 | { |
| 1661 | size_t csize; |
| 1662 | char raw_message[MAX_AUDIT_PAYLOAD_LENGTH + TIMESTAMP_OUTPUT_LENGTH]; |
| 1663 | char *message = raw_message + TIMESTAMP_OUTPUT_LENGTH; |
| 1664 | time_t ctime; |
| 1665 | |
| 1666 | (void) time(&ctime); |
| 1667 | csize= log_header(message, MAX_AUDIT_PAYLOAD_LENGTH - 1, |
| 1668 | servhost, servhost_len, |
| 1669 | event->user, SAFE_STRLEN_UI(event->user), |
| 1670 | event->host, SAFE_STRLEN_UI(event->host), |
| 1671 | event->ip, SAFE_STRLEN_UI(event->ip), |
| 1672 | event->thread_id, event->port, cn->query_id, type); |
| 1673 | csize+= my_snprintf(message+csize, MAX_AUDIT_PAYLOAD_LENGTH - 1 - csize, ",%.*s,%.*s,", |
| 1674 | (int) event->database.length, event->database.str, |
| 1675 | (int) event->table.length, event->table.str); |
| 1676 | message[csize]= '\n'; |
| 1677 | return write_log_and_lock(message, csize + 1, ctime); |
| 1678 | } |
| 1679 | |
| 1680 | |
| 1681 | static int log_rename(const struct connection_info *cn, |
no test coverage detected