List:Commits« Previous MessageNext Message »
From:ahristov Date:January 11 2006 6:31pm
Subject:bk commit into 5.1 tree (andrey:1.2035)
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of andrey. When andrey 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
  1.2035 06/01/11 19:31:21 andrey@lmy004. +4 -0
  WL #1034 
  - add a bit more debug messages
  - disable events.test for now due to a bug

  sql/event_executor.cc
    1.17 06/01/11 19:31:04 andrey@lmy004. +13 -5
    a bit more debug messages

  mysql-test/t/events.test
    1.5 06/01/11 19:31:04 andrey@lmy004. +7 -7
    disable show processlist

  mysql-test/t/disabled.def
    1.36 06/01/11 19:31:04 andrey@lmy004. +1 -0
    make it disabled

  mysql-test/r/events.result
    1.4 06/01/11 19:30:02 andrey@lmy004. +0 -29
    fix result

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	andrey
# Host:	lmy004.
# Root:	/work/mysql-5.1-tt-copy-works

--- 1.3/mysql-test/r/events.result	2006-01-11 18:06:26 +01:00
+++ 1.4/mysql-test/r/events.result	2006-01-11 19:30:02 +01:00
@@ -38,9 +38,6 @@
 select count(*) from mysql.event;
 count(*)
 1
-show processlist;
-Id	User	Host	db	Command	Time	State	Info
-1	root	localhost	events_test	Query	0	NULL	show processlist
 select release_lock("test_lock1");
 release_lock("test_lock1")
 1
@@ -56,11 +53,6 @@
 select sleep(2);
 sleep(2)
 0
-show processlist;
-Id	User	Host	db	Command	Time	State	Info
-1	root	localhost	events_test	Query	0	NULL	show processlist
-2	event_scheduler		NULL	Connect	1	Sleeping	NULL
-3	root		events_test	Connect	1	User lock	select get_lock("test_lock2", 20)
 select release_lock("test_lock2");
 release_lock("test_lock2")
 1
@@ -73,29 +65,16 @@
 select sleep(2);
 sleep(2)
 0
-show processlist;
-Id	User	Host	db	Command	Time	State	Info
-1	root	localhost	events_test	Query	0	NULL	show processlist
-2	event_scheduler		NULL	Connect	1	Sleeping	NULL
-4	root		events_test	Connect	1	User lock	select get_lock("test_lock2_1", 20)
 set global event_scheduler=0;
 select sleep(2);
 sleep(2)
 0
-show processlist;
-Id	User	Host	db	Command	Time	State	Info
-1	root	localhost	events_test	Query	0	NULL	show processlist
-2	event_scheduler		NULL	Connect	3	Sleeping	NULL
-4	root		events_test	Connect	3	User lock	select get_lock("test_lock2_1", 20)
 select release_lock("test_lock2_1");
 release_lock("test_lock2_1")
 1
 select sleep(2);
 sleep(2)
 0
-show processlist;
-Id	User	Host	db	Command	Time	State	Info
-1	root	localhost	events_test	Query	0	NULL	show processlist
 drop event закачка21;
 set global event_scheduler=1;
 select get_lock("test_lock3", 20);
@@ -105,11 +84,6 @@
 select sleep(2);
 sleep(2)
 0
-show processlist;
-Id	User	Host	db	Command	Time	State	Info
-1	root	localhost	events_test	Query	0	NULL	show processlist
-5	event_scheduler		NULL	Connect	2	Sleeping	NULL
-6	root		events_test	Connect	2	User lock	select get_lock("test_lock3", 20)
 drop event закачка;
 select release_lock("test_lock3");
 release_lock("test_lock3")
@@ -118,7 +92,4 @@
 select sleep(2);
 sleep(2)
 0
-show processlist;
-Id	User	Host	db	Command	Time	State	Info
-1	root	localhost	events_test	Query	0	NULL	show processlist
 drop database events_test;

--- 1.4/mysql-test/t/events.test	2006-01-11 18:08:53 +01:00
+++ 1.5/mysql-test/t/events.test	2006-01-11 19:31:04 +01:00
@@ -33,7 +33,7 @@
 select get_lock("test_lock1", 20);
 create event закачка on schedule every 10 hour do select get_lock("test_lock1", 20);
 select count(*) from mysql.event;
-show processlist;
+#show processlist;
 select release_lock("test_lock1");
 drop event закачка;
 select count(*) from mysql.event;
@@ -42,7 +42,7 @@
 select get_lock("test_lock2", 20);
 create event закачка on schedule every 10 hour do select get_lock("test_lock2", 20);
 select sleep(2);
-show processlist;
+#show processlist;
 select release_lock("test_lock2");
 drop event закачка;
 
