]>
Commit | Line | Data |
---|---|---|
b4e1fa2c AM |
1 | # name : mysql_dump_ignore_ct.patch |
2 | # introduced : 11 or before | |
3 | # maintainer : Yasufumi | |
4 | # | |
5 | #!!! notice !!! | |
6 | # Any small change to this file in the main branch | |
7 | # should be done or reviewed by the maintainer! | |
8 | diff -ruN a/client/client_priv.h b/client/client_priv.h | |
9 | --- a/client/client_priv.h 2010-11-03 07:01:14.000000000 +0900 | |
10 | +++ b/client/client_priv.h 2010-12-03 13:39:32.317046060 +0900 | |
adf0fb13 | 11 | @@ -58,6 +58,7 @@ |
b4e1fa2c AM |
12 | OPT_MYSQL_LOCK_DIRECTORY, |
13 | OPT_USE_THREADS, | |
14 | OPT_IMPORT_USE_THREADS, | |
15 | + OPT_IGNORE_CREATE_ERROR, | |
16 | OPT_MYSQL_NUMBER_OF_QUERY, | |
17 | OPT_IGNORE_TABLE,OPT_INSERT_IGNORE,OPT_SHOW_WARNINGS,OPT_DROP_DATABASE, | |
18 | OPT_TZ_UTC, OPT_CREATE_SLAP_SCHEMA, | |
adf0fb13 AM |
19 | --- mysql-5.5.9/client/mysqldump.c~ 2011-03-10 20:05:49.000000000 +0200 |
20 | +++ mysql-5.5.9/client/mysqldump.c 2011-03-10 20:19:55.962339580 +0200 | |
b4e1fa2c AM |
21 | @@ -101,7 +101,7 @@ |
22 | opt_dump_triggers= 0, opt_routines=0, opt_tz_utc=1, | |
23 | opt_slave_apply= 0, | |
24 | opt_include_master_host_port= 0, | |
543222d2 AM |
25 | - opt_events= 0, opt_comments_used= 0, |
26 | + opt_events= 0, opt_comments_used= 0, opt_ignore_show_create_table_error=0, | |
b4e1fa2c AM |
27 | opt_alltspcs=0, opt_notspcs= 0; |
28 | static my_bool insert_pat_inited= 0, debug_info_flag= 0, debug_check_flag= 0; | |
29 | static ulong opt_max_allowed_packet, opt_net_buffer_length; | |
d8778560 | 30 | @@ -350,6 +350,9 @@ |
b4e1fa2c AM |
31 | {"insert-ignore", OPT_INSERT_IGNORE, "Insert rows with INSERT IGNORE.", |
32 | &opt_ignore, &opt_ignore, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, | |
33 | 0, 0}, | |
34 | + {"ignore-create-error", OPT_IGNORE_CREATE_ERROR, "Don't exit on show create table errors.", | |
35 | + (uchar**) &opt_ignore_show_create_table_error, (uchar**) &opt_ignore_show_create_table_error, 0, GET_BOOL, | |
36 | + NO_ARG, 0, 0, 0, 0, 0, 0}, | |
37 | {"lines-terminated-by", OPT_LTB, | |
38 | "Lines in the output file are terminated by the given string.", | |
39 | &lines_terminated, &lines_terminated, 0, GET_STR, | |
adf0fb13 | 40 | @@ -2297,21 +2297,35 @@ |
b4e1fa2c AM |
41 | char buff[20+FN_REFLEN]; |
42 | MYSQL_FIELD *field; | |
adf0fb13 | 43 | |
b4e1fa2c AM |
44 | + my_bool old_ignore_errors=ignore_errors; |
45 | + //fprintf(stderr, "ignore create table %d\n", opt_ignore_show_create_table_error); | |
46 | + if (opt_ignore_show_create_table_error) | |
47 | + ignore_errors=1; | |
adf0fb13 | 48 | + |
59f56aa8 | 49 | my_snprintf(buff, sizeof(buff), "show create table %s", result_table); |
752085cb | 50 | |
adf0fb13 AM |
51 | if (opt_set_charset) /* Was forced to false if server is too old. */ |
52 | { | |
53 | if (switch_character_set_results(mysql, "binary") != 0) | |
54 | + { | |
55 | + ignore_errors=old_ignore_errors; | |
56 | DBUG_RETURN(0); | |
57 | + } | |
58 | } | |
59 | ||
60 | if (mysql_query_with_error_report(mysql, &result, buff) != 0) | |
61 | + { | |
62 | + ignore_errors=old_ignore_errors; | |
b4e1fa2c | 63 | DBUG_RETURN(0); |
adf0fb13 | 64 | + } |
752085cb | 65 | |
adf0fb13 | 66 | if (opt_set_charset) /* Was forced to false if server is too old. */ |
59f56aa8 | 67 | { |
adf0fb13 AM |
68 | if (switch_character_set_results(mysql, default_charset) != 0) |
69 | + { | |
70 | + ignore_errors=old_ignore_errors; | |
71 | DBUG_RETURN(0); | |
72 | + } | |
73 | } | |
74 | ||
75 | if (path) |