diff options
author | Oleksandr Byelkin <sanja@mariadb.com> | 2023-04-01 14:42:05 +0200 |
---|---|---|
committer | Oleksandr Byelkin <sanja@mariadb.com> | 2023-04-01 17:29:54 +0200 |
commit | 1767390be4239c031ecbe999fa09bbc6c99c1c65 (patch) | |
tree | 096c500ddbf760772ca8e45afd87fad1f0e0f21b | |
parent | 3b6424407025aad39b00e60bd0d711b67272513f (diff) | |
download | mariadb-git-1767390be4239c031ecbe999fa09bbc6c99c1c65.tar.gz |
Fix passing correct length of string in command print.
-rw-r--r-- | sql/sql_select.cc | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/sql/sql_select.cc b/sql/sql_select.cc index c4fc2d19156..0651c1d58bd 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -27990,19 +27990,19 @@ enum explainable_cmd_type }; static -const char * const explainable_cmd_name []= +const LEX_CSTRING explainable_cmd_name []= { - "select ", - "insert ", - "replace ", - "update ", - "delete ", + {STRING_WITH_LEN("select ")}, + {STRING_WITH_LEN("insert ")}, + {STRING_WITH_LEN("replace ")}, + {STRING_WITH_LEN("update ")}, + {STRING_WITH_LEN("delete ")}, }; static -char const *get_explainable_cmd_name(enum explainable_cmd_type cmd) +const LEX_CSTRING* get_explainable_cmd_name(enum explainable_cmd_type cmd) { - return explainable_cmd_name[cmd]; + return explainable_cmd_name + cmd; } static @@ -28304,7 +28304,7 @@ void st_select_lex::print(THD *thd, String *str, enum_query_type query_type) query_type); } if (sel_type == UPDATE_CMD || sel_type == DELETE_CMD) - str->append(STRING_WITH_LEN(get_explainable_cmd_name(sel_type))); + str->append(get_explainable_cmd_name(sel_type)); if (sel_type == DELETE_CMD) { str->append(STRING_WITH_LEN(" from ")); |