diff options
author | unknown <cmiller@zippy.(none)> | 2006-06-20 17:17:04 -0400 |
---|---|---|
committer | unknown <cmiller@zippy.(none)> | 2006-06-20 17:17:04 -0400 |
commit | b1bee755a0b5538ed7bd64cf18e934c47cd1b192 (patch) | |
tree | e00305ac71067ad01c53c30eeb4904036cd3351a /client | |
parent | 0f6a24ad6c0c5caef0101c56ad1a6c2313d103d6 (diff) | |
parent | f77b80a8466bd3384b09bba90e96f396aa72598a (diff) | |
download | mariadb-git-b1bee755a0b5538ed7bd64cf18e934c47cd1b192.tar.gz |
Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into zippy.(none):/home/cmiller/work/mysql/mysql-5.0-maint
client/mysqldump.c:
Auto merged
BitKeeper/etc/ignore:
Added BitKeeper/etc/RESYNC_TREE to the ignore list
mysql-test/r/mysqldump.result:
Manual merge.
mysql-test/t/mysqldump.test:
Manual merge.
Diffstat (limited to 'client')
-rw-r--r-- | client/mysqldump.c | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/client/mysqldump.c b/client/mysqldump.c index e89e8064c9a..fbd8ae351b2 100644 --- a/client/mysqldump.c +++ b/client/mysqldump.c @@ -1503,9 +1503,15 @@ static uint get_table_structure(char *table, char *db, char *table_type, field= mysql_fetch_field_direct(result, 0); if (strcmp(field->name, "View") == 0) { + char *scv_buff = NULL; + if (verbose) fprintf(stderr, "-- It's a view, create dummy table for view\n"); + /* save "show create" statement for later */ + if ((row= mysql_fetch_row(result)) && (scv_buff=row[1])) + scv_buff= my_strdup(scv_buff, MYF(0)); + mysql_free_result(result); /* @@ -1523,9 +1529,22 @@ static uint get_table_structure(char *table, char *db, char *table_type, "SHOW FIELDS FROM %s", result_table); if (mysql_query_with_error_report(sock, 0, query_buff)) { + /* + View references invalid or privileged table/col/fun (err 1356), + so we cannot create a stand-in table. Be defensive and dump + a comment with the view's 'show create' statement. (Bug #17371) + */ + + if (mysql_errno(sock) == ER_VIEW_INVALID) + fprintf(sql_file, "\n-- failed on view %s: %s\n\n", result_table, scv_buff ? scv_buff : ""); + + my_free(scv_buff, MYF(MY_ALLOW_ZERO_PTR)); + safe_exit(EX_MYSQLERR); - DBUG_RETURN(0); + DBUG_RETURN(0); } + else + my_free(scv_buff, MYF(MY_ALLOW_ZERO_PTR)); if ((result= mysql_store_result(sock))) { |