#At file:///home/hf/work/mysql_common/37774/ based on revid:gshchepa@stripped
3270 Alexey Botchkov 2009-05-13
Bug#37774 main.events_bugs fails sporadically
get_lock() function can crash the system when used inside the event handler.
the interruptible_wait() function used in the implementation calls
thd->vio_is_connected() in some circumstances and this method leads to
crash when the thread doesn't have an real connection (thd->net.vio is NULL).
Fixed by checking that thd->net.vio isn't NULL.
per-file messages:
mysql-test/r/events_bugs.result
Bug#37774 main.events_bugs fails sporadically
test result fixed
some results changed since test was disabled
mysql-test/t/disabled.def
Bug#37774 main.events_bugs fails sporadically
test reenabled
sql/item_func.cc
Bug#37774 main.events_bugs fails sporadically
thd->vio_ok() is verified before thd->vio_is_connected() call
modified:
mysql-test/r/events_bugs.result
mysql-test/t/disabled.def
sql/item_func.cc
=== modified file 'mysql-test/r/events_bugs.result'
--- a/mysql-test/r/events_bugs.result 2009-03-11 21:22:33 +0000
+++ b/mysql-test/r/events_bugs.result 2009-05-13 08:42:27 +0000
@@ -434,9 +434,9 @@ CREATE EVENT e3 ON SCHEDULE EVERY 1 DAY
SELECT 1;
SELECT * FROM INFORMATION_SCHEMA.EVENTS ORDER BY event_name;
EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER TIME_ZONE EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD SQL_MODE STARTS ENDS STATUS ON_COMPLETION CREATED LAST_ALTERED LAST_EXECUTED EVENT_COMMENT ORIGINATOR CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
-NULL events_test e1 root@localhost +05:00 SQL SELECT 1 RECURRING NULL 1 DAY 2006-01-01 00:00:00 NULL ENABLED NOT PRESERVE 2005-12-31 23:58:59 2005-12-31 23:58:59 NULL 1 latin1 latin1_swedish_ci latin1_swedish_ci
-NULL events_test e2 root@localhost -05:00 SQL SELECT 1 RECURRING NULL 1 DAY 2006-01-01 00:00:00 NULL ENABLED NOT PRESERVE 2005-12-31 23:59:00 2005-12-31 23:59:00 NULL 1 latin1 latin1_swedish_ci latin1_swedish_ci
-NULL events_test e3 root@localhost +00:00 SQL SELECT 1 RECURRING NULL 1 DAY 2006-01-01 00:00:00 NULL ENABLED NOT PRESERVE 2005-12-31 23:59:01 2005-12-31 23:59:01 NULL 1 latin1 latin1_swedish_ci latin1_swedish_ci
+def events_test e1 root@localhost +05:00 SQL SELECT 1 RECURRING NULL 1 DAY 2006-01-01 00:00:00 NULL ENABLED NOT PRESERVE 2005-12-31 23:58:59 2005-12-31 23:58:59 NULL 1 latin1 latin1_swedish_ci latin1_swedish_ci
+def events_test e2 root@localhost -05:00 SQL SELECT 1 RECURRING NULL 1 DAY 2006-01-01 00:00:00 NULL ENABLED NOT PRESERVE 2005-12-31 23:59:00 2005-12-31 23:59:00 NULL 1 latin1 latin1_swedish_ci latin1_swedish_ci
+def events_test e3 root@localhost +00:00 SQL SELECT 1 RECURRING NULL 1 DAY 2006-01-01 00:00:00 NULL ENABLED NOT PRESERVE 2005-12-31 23:59:01 2005-12-31 23:59:01 NULL 1 latin1 latin1_swedish_ci latin1_swedish_ci
SHOW EVENTS;
Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation
events_test e1 root@localhost +05:00 RECURRING NULL 1 DAY 2006-01-01 00:00:00 NULL ENABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci
@@ -444,13 +444,13 @@ events_test e2 root@localhost -05:00 REC
events_test e3 root@localhost +00:00 RECURRING NULL 1 DAY 2006-01-01 00:00:00 NULL ENABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci
SHOW CREATE EVENT e1;
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
-e1 +05:00 CREATE EVENT `e1` ON SCHEDULE EVERY 1 DAY STARTS '2006-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO SELECT 1 latin1 latin1_swedish_ci latin1_swedish_ci
+e1 +05:00 CREATE DEFINER=`root`@`localhost` EVENT `e1` ON SCHEDULE EVERY 1 DAY STARTS '2006-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO SELECT 1 latin1 latin1_swedish_ci latin1_swedish_ci
SHOW CREATE EVENT e2;
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
-e2 -05:00 CREATE EVENT `e2` ON SCHEDULE EVERY 1 DAY STARTS '2006-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO SELECT 1 latin1 latin1_swedish_ci latin1_swedish_ci
+e2 -05:00 CREATE DEFINER=`root`@`localhost` EVENT `e2` ON SCHEDULE EVERY 1 DAY STARTS '2006-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO SELECT 1 latin1 latin1_swedish_ci latin1_swedish_ci
SHOW CREATE EVENT e3;
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
-e3 +00:00 CREATE EVENT `e3` ON SCHEDULE EVERY 1 DAY STARTS '2006-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO SELECT 1 latin1 latin1_swedish_ci latin1_swedish_ci
+e3 +00:00 CREATE DEFINER=`root`@`localhost` EVENT `e3` ON SCHEDULE EVERY 1 DAY STARTS '2006-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO SELECT 1 latin1 latin1_swedish_ci latin1_swedish_ci
The following should fail, and nothing should be altered.
ALTER EVENT e1 ON SCHEDULE EVERY 1 HOUR STARTS '1999-01-01 00:00:00'
ENDS '1999-01-02 00:00:00';
@@ -749,4 +749,4 @@ DROP EVENT ev1;
SET GLOBAL server_id = @old_server_id;
DROP DATABASE events_test;
SET GLOBAL event_scheduler = 'ON';
-SET @@global.concurrent_insert = @concurrent_insert;
+SET @@global.concurrent_insert= @concurrent_insert;
=== modified file 'mysql-test/t/disabled.def'
--- a/mysql-test/t/disabled.def 2009-04-07 14:22:01 +0000
+++ b/mysql-test/t/disabled.def 2009-05-13 08:42:27 +0000
@@ -10,7 +10,6 @@
#
##############################################################################
cast : Bug#35594 2008-03-27 main.cast fails on Windows2003-64
-events_bugs : Bug#37774 2008-10-08 alik
#innodb : Bug#43309 2009-03-27 hhunger
kill : Bug#37780 2008-12-03 HHunger need some changes to be robust enough for pushbuild.
innodb_bug39438 : BUG#42383 2009-01-28 lsoares "This fails in embedded and on windows. Note that this test is not run on windows and on embedded in PB for main trees currently"
=== modified file 'sql/item_func.cc'
--- a/sql/item_func.cc 2009-05-10 16:35:06 +0000
+++ b/sql/item_func.cc 2009-05-13 08:42:27 +0000
@@ -3540,7 +3540,7 @@ static int interruptible_wait(THD *thd,
if (error == ETIMEDOUT || error == ETIME)
{
/* Return error if timed out or connection is broken. */
- if (!timeout || !thd->vio_is_connected())
+ if (!timeout || (thd->vio_ok() && !thd->vio_is_connected()))
break;
}
} while (error && timeout);
Attachment: [text/bzr-bundle] bzr/holyfoot@mysql.com-20090513084227-k0rt5cvr0wndmx0b.bundle
Thread |
---|
• bzr commit into mysql-6.0-bugteam branch (holyfoot:3270) Bug#37774 | Alexey Botchkov | 13 May |