From c96a53fc60269a36d02b0955396e8009cab60c0c Mon Sep 17 00:00:00 2001 From: hongdongjian Date: Mon, 3 Apr 2023 23:17:20 +0800 Subject: [PATCH] THD Attributes register m_db/m_examined_row_count/m_row_count_func/m_sent_row_count --- sql/server_component/mysql_thd_attributes_imp.cc | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/sql/server_component/mysql_thd_attributes_imp.cc b/sql/server_component/mysql_thd_attributes_imp.cc index 1146de32dc91..06733863ab95 100644 --- a/sql/server_component/mysql_thd_attributes_imp.cc +++ b/sql/server_component/mysql_thd_attributes_imp.cc @@ -50,6 +50,17 @@ DEFINE_BOOL_METHOD(mysql_thd_attributes_imp::get, *((bool *)inout_pvalue) = t->is_server_upgrade_thread(); } else if (!strcmp(name, "is_init_file_thread")) { *((bool *)inout_pvalue) = t->is_init_file_system_thread(); + } else if (!strcmp(name, "db")) { + if (t->db().str == nullptr) return true; + String *res = new String[1]; + res->copy(t->db().str, t->db().length, &my_charset_utf8mb3_bin); + *((my_h_string *)inout_pvalue) = (my_h_string)res; + } else if (!strcmp(name, "examined_row_count")) { + *((ulonglong *)inout_pvalue) = t->get_examined_row_count(); + } else if (!strcmp(name, "row_count_func")) { + *((longlong *)inout_pvalue) = t->get_row_count_func(); + } else if (!strcmp(name, "sent_row_count")) { + *((ulonglong *)inout_pvalue) = t->get_sent_row_count(); } else return true; /* invalid option */ }