List:Internals« Previous MessageNext Message »
From:Jim Winstead Date:February 12 2005 12:40am
Subject:bk commit into 4.0 tree (jimw:1.2056) BUG#7800
View as plain text  
Below is the list of changes that have just been committed into a local
4.0 repository of jimw. When jimw does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet
  1.2056 05/02/11 15:39:59 jimw@stripped +8 -0
  Add 'slave_compressed_protocol', 'slave_load_tmpdir', and
  'slave_skip_errors' to SHOW VARIABLES. (Bug #7800)

  mysql-test/r/variables.result
    1.26 05/02/11 15:37:20 jimw@stripped +9 -0
    Add new results

  mysql-test/t/variables-master.opt
    1.2 05/02/11 15:37:14 jimw@stripped +1 -0
    Add skip-slave-errors for test

  sql/set_var.cc
    1.66 05/02/11 15:29:31 jimw@stripped +1 -1
    Fix alphabetic order of slave options

  sql/set_var.cc
    1.65 05/02/11 15:26:47 jimw@stripped +2 -0
    Add slave_compressed_protocol to SHOW VARIABLES

  mysql-test/t/variables.test
    1.22 05/02/11 15:24:10 jimw@stripped +9 -0
    Add regression tests for 'slave_%' variables

  sql/structs.h
    1.28 05/02/11 15:04:42 jimw@stripped +1 -1
    Add SHOW_SLAVE_SKIP_ERRORS to enum

  sql/sql_show.cc
    1.128 05/02/11 15:03:39 jimw@stripped +29 -0
    Handle slave_skip_errors, OFF, ALL, or a list of numbers (which we truncate)

  sql/set_var.cc
    1.64 05/02/11 15:03:24 jimw@stripped +1 -0
    Add slave_skip_errors to list of variables to be output

  include/my_bitmap.h
    1.6 05/02/11 15:02:54 jimw@stripped +1 -0
    Add declaration for bitmap_is_set_all()

  mysys/my_bitmap.c
    1.12 05/02/11 15:02:27 jimw@stripped +13 -0
    Add bitmap_is_set_all() helper function

  sql/set_var.cc
    1.63 05/02/11 13:13:07 jimw@stripped +2 -1
    Add slave_load_tmpdir to 'SHOW VARIABLES' output, fix order of
    slave_net_timeout (l comes after k...)

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	jimw
# Host:	rama.(none)
# Root:	/home/jimw/my/mysql-4.0-7800

--- 1.127/sql/sql_show.cc	2004-09-25 09:40:47 -07:00
+++ 1.128/sql/sql_show.cc	2005-02-11 15:03:39 -08:00
@@ -1283,6 +1283,35 @@
 	net_store_data(&packet2,convert, value ? value : "");
 	break;
       }
+      case SHOW_SLAVE_SKIP_ERRORS:
+      {
+        MY_BITMAP *bitmap= (MY_BITMAP *)value;
+        if (!use_slave_mask)
+        {
+          net_store_data(&packet2, "OFF");
+        }
+        else if (bitmap_is_set_all(bitmap))
+        {
+          net_store_data(&packet2, "ALL");
+        }
+        else
+        {
+          char buf[1024], *pos;
+          pos=buf;
+          for (int i=1 ; i < MAX_SLAVE_ERROR; i++)
+          {
+            if (bitmap_is_set(bitmap, i))
+            {
+              pos+= my_snprintf(pos, sizeof(buf) - (pos - buf), "%d,", i);
+            }
+          }
+          if (pos != buf)
+            pos--;				// Remove last ','
+          *pos=0;
+          net_store_data(&packet2, buf);
+        }
+        break;
+      }
 #ifdef HAVE_OPENSSL
 	/* First group - functions relying on CTX */
       case SHOW_SSL_CTX_SESS_ACCEPT:

--- 1.27/sql/structs.h	2004-04-28 07:45:07 -07:00
+++ 1.28/sql/structs.h	2005-02-11 15:04:42 -08:00
@@ -145,7 +145,7 @@
   SHOW_SSL_CTX_SESS_TIMEOUTS, SHOW_SSL_CTX_SESS_CACHE_FULL,
   SHOW_SSL_GET_CIPHER_LIST,
 #endif /* HAVE_OPENSSL */
-  SHOW_RPL_STATUS, SHOW_SLAVE_RUNNING
+  SHOW_RPL_STATUS, SHOW_SLAVE_RUNNING, SHOW_SLAVE_SKIP_ERRORS
 };
 
 enum SHOW_COMP_OPTION { SHOW_OPTION_YES, SHOW_OPTION_NO, SHOW_OPTION_DISABLED};

--- 1.5/include/my_bitmap.h	2001-12-14 18:52:52 -08:00
+++ 1.6/include/my_bitmap.h	2005-02-11 15:02:54 -08:00
@@ -45,6 +45,7 @@
   extern void bitmap_set_bit(MY_BITMAP *bitmap, uint bitmap_bit);
   extern uint bitmap_set_next(MY_BITMAP *bitmap);
   extern void bitmap_set_all(MY_BITMAP* bitmap);
