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 --- 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
22 opt_dump_triggers= 0, opt_routines=0, opt_tz_utc=1,
24 opt_include_master_host_port= 0,
25 - opt_events= 0, opt_comments_used= 0,
26 + opt_events= 0, opt_comments_used= 0, opt_ignore_show_create_table_error=0,
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;
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,
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,
40 @@ -2297,21 +2297,35 @@
41 char buff[20+FN_REFLEN];
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)
49 my_snprintf(buff, sizeof(buff), "show create table %s", result_table);
51 if (opt_set_charset) /* Was forced to false if server is too old. */
53 if (switch_character_set_results(mysql, "binary") != 0)
55 + ignore_errors=old_ignore_errors;
60 if (mysql_query_with_error_report(mysql, &result, buff) != 0)
62 + ignore_errors=old_ignore_errors;
66 if (opt_set_charset) /* Was forced to false if server is too old. */
68 if (switch_character_set_results(mysql, default_charset) != 0)
70 + ignore_errors=old_ignore_errors;