From 42b358c9ca9041d7ad3cdc3f42347131ae3f50a5 Mon Sep 17 00:00:00 2001 From: baiyadong Date: Mon, 6 Jun 2022 16:55:43 +0800 Subject: [PATCH] Each slow log prints out the database name --- sql/log.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/log.cc b/sql/log.cc index 6f55a70c3074..cb415be414b1 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -878,7 +878,7 @@ bool File_query_log::write_slow(THD *thd, ulonglong current_utime, (ulong) thd->get_sent_row_count(), (ulong) thd->get_examined_row_count()) == (uint) -1) goto err; - if (thd->db().str && strcmp(thd->db().str, db)) + if (thd->db().str) { // Database changed if (my_b_printf(&log_file,"use %s;\n",thd->db().str) == (uint) -1) goto err;