List:Commits« Previous MessageNext Message »
From:Martin Zaun Date:March 30 2012 7:00am
Subject:bzr push into mysql-5.1-telco-7.0 branch (martin.zaun:4910 to 4911)
View as plain text  
 4911 Martin Zaun	2012-03-29 [merge]
      Bug54854 - merge from ndb-7.0-ddl-exist-errors to ndb-7.0

    modified:
      sql/mysqld.cc
      sql/slave.cc
      sql/slave.h
 4910 Frazer Clement	2012-03-29
      Fix funcs_1.is_columns_mysql testcase to reflect new ndb_binlog_index columns

    modified:
      mysql-test/suite/funcs_1/r/is_columns_mysql.result
=== modified file 'sql/mysqld.cc'
--- a/sql/mysqld.cc	2012-03-26 20:13:32 +0000
+++ b/sql/mysqld.cc	2012-03-30 05:19:18 +0000
@@ -8048,6 +8048,8 @@ mysqld_get_one_option(int optid,
   case OPT_SLAVE_SKIP_ERRORS:
 #ifndef MCP_BUG54854
     add_slave_skip_errors(argument);
+#else
+    init_slave_skip_errors(argument);
 #endif // MCP_BUG54854
     break;
   case OPT_SLAVE_EXEC_MODE:

=== modified file 'sql/slave.cc'
--- a/sql/slave.cc	2012-03-26 20:13:32 +0000
+++ b/sql/slave.cc	2012-03-30 05:19:18 +0000
@@ -131,6 +131,10 @@ static bool wait_for_relay_log_space(Rel
 static inline bool io_slave_killed(THD* thd,Master_info* mi);
 static inline bool sql_slave_killed(THD* thd,Relay_log_info* rli);
 static int init_slave_thread(THD* thd, SLAVE_THD_TYPE thd_type);
+#ifndef MCP_BUG54854
+#else
+static void print_slave_skip_errors(void);
+#endif // MCP_BUG54854
 static int safe_connect(THD* thd, MYSQL* mysql, Master_info* mi);
 static int safe_reconnect(THD* thd, MYSQL* mysql, Master_info* mi,
                           bool suppress_warnings);
@@ -234,6 +238,18 @@ int init_slave()
   */
   active_mi= new Master_info;
 
+#ifndef MCP_BUG54854
+#else
+  /*
+    If --slave-skip-errors=... was not used, the string value for the
+    system variable has not been set up yet. Do it now.
+  */
+  if (!use_slave_mask)
+  {
+    print_slave_skip_errors();
+  }
+#endif // MCP_BUG54854
+
   /*
     If master_host is not specified, try to read it from the master_info file.
     If master_host is specified, create the master_info file if it doesn't
@@ -285,6 +301,8 @@ err:
 
 #ifndef MCP_BUG54854
 void print_slave_skip_errors()
+#else
+static void print_slave_skip_errors(void)
 #endif // MCP_BUG54854
 {
   /*
@@ -356,9 +374,7 @@ static void init_slave_skip_errors()
   use_slave_mask = 1;
   DBUG_VOID_RETURN;
 }
-#endif // MCP_BUG54854
 
-#ifndef MCP_BUG54854
 static void add_slave_skip_errors(const uint* errors, uint n_errors)
 {
   DBUG_ENTER("add_slave_skip_errors");
@@ -373,9 +389,7 @@ static void add_slave_skip_errors(const 
   }
   DBUG_VOID_RETURN;
 }
-#endif // MCP_BUG54854
 
-#ifndef MCP_BUG54854
 /*
   Add errors that should be skipped for slave
 
@@ -386,7 +400,6 @@ static void add_slave_skip_errors(const 
   NOTES
     Called from get_options() in mysqld.cc on start-up
 */
-
 void add_slave_skip_errors(const char* arg)
 {
   const char *p= NULL;
@@ -450,6 +463,51 @@ void add_slave_skip_errors(const char* a
   }
   DBUG_VOID_RETURN;
 }
+#else
+/*
+  Init function to set up array for errors that should be skipped for slave
+
+  SYNOPSIS
+    init_slave_skip_errors()
+    arg         List of errors numbers to skip, separated with ','
+
+  NOTES
+    Called from get_options() in mysqld.cc on start-up
+*/
+
+void init_slave_skip_errors(const char* arg)
+{
+  const char *p;
+  DBUG_ENTER("init_slave_skip_errors");
+
+  if (bitmap_init(&slave_error_mask,0,MAX_SLAVE_ERROR,0))
+  {
+    fprintf(stderr, "Badly out of memory, please check your system status\n");
+    exit(1);
+  }
+  use_slave_mask = 1;
+  for (;my_isspace(system_charset_info,*arg);++arg)
+    /* empty */;
+  if (!my_strnncoll(system_charset_info,(uchar*)arg,4,(const uchar*)"all",4))
+  {
+    bitmap_set_all(&slave_error_mask);
+    print_slave_skip_errors();
+    DBUG_VOID_RETURN;
+  }
+  for (p= arg ; *p; )
+  {
+    long err_code;
+    if (!(p= str2int(p, 10, 0, LONG_MAX, &err_code)))
+      break;
+    if (err_code < MAX_SLAVE_ERROR)
+       bitmap_set_bit(&slave_error_mask,(uint)err_code);
+    while (!my_isdigit(system_charset_info,*p) && *p)
+      p++;
+  }
+  /* Convert slave skip errors bitmap into a printable string. */
+  print_slave_skip_errors();
+  DBUG_VOID_RETURN;
+}
 #endif // MCP_BUG54854
 
 static void set_thd_in_use_temporary_tables(Relay_log_info *rli)

=== modified file 'sql/slave.h'
--- a/sql/slave.h	2012-03-26 20:13:32 +0000
+++ b/sql/slave.h	2012-03-30 05:19:18 +0000
@@ -152,6 +152,8 @@ int init_slave();
 #ifndef MCP_BUG54854
 void add_slave_skip_errors(const char* arg);
 void print_slave_skip_errors();
+#else
+void init_slave_skip_errors(const char* arg);
 #endif // MCP_BUG54854
 bool flush_relay_log_info(Relay_log_info* rli);
 int register_slave_on_master(MYSQL* mysql);

No bundle (reason: useless for push emails).
Thread
bzr push into mysql-5.1-telco-7.0 branch (martin.zaun:4910 to 4911)Martin Zaun31 Mar