Below is the list of changes that have just been committed into a local
5.0 repository of ram. When ram 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@stripped, 2007-07-05 13:09:56+05:00, ramil@stripped +3 -0
Fix for bug #29420: crash with show and purge binlogs
Problem: in case of failed 'show binlog events...' we don't inform that
the log is not in use anymore. That may confuse following 'purge logs...'
command as it takes into account logs in use.
Fix: always notify that the log is not in use anymore.
mysql-test/r/rpl_rotate_logs.result@stripped, 2007-07-05 13:09:54+05:00, ramil@stripped +8
-0
Fix for bug #29420: crash with show and purge binlogs
- test result.
mysql-test/t/rpl_rotate_logs.test@stripped, 2007-07-05 13:09:54+05:00, ramil@stripped +13
-1
Fix for bug #29420: crash with show and purge binlogs
- test case.
sql/sql_repl.cc@stripped, 2007-07-05 13:09:54+05:00, ramil@stripped +2 -4
Fix for bug #29420: crash with show and purge binlogs
- always zero thd->current_linfo at the end of the mysql_show_binlog_events().
diff -Nrup a/mysql-test/r/rpl_rotate_logs.result b/mysql-test/r/rpl_rotate_logs.result
--- a/mysql-test/r/rpl_rotate_logs.result 2007-05-21 14:33:57 +05:00
+++ b/mysql-test/r/rpl_rotate_logs.result 2007-07-05 13:09:54 +05:00
@@ -95,3 +95,11 @@ count(*)
100
unlock tables;
drop table if exists t1,t2,t3,t4;
+End of 4.1 tests
+show binlog events in 'non existing_binlog_file';
+ERROR HY000: Error when executing command SHOW BINLOG EVENTS: Could not find target log
+purge master logs before now();
+show binlog events in '';
+ERROR HY000: Error when executing command SHOW BINLOG EVENTS: Could not find target log
+purge master logs before now();
+End of 5.0 tests
diff -Nrup a/mysql-test/t/rpl_rotate_logs.test b/mysql-test/t/rpl_rotate_logs.test
--- a/mysql-test/t/rpl_rotate_logs.test 2007-06-07 22:18:00 +05:00
+++ b/mysql-test/t/rpl_rotate_logs.test 2007-07-05 13:09:54 +05:00
@@ -169,4 +169,16 @@ connection master;
drop table if exists t1,t2,t3,t4;
sync_slave_with_master;
-# End of 4.1 tests
+--echo End of 4.1 tests
+
+#
+# Bug #29420: crash with show and purge binlogs
+#
+--error 1220
+show binlog events in 'non existing_binlog_file';
+purge master logs before now();
+--error 1220
+show binlog events in '';
+purge master logs before now();
+
+--echo End of 5.0 tests
diff -Nrup a/sql/sql_repl.cc b/sql/sql_repl.cc
--- a/sql/sql_repl.cc 2007-05-24 23:51:35 +05:00
+++ b/sql/sql_repl.cc 2007-07-05 13:09:54 +05:00
@@ -1420,13 +1420,11 @@ err:
}
if (errmsg)
- {
my_error(ER_ERROR_WHEN_EXECUTING_COMMAND, MYF(0),
"SHOW BINLOG EVENTS", errmsg);
- DBUG_RETURN(TRUE);
- }
+ else
+ send_eof(thd);
- send_eof(thd);
pthread_mutex_lock(&LOCK_thread_count);
thd->current_linfo = 0;
pthread_mutex_unlock(&LOCK_thread_count);