+  extern my_bool bitmap_is_set_all(MY_BITMAP* bitmap);
   extern my_bool bitmap_is_set(MY_BITMAP* bitmap, uint bitmap_bit);
   extern void bitmap_clear_all(MY_BITMAP* bitmap);
   extern void bitmap_clear_bit(MY_BITMAP *bitmap, uint bitmap_bit);

--- 1.11/mysys/my_bitmap.c	2002-01-02 11:31:48 -08:00
+++ 1.12/mysys/my_bitmap.c	2005-02-11 15:02:27 -08:00
@@ -129,6 +129,19 @@
   bitmap_unlock(map);
 }
 
+my_bool bitmap_is_set_all(MY_BITMAP* map)
+{
+  int i;
+  if (!map->bitmap_size)
+    return 0;
+  for (i = (map->bitmap_size+7) / 8; i > 0; i--)
+  {
+    if (~map->bitmap[i-1] & 0xff)
+      return 0;
+  }
+  return 1;
+}
+
 my_bool bitmap_is_set(MY_BITMAP* map, uint bitmap_bit)
 {
   return (bitmap_bit < map->bitmap_size) ?

--- 1.25/mysql-test/r/variables.result	2004-08-23 06:29:40 -07:00
+++ 1.26/mysql-test/r/variables.result	2005-02-11 15:37:20 -08:00
@@ -397,3 +397,12 @@
 show global variables like 'log_warnings';
 Variable_name	Value
 log_warnings	1
+show variables like 'slave_compressed_protocol';
+Variable_name	Value
+slave_compressed_protocol	OFF
+show variables like 'slave_load_tmpdir';
+Variable_name	Value
+slave_load_tmpdir	#
+show variables like 'slave_skip_errors';
+Variable_name	Value
+slave_skip_errors	3,100,137,643,1752

--- 1.21/mysql-test/t/variables.test	2004-08-23 06:29:40 -07:00
+++ 1.22/mysql-test/t/variables.test	2005-02-11 15:24:10 -08:00
@@ -286,3 +286,12 @@
 show global variables like 'log_warnings';
 set global log_warnings = @tstlw;
 show global variables like 'log_warnings';
+
+# BUG #7800: Add various-slave related variables to SHOW VARIABLES
+show variables like 'slave_compressed_protocol';
+# Can't check value, because it depends on where the test is run
+--replace_column 2 #
+show variables like 'slave_load_tmpdir';
+# We just set some arbitrary values in variables-master.opt so we can test
+# that a list of values works correctly
+show variables like 'slave_skip_errors';

--- 1.1/mysql-test/t/variables-master.opt	2002-07-23 08:31:19 -07:00
+++ 1.2/mysql-test/t/variables-master.opt	2005-02-11 15:37:14 -08:00
@@ -1 +1,2 @@
 max_join_size=10
+--slave-skip-errors=3,100,137,643,1752

--- 1.62/sql/set_var.cc	2005-01-25 06:27:06 -08:00
+++ 1.66/sql/set_var.cc	2005-02-11 15:29:31 -08:00
@@ -608,10 +608,14 @@
   {sys_read_rnd_buff_size.name,(char*) &sys_read_rnd_buff_size,	    SHOW_SYS},
   {sys_rpl_recovery_rank.name,(char*) &sys_rpl_recovery_rank,       SHOW_SYS},
   {sys_server_id.name,	      (char*) &sys_server_id,		    SHOW_SYS},
-  {sys_slave_net_timeout.name,(char*) &sys_slave_net_timeout,	    SHOW_SYS},
   {"skip_external_locking",   (char*) &my_disable_locking,          SHOW_MY_BOOL},
   {"skip_networking",         (char*) &opt_disable_networking,      SHOW_BOOL},
   {"skip_show_database",      (char*) &opt_skip_show_db,            SHOW_BOOL},
+  {sys_slave_compressed_protocol.name,
+    (char*) &sys_slave_compressed_protocol,           SHOW_SYS},
+  {"slave_load_tmpdir",       (char*) &slave_load_tmpdir,           SHOW_CHAR_PTR},
+  {sys_slave_net_timeout.name,(char*) &sys_slave_net_timeout,	    SHOW_SYS},
+  {"slave_skip_errors",       (char*) &slave_error_mask,           
SHOW_SLAVE_SKIP_ERRORS},
   {sys_slow_launch_time.name, (char*) &sys_slow_launch_time,        SHOW_SYS},
 #ifdef HAVE_SYS_UN_H
   {"socket",                  (char*) &mysql_unix_port,             SHOW_CHAR_PTR},
Thread
bk commit into 4.0 tree (jimw:1.2056) BUG#7800Jim Winstead12 Feb