1 # name : mysql_dump_ignore_ct.patch
2 # introduced : 11 or before
3 # maintainer : Yasufumi
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
12 OPT_MYSQL_LOCK_DIRECTORY,
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,
19 diff -ruN a/client/mysqldump.c b/client/mysqldump.c
20 --- a/client/mysqldump.c 2010-11-03 07:01:14.000000000 +0900
21 +++ b/client/mysqldump.c 2010-12-03 13:44:55.000069761 +0900
23 opt_dump_triggers= 0, opt_routines=0, opt_tz_utc=1,
25 opt_include_master_host_port= 0,
27 + opt_events= 0, opt_ignore_show_create_table_error=0,
28 opt_alltspcs=0, opt_notspcs= 0;
29 static my_bool insert_pat_inited= 0, debug_info_flag= 0, debug_check_flag= 0;
30 static ulong opt_max_allowed_packet, opt_net_buffer_length;
32 {"insert-ignore", OPT_INSERT_IGNORE, "Insert rows with INSERT IGNORE.",
33 &opt_ignore, &opt_ignore, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
35 + {"ignore-create-error", OPT_IGNORE_CREATE_ERROR, "Don't exit on show create table errors.",
36 + (uchar**) &opt_ignore_show_create_table_error, (uchar**) &opt_ignore_show_create_table_error, 0, GET_BOOL,
37 + NO_ARG, 0, 0, 0, 0, 0, 0},
38 {"lines-terminated-by", OPT_LTB,
39 "Lines in the output file are terminated by the given string.",
40 &lines_terminated, &lines_terminated, 0, GET_STR,
41 @@ -2308,13 +2311,21 @@
42 /* Make an sql-file, if path was given iow. option -T was given */
43 char buff[20+FN_REFLEN];
46 + my_bool old_ignore_errors=ignore_errors;
47 + //fprintf(stderr, "ignore create table %d\n", opt_ignore_show_create_table_error);
48 + if (opt_ignore_show_create_table_error)
51 my_snprintf(buff, sizeof(buff), "show create table %s", result_table);
53 if (switch_character_set_results(mysql, "binary") ||
54 mysql_query_with_error_report(mysql, &result, buff) ||
55 switch_character_set_results(mysql, default_charset))
57 + ignore_errors=old_ignore_errors;