summaryrefslogtreecommitdiff
path: root/client/mysqlcheck.c
diff options
context:
space:
mode:
authorMonty <monty@mariadb.org>2017-04-17 20:41:27 +0300
committerMonty <monty@mariadb.org>2017-04-18 12:24:04 +0300
commita30c225e53022ba9633672b20a0212dcc9e05d7e (patch)
tree8e9d9f8a58488c36710d0c6f9a6780926862bcc1 /client/mysqlcheck.c
parenta05a610d60a6d177b66f9da97906efdb44336a6f (diff)
downloadmariadb-git-a30c225e53022ba9633672b20a0212dcc9e05d7e.tar.gz
Avoid DBUG_ASSERT in mysqlcheck when working with views
Remove some DBUG_ASSERT that can happen if mysqlcheck is called with a view as argument
Diffstat (limited to 'client/mysqlcheck.c')
-rw-r--r--client/mysqlcheck.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/client/mysqlcheck.c b/client/mysqlcheck.c
index c1ea002515b..b47b9c98510 100644
--- a/client/mysqlcheck.c
+++ b/client/mysqlcheck.c
@@ -581,6 +581,7 @@ static int process_selected_tables(char *db, char **table_names, int tables)
my_free(table_names_comma_sep);
}
else
+ {
for (; tables > 0; tables--, table_names++)
{
table= *table_names;
@@ -590,6 +591,7 @@ static int process_selected_tables(char *db, char **table_names, int tables)
continue;
handle_request_for_tables(table, table_len, view == 1, opt_all_in_1);
}
+ }
DBUG_RETURN(0);
} /* process_selected_tables */
@@ -909,16 +911,29 @@ static int handle_request_for_tables(char *tables, size_t length,
}
break;
case DO_ANALYZE:
+ if (view)
+ {
+ printf("%-50s %s\n", tables, "Can't run anaylyze on a view");
+ DBUG_RETURN(1);
+ }
DBUG_ASSERT(!view);
op= (opt_write_binlog) ? "ANALYZE" : "ANALYZE NO_WRITE_TO_BINLOG";
if (opt_persistent_all) end = strmov(end, " PERSISTENT FOR ALL");
break;
case DO_OPTIMIZE:
- DBUG_ASSERT(!view);
+ if (view)
+ {
+ printf("%-50s %s\n", tables, "Can't run optimize on a view");
+ DBUG_RETURN(1);
+ }
op= (opt_write_binlog) ? "OPTIMIZE" : "OPTIMIZE NO_WRITE_TO_BINLOG";
break;
case DO_FIX_NAMES:
- DBUG_ASSERT(!view);
+ if (view)
+ {
+ printf("%-50s %s\n", tables, "Can't run fix names on a view");
+ DBUG_RETURN(1);
+ }
DBUG_RETURN(fix_table_storage_name(tables));
}