diff options
Diffstat (limited to 'sql/sql_table.cc')
-rw-r--r-- | sql/sql_table.cc | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/sql/sql_table.cc b/sql/sql_table.cc index a7443e1bd9b..e17432e0689 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -4444,8 +4444,8 @@ send_result_message: switch (result_code) { case HA_ADMIN_NOT_IMPLEMENTED: { - char buf[ERRMSGSIZE+20]; - uint length=my_snprintf(buf, ERRMSGSIZE, + char buf[MYSQL_ERRMSG_SIZE]; + uint length=my_snprintf(buf, sizeof(buf), ER(ER_CHECK_NOT_IMPLEMENTED), operator_name); protocol->store(STRING_WITH_LEN("note"), system_charset_info); protocol->store(buf, length, system_charset_info); @@ -4454,8 +4454,8 @@ send_result_message: case HA_ADMIN_NOT_BASE_TABLE: { - char buf[ERRMSGSIZE+20]; - uint length= my_snprintf(buf, ERRMSGSIZE, + char buf[MYSQL_ERRMSG_SIZE]; + uint length= my_snprintf(buf, sizeof(buf), ER(ER_BAD_TABLE_ERROR), table_name); protocol->store(STRING_WITH_LEN("note"), system_charset_info); protocol->store(buf, length, system_charset_info); @@ -4582,11 +4582,12 @@ send_result_message: case HA_ADMIN_NEEDS_UPGRADE: case HA_ADMIN_NEEDS_ALTER: { - char buf[ERRMSGSIZE]; + char buf[MYSQL_ERRMSG_SIZE]; uint length; protocol->store(STRING_WITH_LEN("error"), system_charset_info); - length=my_snprintf(buf, ERRMSGSIZE, ER(ER_TABLE_NEEDS_UPGRADE), table->table_name); + length=my_snprintf(buf, sizeof(buf), ER(ER_TABLE_NEEDS_UPGRADE), + table->table_name); protocol->store(buf, length, system_charset_info); fatal_error=1; break; @@ -4594,8 +4595,8 @@ send_result_message: default: // Probably HA_ADMIN_INTERNAL_ERROR { - char buf[ERRMSGSIZE+20]; - uint length=my_snprintf(buf, ERRMSGSIZE, + char buf[MYSQL_ERRMSG_SIZE]; + uint length=my_snprintf(buf, sizeof(buf), "Unknown - internal error %d during operation", result_code); protocol->store(STRING_WITH_LEN("error"), system_charset_info); |