Skip to content

Commit 5129b73

Browse files
committed
fixup! 937c433
1 parent 937c433 commit 5129b73

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

plugin/server_audit/server_audit.cc

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1199,6 +1199,9 @@ static void change_connection(struct connection_info *cn,
11991199

12001200
static int write_log(const char *message, size_t len)
12011201
{
1202+
#if defined _WIN32 || !defined SUX_LOCK_GENERIC
1203+
DBUG_ASSERT(lock_operations.is_locked_or_waiting());
1204+
#endif
12021205
int result= 0;
12031206

12041207
if (output_type == OUTPUT_FILE)
@@ -1334,7 +1337,7 @@ static int log_proxy(const struct connection_info *cn,
13341337
cn->proxy_host_length, cn->proxy_host,
13351338
event->status);
13361339
message[csize]= '\n';
1337-
return write_log(message, csize + 1);
1340+
return write_log_and_lock(message, csize + 1);
13381341
}
13391342

13401343

@@ -1361,7 +1364,7 @@ static int log_connection(const struct connection_info *cn,
13611364
",%.*s,%.*s,%d", cn->db_length, cn->db, (int) obj_len, tls_obj,
13621365
event->status);
13631366
message[csize]= '\n';
1364-
return write_log(message, csize + 1);
1367+
return write_log_and_lock(message, csize + 1);
13651368
}
13661369

13671370

@@ -1386,7 +1389,7 @@ static int log_connection_event(const struct mysql_event_connection *event,
13861389
",%.*s,%.*s,%d", (int) event->database.length,event->database.str,
13871390
(int) obj_len, tls_obj, event->status);
13881391
message[csize]= '\n';
1389-
return write_log(message, csize + 1);
1392+
return write_log_and_lock(message, csize + 1);
13901393
}
13911394

13921395

@@ -1881,7 +1884,7 @@ static int log_table(const struct connection_info *cn,
18811884
(int) event->database.length, event->database.str,
18821885
(int) event->table.length, event->table.str);
18831886
message[csize]= '\n';
1884-
return write_log(message, csize + 1);
1887+
return write_log_and_lock(message, csize + 1);
18851888
}
18861889

18871890

@@ -1907,7 +1910,7 @@ static int log_rename(const struct connection_info *cn,
19071910
(int) event->new_database.length, event->new_database.str,
19081911
(int) event->new_table.length, event->new_table.str);
19091912
message[csize]= '\n';
1910-
return write_log(message, csize + 1);
1913+
return write_log_and_lock(message, csize + 1);
19111914
}
19121915

19131916

0 commit comments

Comments
 (0)