From e53cd200ab1dbd8f3be7e736fca77f1e568600ca Mon Sep 17 00:00:00 2001 From: Rahim Kanji Date: Fri, 16 Feb 2024 12:08:24 +0500 Subject: [PATCH] Code cleanup --- lib/MySQL_PreparedStatement.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/MySQL_PreparedStatement.cpp b/lib/MySQL_PreparedStatement.cpp index 5f7719492a..7435a69f9f 100644 --- a/lib/MySQL_PreparedStatement.cpp +++ b/lib/MySQL_PreparedStatement.cpp @@ -16,6 +16,8 @@ extern MySQL_STMT_Manager_v14 *GloMyStmt; //#endif +const int PS_GLOBAL_STATUS_FIELD_NUM = 9; + static uint64_t stmt_compute_hash(char *user, char *schema, char *query, unsigned int query_length) { @@ -1035,7 +1037,7 @@ class PS_global_stats { } char **get_row() { char buf[128]; - char **pta=(char **)malloc(sizeof(char *)*9); + char **pta=(char **)malloc(sizeof(char *)*PS_GLOBAL_STATUS_FIELD_NUM); sprintf(buf,"%lu",statement_id); pta[0]=strdup(buf); assert(schemaname); @@ -1061,7 +1063,7 @@ class PS_global_stats { } void free_row(char **pta) { int i; - for (i=0;i<9;i++) { + for (i=0;iadd_column_definition(SQLITE_TEXT,"stmt_id"); result->add_column_definition(SQLITE_TEXT,"schemaname");