]> git.pld-linux.org Git - packages/mysql.git/blob - mysql_dump_ignore_ct.patch
small reorganize, move slave related options together
[packages/mysql.git] / mysql_dump_ignore_ct.patch
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
11 @@ -58,6 +58,7 @@
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,
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
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,
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;
30 @@ -350,6 +350,9 @@
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,
40 @@ -2297,21 +2297,35 @@
41        char buff[20+FN_REFLEN];
42        MYSQL_FIELD *field;
43  
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;
48 +
49        my_snprintf(buff, sizeof(buff), "show create table %s", result_table);
50  
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;
63          DBUG_RETURN(0);
64 +       }
65  
66        if (opt_set_charset)  /* Was forced to false if server is too old. */
67        {
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)
This page took 0.073821 seconds and 3 git commands to generate.