summaryrefslogtreecommitdiff
path: root/client/mysqldump.c
diff options
context:
space:
mode:
authorJim Winstead <jimw@mysql.com>2009-05-18 12:52:51 -0700
committerJim Winstead <jimw@mysql.com>2009-05-18 12:52:51 -0700
commit7117ee8ccc9e7bbac876871cb3bf31019a882b4c (patch)
treedfa5c820c3bad66d57bf8e8d0d571c2e9ac1700f /client/mysqldump.c
parent2a4e1220c8a382e4f7d15da714d465558b0de685 (diff)
downloadmariadb-git-7117ee8ccc9e7bbac876871cb3bf31019a882b4c.tar.gz
The output of mysqldump --tab for views included a DROP TABLE statement
without the IF EXISTS qualifier even though no temporary table is created as for all-in-one dumps including views. (Bug #37377)
Diffstat (limited to 'client/mysqldump.c')
-rw-r--r--client/mysqldump.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/client/mysqldump.c b/client/mysqldump.c
index efcb1820be4..87b78cb41e1 100644
--- a/client/mysqldump.c
+++ b/client/mysqldump.c
@@ -4802,7 +4802,8 @@ static my_bool get_view_structure(char *table, char* db)
result_table);
check_io(sql_file);
}
- fprintf(sql_file, "/*!50001 DROP TABLE %s*/;\n", opt_quoted_table);
+ /* Table might not exist if this view was dumped with --tab. */
+ fprintf(sql_file, "/*!50001 DROP TABLE IF EXISTS %s*/;\n", opt_quoted_table);
if (opt_drop)
{
fprintf(sql_file, "/*!50001 DROP VIEW IF EXISTS %s*/;\n",