1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
|
diff -ruN a/client/client_priv.h b/client/client_priv.h
--- a/client/client_priv.h 2010-04-06 23:03:48.000000000 +0900
+++ b/client/client_priv.h 2010-04-30 19:37:42.000000000 +0900
@@ -68,6 +68,7 @@
OPT_MYSQL_LOCK_DIRECTORY,
OPT_USE_THREADS,
OPT_IMPORT_USE_THREADS,
+ OPT_IGNORE_CREATE_ERROR,
OPT_MYSQL_NUMBER_OF_QUERY,
OPT_IGNORE_TABLE,OPT_INSERT_IGNORE,OPT_SHOW_WARNINGS,OPT_DROP_DATABASE,
OPT_TZ_UTC, OPT_AUTO_CLOSE, OPT_CREATE_SLAP_SCHEMA,
diff -ruN a/client/mysqldump.c b/client/mysqldump.c
--- a/client/mysqldump.c 2010-04-06 23:03:49.000000000 +0900
+++ b/client/mysqldump.c 2010-04-30 19:41:20.000000000 +0900
@@ -98,7 +98,7 @@
opt_complete_insert= 0, opt_drop_database= 0,
opt_replace_into= 0,
opt_dump_triggers= 0, opt_routines=0, opt_tz_utc=1,
- opt_events= 0,
+ opt_events= 0, opt_ignore_show_create_table_error=0,
opt_alltspcs=0, opt_notspcs= 0;
static my_bool insert_pat_inited= 0, debug_info_flag= 0, debug_check_flag= 0;
static ulong opt_max_allowed_packet, opt_net_buffer_length;
@@ -326,6 +326,9 @@
{"insert-ignore", OPT_INSERT_IGNORE, "Insert rows with INSERT IGNORE.",
(uchar**) &opt_ignore, (uchar**) &opt_ignore, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
0, 0},
+ {"ignore-create-error", OPT_IGNORE_CREATE_ERROR, "Don't exit on show create table errors.",
+ (uchar**) &opt_ignore_show_create_table_error, (uchar**) &opt_ignore_show_create_table_error, 0, GET_BOOL,
+ NO_ARG, 0, 0, 0, 0, 0, 0},
{"lines-terminated-by", OPT_LTB,
"Lines in the output file are terminated by the given string.",
(uchar**) &lines_terminated, (uchar**) &lines_terminated, 0, GET_STR,
@@ -2303,13 +2306,21 @@
/* Make an sql-file, if path was given iow. option -T was given */
char buff[20+FN_REFLEN];
MYSQL_FIELD *field;
+
+ my_bool old_ignore_errors=ignore_errors;
+ //fprintf(stderr, "ignore create table %d\n", opt_ignore_show_create_table_error);
+ if (opt_ignore_show_create_table_error)
+ ignore_errors=1;
my_snprintf(buff, sizeof(buff), "show create table %s", result_table);
if (switch_character_set_results(mysql, "binary") ||
mysql_query_with_error_report(mysql, &result, buff) ||
switch_character_set_results(mysql, default_charset))
+ {
+ ignore_errors=old_ignore_errors;
DBUG_RETURN(0);
+ }
if (path)
{
|