summaryrefslogtreecommitdiff
path: root/sql/sql_table.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/sql_table.cc')
-rw-r--r--sql/sql_table.cc15
1 files changed, 10 insertions, 5 deletions
diff --git a/sql/sql_table.cc b/sql/sql_table.cc
index b57cd859f0f..79aa0b04335 100644
--- a/sql/sql_table.cc
+++ b/sql/sql_table.cc
@@ -66,8 +66,8 @@ static void set_tmp_file_path(char *buf, size_t bufsize, THD *thd);
uint build_table_path(char *buff, size_t bufflen, const char *db,
const char *table, const char *ext)
{
- strxnmov(buff, bufflen-1, mysql_data_home, "/", db, "/", table, ext,
- NullS);
+ strxnmov(buff, (uint) (bufflen - 1), mysql_data_home, "/", db, "/", table,
+ ext, NullS);
return unpack_filename(buff,buff);
}
@@ -2314,7 +2314,12 @@ static bool mysql_admin_table(THD* thd, TABLE_LIST* tables,
view_checksum(thd, table) == HA_ADMIN_WRONG_CHECKSUM)
push_warning(thd, MYSQL_ERROR::WARN_LEVEL_ERROR,
ER_VIEW_CHECKSUM, ER(ER_VIEW_CHECKSUM));
- result_code= HA_ADMIN_CORRUPT;
+ if (thd->net.last_errno == ER_NO_SUCH_TABLE)
+ /* A missing table is just issued as a failed command */
+ result_code= HA_ADMIN_FAILED;
+ else
+ /* Default failure code is corrupt table */
+ result_code= HA_ADMIN_CORRUPT;
goto send_result;
}
@@ -2537,7 +2542,7 @@ send_result_message:
case HA_ADMIN_WRONG_CHECKSUM:
{
protocol->store(STRING_WITH_LEN("note"), system_charset_info);
- protocol->store(ER(ER_VIEW_CHECKSUM), strlen(ER(ER_VIEW_CHECKSUM)),
+ protocol->store(ER(ER_VIEW_CHECKSUM), (uint) strlen(ER(ER_VIEW_CHECKSUM)),
system_charset_info);
break;
}
@@ -4443,7 +4448,7 @@ static bool check_engine(THD *thd, const char *table_name,
static void set_tmp_file_path(char *buf, size_t bufsize, THD *thd)
{
- char *p= strnmov(buf, mysql_tmpdir, bufsize);
+ char *p= strnmov(buf, mysql_tmpdir, (uint) bufsize);
my_snprintf(p, bufsize - (p - buf), "%s%lx_%lx_%x%s",
tmp_file_prefix, current_pid,
thd->thread_id, thd->tmp_table++, reg_ext);