@@ -711,8 +711,8 @@ static void make_slave_skip_errors_printable(void)
711711 DBUG_ASSERT (sizeof (slave_skip_error_names) > MIN_ROOM);
712712 DBUG_ASSERT (MAX_SLAVE_ERROR <= 999999 ); // 6 digits
713713
714- /* Make @@slave_skip_errors show the nice human-readable value. */
715- opt_slave_skip_errors= slave_skip_error_names ;
714+ /* we should not touch opt_slave_skip_errors here. we just build the printable string only. */
715+ ( void ) opt_slave_skip_errors ;
716716
717717 if (!use_slave_mask || bitmap_is_clear_all (&slave_error_mask))
718718 {
@@ -774,8 +774,15 @@ bool init_slave_skip_errors(const char* arg)
774774 if (!arg || !*arg) // No errors defined
775775 goto end;
776776
777- if (my_bitmap_init (&slave_error_mask,0 ,MAX_SLAVE_ERROR))
778- DBUG_RETURN (1 );
777+ if (!slave_error_mask.bitmap )
778+ {
779+ if (my_bitmap_init (&slave_error_mask, 0 , MAX_SLAVE_ERROR))
780+ DBUG_RETURN (1 );
781+ }
782+ else
783+ {
784+ bitmap_clear_all (&slave_error_mask);
785+ }
779786
780787 use_slave_mask= 1 ;
781788 for (;my_isspace (system_charset_info,*arg);++arg)
@@ -801,6 +808,43 @@ bool init_slave_skip_errors(const char* arg)
801808 DBUG_RETURN (0 );
802809}
803810
811+
812+ bool check_slave_skip_errors (sys_var *self, THD *thd, set_var *var)
813+ {
814+ return give_error_if_slave_running (0 );
815+ }
816+
817+
818+ bool update_slave_skip_errors (sys_var *self, THD *thd, enum_var_type type)
819+ {
820+ bool res= false ;
821+ mysql_mutex_unlock (&LOCK_global_system_variables);
822+ mysql_mutex_lock (&LOCK_active_mi);
823+
824+ if (active_mi->slave_running )
825+ {
826+ my_error (ER_SLAVE_MUST_STOP, MYF (0 ));
827+ res= true ;
828+ }
829+ else
830+ {
831+ if (use_slave_mask)
832+ my_bitmap_free (&slave_error_mask);
833+
834+ use_slave_mask= 0 ;
835+
836+ if (init_slave_skip_errors (opt_slave_skip_errors))
837+ {
838+ my_error (ER_WRONG_VALUE_FOR_VAR, MYF (0 ), " slave_skip_errors" , opt_slave_skip_errors);
839+ res= true ;
840+ }
841+ }
842+
843+ mysql_mutex_unlock (&LOCK_active_mi);
844+ mysql_mutex_lock (&LOCK_global_system_variables);
845+ return res;
846+ }
847+
804848/* *
805849 Make printable version if slave_transaction_retry_errors
806850 This is never empty as at least ER_LOCK_DEADLOCK and ER_LOCK_WAIT_TIMEOUT
0 commit comments