@@ -58,20 +58,20 @@
 select get_lock("test_lock2_1", 20);
 create event закачка21 on schedule every 10 hour do select get_lock("test_lock2_1", 20);
 select sleep(2);
-show processlist;
+#show processlist;
 set global event_scheduler=0;
 select sleep(2);
-show processlist;
+#show processlist;
 select release_lock("test_lock2_1");
 select sleep(2);
-show processlist;
+#show processlist;
 drop event закачка21;
 
 set global event_scheduler=1;
 select get_lock("test_lock3", 20);
 create event закачка on schedule every 10 hour do select get_lock("test_lock3", 20);
 select sleep(2);
-show processlist;
+#show processlist;
 drop event закачка;
 select release_lock("test_lock3");
 
@@ -87,7 +87,7 @@
 
 set global event_scheduler=0;
 select sleep(2);
-show processlist;
+#show processlist;
 #the following locks for some reason and is a bug, commented for now
 #select count(*) from mysql.event;
 

--- 1.16/sql/event_executor.cc	2006-01-11 18:08:53 +01:00
+++ 1.17/sql/event_executor.cc	2006-01-11 19:31:04 +01:00
@@ -264,7 +264,7 @@
       et= evex_queue_first_element(&EVEX_EQ_NAME, event_timed*);
       if (et->status == MYSQL_EVENT_DISABLED)
       {
-        DBUG_PRINT("evex_load_events_from_db",("Now it is disabled-exec no more"));
+        DBUG_PRINT("evex main thread",("Now it is disabled-exec no more"));
         if (et->dropped)
           et->drop(thd);
         delete et;
@@ -274,10 +274,13 @@
         continue;    
       }
         
+      DBUG_PRINT("evex main thread",("computing time to sleep till next exec"));
       time(&now);
       my_tz_UTC->gmt_sec_to_TIME(&time_now, now);
       t2sleep= evex_time_diff(&et->execute_at, &time_now);
       VOID(pthread_mutex_unlock(&LOCK_event_arrays));
+
+      DBUG_PRINT("evex main thread",("unlocked LOCK_event_arrays"));
       if (t2sleep > 0)
       {
         /*
@@ -287,7 +290,10 @@
         while (t2sleep-- && !thd->killed && event_executor_running_global_var &&
                evex_queue_num_elements(EVEX_EQ_NAME) &&
                (evex_queue_first_element(&EVEX_EQ_NAME, event_timed*) == et))
+        {
+          DBUG_PRINT("evex main thread",("will sleep a bit more"));
           my_sleep(1000000);
+        }
       }
       if (!event_executor_running_global_var)
       {
@@ -302,25 +308,26 @@
     if (!evex_queue_num_elements(EVEX_EQ_NAME))
     {
       VOID(pthread_mutex_unlock(&LOCK_event_arrays));
+      DBUG_PRINT("evex main thread",("empty queue"));
       continue;
     }
     et= evex_queue_first_element(&EVEX_EQ_NAME, event_timed*);
+    DBUG_PRINT("evex main thread",("got event from the queue"));
       
-    /*
-      if this is the first event which is after time_now then no
-      more need to iterate over more elements since the array is sorted.
-    */ 
     if (et->execute_at.year > 1969 &&
         my_time_compare(&time_now, &et->execute_at) == -1)
     {
+      DBUG_PRINT("evex main thread",("still not the time for execution"));
       VOID(pthread_mutex_unlock(&LOCK_event_arrays));
       continue;
     } 
       
+    DBUG_PRINT("evex main thread",("it's right time"));
     if (et->status == MYSQL_EVENT_ENABLED)
     {
       pthread_t th;
 
+      DBUG_PRINT("evex main thread",("mark_last_executed"));
       et->mark_last_executed();
       et->compute_next_execution_time();
       et->update_fields(thd);
@@ -343,6 +350,7 @@
       else
         evex_queue_first_updated(&EVEX_EQ_NAME);
     }
+    DBUG_PRINT("evex main thread",("unlocking"));
     VOID(pthread_mutex_unlock(&LOCK_event_arrays));
   }// while
 

--- 1.35/mysql-test/t/disabled.def	2006-01-10 21:23:20 +01:00
+++ 1.36/mysql-test/t/disabled.def	2006-01-11 19:31:04 +01:00
@@ -22,3 +22,4 @@
 #ps_7ndb         : Bug#15923 Core dump in RBR mode when executing test suite
 rpl_ddl         : Bug#15963 SBR does not show "Definer" correctly
 mysqlslap       : Bug#16167
+events          : Affects flush test case. A table lock not released somewhere
Thread
bk commit into 5.1 tree (andrey:1.2035)ahristov11 Jan