#At file:///misc/mysql/forest/43835/51-43835/ based on revid:timothy.smith@stripped
2853 Tatiana A. Nurnberg 2009-04-06
Bug#43835: SHOW VARIABLES does not include 0 for slave_skip_errors
We didn't expect "error: no error", although this is
in fact a legitimate state (if something is erroneous
on the master, but not on the slave, e.g. INSERT fails
on master due to UNIQUE constraint which does not exist
on slave).
We now list the ignore for "0: no error" the same way
as any other ignore; moreover, if no or an empty
--slave-skip-errors is passed at start-up, we show
"OFF" instead of empty list, as intended. (The code
for that was there, but was only run for the empty-
argument case, even if it subsequently tested for
both conditions.)
@ mysql-test/r/not_embedded_server.result
Show that passing no --slave-skip-errors results
in "OFF" being shown as the variable's value. This
test's "twin" (also not embedded, but setting
--slave-skip-errors in its -opt file) lives in
variables-notembbeded.test.
@ mysql-test/r/variables-notembedded.result
Show that error-ignore 0 is handled just like any other
ignore. This test's "twin" (also not embedded, but not
setting --slave-skip-errors in its -opt file) lives in
not_embbeded_server.test.
@ mysql-test/t/not_embedded_server.test
Show that passing no --slave-skip-errors results
in "OFF" being shown as the variable's value.
@ mysql-test/t/variables-notembedded-master.opt
Show that error-ignore 0 is handled just like any other
ignore.
@ sql/slave.cc
- set up error-ignore-info even if --slave-skip-errors
was not passed at start-up.
- handle error 0 just like any other error.
modified:
mysql-test/r/not_embedded_server.result
mysql-test/r/variables-notembedded.result
mysql-test/t/not_embedded_server.test
mysql-test/t/variables-notembedded-master.opt
sql/slave.cc
=== modified file 'mysql-test/r/not_embedded_server.result'
--- a/mysql-test/r/not_embedded_server.result 2009-02-01 00:04:57 +0000
+++ b/mysql-test/r/not_embedded_server.result 2009-04-06 11:42:33 +0000
@@ -1,3 +1,6 @@
select 1;
1
1
+SHOW VARIABLES like 'slave_skip_errors';
+Variable_name Value
+slave_skip_errors OFF
=== modified file 'mysql-test/r/variables-notembedded.result'
--- a/mysql-test/r/variables-notembedded.result 2008-12-13 19:42:12 +0000
+++ b/mysql-test/r/variables-notembedded.result 2009-04-06 11:42:33 +0000
@@ -11,7 +11,7 @@ Variable_name Value
slave_load_tmpdir SLAVE_LOAD_TMPDIR
show variables like 'slave_skip_errors';
Variable_name Value
-slave_skip_errors 3,100,137,643,1752
+slave_skip_errors 0,3,100,137,643,1752
---- Clean Up ----
set global slave_net_timeout=default;
set global sql_slave_skip_counter= 0;
@@ -98,12 +98,12 @@ ERROR HY000: Variable 'slave_load_tmpdir
#
SHOW VARIABLES like 'slave_skip_errors';
Variable_name Value
-slave_skip_errors 3,100,137,643,1752
+slave_skip_errors 0,3,100,137,643,1752
SELECT @@session.slave_skip_errors;
ERROR HY000: Variable 'slave_skip_errors' is a GLOBAL variable
SELECT @@global.slave_skip_errors;
@@global.slave_skip_errors
-3,100,137,643,1752
+0,3,100,137,643,1752
SET @@session.slave_skip_errors= 7;
ERROR HY000: Variable 'slave_skip_errors' is a read only variable
SET @@global.slave_skip_errors= 7;
=== modified file 'mysql-test/t/not_embedded_server.test'
--- a/mysql-test/t/not_embedded_server.test 2009-02-01 00:04:57 +0000
+++ b/mysql-test/t/not_embedded_server.test 2009-04-06 11:42:33 +0000
@@ -36,4 +36,10 @@ select 1;
#execute stmt1;
#deallocate prepare stmt1;
+#
+# Bug#43835: SHOW VARIABLES does not include 0 for slave_skip_errors
+#
+
+SHOW VARIABLES like 'slave_skip_errors';
+
# End of 5.1 tests
=== modified file 'mysql-test/t/variables-notembedded-master.opt'
--- a/mysql-test/t/variables-notembedded-master.opt 2008-02-15 12:54:04 +0000
+++ b/mysql-test/t/variables-notembedded-master.opt 2009-04-06 11:42:33 +0000
@@ -1 +1 @@
---loose-slave-skip-errors=3,100,137,643,1752
+--loose-slave-skip-errors=3,100,137,0,643,1752
=== modified file 'sql/slave.cc'
--- a/sql/slave.cc 2009-03-22 19:46:57 +0000
+++ b/sql/slave.cc 2009-04-06 11:42:33 +0000
@@ -128,6 +128,7 @@ 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);
+static void print_slave_skip_errors(void);
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);
@@ -232,6 +233,15 @@ int init_slave()
active_mi= new Master_info;
/*
+ 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();
+ }
+
+ /*
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
exists.
@@ -311,7 +321,7 @@ static void print_slave_skip_errors(void
char *bend= buff + sizeof(slave_skip_error_names);
int errnum;
- for (errnum= 1; errnum < MAX_SLAVE_ERROR; errnum++)
+ for (errnum= 0; errnum < MAX_SLAVE_ERROR; errnum++)
{
if (bitmap_is_set(&slave_error_mask, errnum))
{
Attachment: [text/bzr-bundle] bzr/azundris@mysql.com-20090406114233-fb2wh41hesy61woh.bundle
Thread |
---|
• bzr commit into mysql-5.1-bugteam branch (azundris:2853) Bug#43835 | Tatiana A. Nurnberg | 6 Apr |