From 29169c6b47109852b37dc57ac0603e04af0cdaa4 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 14 Feb 2008 09:53:01 +0100 Subject: [PATCH 1/3] Fixes to try to handle valgrind warnings identical to those in BUG#24387, which is closed since long. sql/mysqld.cc: Moving my_thread_end() to before pthread_cond_broadcast() since it might cause other threads to start using resources that are about to be released, or tries to proceed assuming that the resources have already been released. --- sql/mysqld.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 08ecc025332..9c4e6f9e2a2 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -1869,9 +1869,9 @@ bool one_thread_per_connection_end(THD *thd, bool put_in_cache) /* It's safe to broadcast outside a lock (COND... is not deleted here) */ DBUG_PRINT("signal", ("Broadcasting COND_thread_count")); + my_thread_end(); (void) pthread_cond_broadcast(&COND_thread_count); - my_thread_end(); pthread_exit(0); DBUG_RETURN(0); // Impossible } From 58a79add8a0ad005300f45938da99c5ef93b3d50 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 14 Feb 2008 10:53:12 +0100 Subject: [PATCH 2/3] Fixing test rpl_events to not give false failures. mysql-test/suite/rpl/r/rpl_events.result: Result change. mysql-test/suite/rpl/t/rpl_events.test: Replacing table with varying contents with a fresh table to avoid test problems. The contents of the event is unimportant for this part of the test. --- mysql-test/suite/rpl/r/rpl_events.result | 4 +++- mysql-test/suite/rpl/t/rpl_events.test | 10 +++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/mysql-test/suite/rpl/r/rpl_events.result b/mysql-test/suite/rpl/r/rpl_events.result index 18fe72a9879..273004b0a43 100644 --- a/mysql-test/suite/rpl/r/rpl_events.result +++ b/mysql-test/suite/rpl/r/rpl_events.result @@ -195,9 +195,11 @@ test slave_terminate SLAVESIDE_DISABLED 2 DROP EVENT test.slave_terminate; "Cleanup" DROP TABLE t1; +CREATE TABLE t28953 (a INT); CREATE EVENT event1 ON SCHEDULE EVERY 1 YEAR DO BEGIN -select * from t1; +select * from t28953; END;| ALTER EVENT event1 RENAME TO event2; DROP EVENT event2; +DROP TABLE t28953; diff --git a/mysql-test/suite/rpl/t/rpl_events.test b/mysql-test/suite/rpl/t/rpl_events.test index 62ffead7dcb..2a9cf86fe55 100644 --- a/mysql-test/suite/rpl/t/rpl_events.test +++ b/mysql-test/suite/rpl/t/rpl_events.test @@ -28,10 +28,12 @@ set binlog_format=statement; connection master; +CREATE TABLE t28953 (a INT); + DELIMITER |; CREATE EVENT event1 ON SCHEDULE EVERY 1 YEAR DO BEGIN - select * from t1; + select * from t28953; END;| DELIMITER ;| @@ -45,3 +47,9 @@ DROP EVENT event2; sync_slave_with_master; +# Doing cleanup of the table referred to in the event to guarantee +# that there is no bad timing cauing it to try to access the table. + +connection master; +DROP TABLE t28953; +sync_slave_with_master; From 410e2d64d14fc2ea5193fc0111142aca182ed348 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 15 Feb 2008 10:24:13 +0100 Subject: [PATCH 3/3] Adding waits to events_scheduling to prevent the test from failing on heavily loaded systems. mysql-test/t/events_scheduling.test: Adding waits before statements since the scheduler is unpredictable on loaded systems and might be delayed. --- mysql-test/t/events_scheduling.test | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/mysql-test/t/events_scheduling.test b/mysql-test/t/events_scheduling.test index 4541ee1eb36..a5133166495 100644 --- a/mysql-test/t/events_scheduling.test +++ b/mysql-test/t/events_scheduling.test @@ -76,11 +76,22 @@ let $wait_condition=select count(*) = 0 from information_schema.events where event_name='event_4' and status='enabled'; --source include/wait_condition.inc -# check the data +# Wait for the events to fire and check the data afterwards +let $wait_condition=SELECT SUM(a) >= 4 FROM table_1; +source include/wait_condition.inc; SELECT IF(SUM(a) >= 4, 'OK', 'ERROR') FROM table_1; + +let $wait_condition=SELECT SUM(a) >= 5 FROM table_2; +source include/wait_condition.inc; SELECT IF(SUM(a) >= 5, 'OK', 'ERROR') FROM table_2; + +let $wait_condition=SELECT SUM(a) >= 1 FROM table_3; +source include/wait_condition.inc; SELECT IF(SUM(a) >= 1, 'OK', 'ERROR') FROM table_3; + +let $wait_condition=SELECT SUM(a) >= 1 FROM table_4; +source include/wait_condition.inc; SELECT IF(SUM(a) >= 1, 'OK', 'ERROR') FROM table_4; SELECT IF(TIME_TO_SEC(TIMEDIFF(ENDS,STARTS))=6, 'OK', 'ERROR')