List:Commits« Previous MessageNext Message »
From:ahristov Date:February 16 2006 12:11pm
Subject:bk commit into 5.1 tree (andrey:1.2117)
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.2117 06/02/16 13:11:16 andrey@lmy004. +4 -0
  fix bug in show events which shows
  | INTERVAL_VALUE | INTERVAL_FIELD |
  | 20             | 20 MINUTE      |
  the second one should be without the value

  sql/sql_show.cc
    1.306 06/02/16 13:11:06 andrey@lmy004. +7 -4
    fix bug in show events which shows
    | INTERVAL_VALUE | INTERVAL_FIELD |
    | 20             | 20 MINUTE      |
    the second one should be without the value

  sql/event_timed.cc
    1.33 06/02/16 13:11:06 andrey@lmy004. +4 -0
    manually append the name of the interval because it's no more appended
    by reconstruct_value

  sql/event.cc
    1.30 06/02/16 13:11:06 andrey@lmy004. +4 -6
    fix bug in show events which shows
    | INTERVAL_VALUE | INTERVAL_FIELD |
    | 20             | 20 MINUTE      |
    the second one should be without the value

  mysql-test/r/events.result
    1.21 06/02/16 13:11:06 andrey@lmy004. +24 -23
    update test result to be as they should be

# 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-bug16406

--- 1.305/sql/sql_show.cc	2006-02-14 16:27:35 +01:00
+++ 1.306/sql/sql_show.cc	2006-02-16 13:11:06 +01:00
@@ -3807,6 +3807,7 @@ static interval_type get_real_interval_t
   return INTERVAL_SECOND;
 }
 
+extern LEX_STRING interval_type_to_name[];
 
 static int
 fill_events_copy_to_schema_table(THD *thd, TABLE *sch_table, TABLE *event_table)
@@ -3845,14 +3846,16 @@ fill_events_copy_to_schema_table(THD *th
     //execute_at
     sch_table->field[6]->set_null();
     //interval_value
-    sch_table->field[7]->set_notnull();
-    sch_table->field[7]->store((longlong) et.expression);
     //interval_type
     if (event_reconstruct_interval_expression(&show_str, et.interval,
                                               et.expression))
       DBUG_RETURN(1);
+    sch_table->field[7]->set_notnull();
+    sch_table->field[7]->store(show_str.c_ptr(), show_str.length(), scs);
+
+    LEX_STRING *ival= &interval_type_to_name[et.interval];
     sch_table->field[8]->set_notnull();
-    sch_table->field[8]->store(show_str.c_ptr(), show_str.length(), scs);
+    sch_table->field[8]->store(ival->str, ival->length, scs);
     //starts & ends
     sch_table->field[10]->set_notnull();
     sch_table->field[10]->store_time(&et.starts, MYSQL_TIMESTAMP_DATETIME);
@@ -4679,7 +4682,7 @@ ST_FIELD_INFO events_fields_info[]=
   {"EVENT_BODY", 65535, MYSQL_TYPE_STRING, 0, 0, 0},
   {"EVENT_TYPE", 9, MYSQL_TYPE_STRING, 0, 0, "Type"},
   {"EXECUTE_AT", 0, MYSQL_TYPE_TIMESTAMP, 0, 1, "Execute at"},
-  {"INTERVAL_VALUE", 11, MYSQL_TYPE_LONG, 0, 1, "Interval value"},
+  {"INTERVAL_VALUE", 256, MYSQL_TYPE_STRING, 0, 1, "Interval value"},
   {"INTERVAL_FIELD", 18, MYSQL_TYPE_STRING, 0, 1, "Interval field"},
   {"SQL_MODE", 65535, MYSQL_TYPE_STRING, 0, 1, 0},
   {"STARTS", 0, MYSQL_TYPE_TIMESTAMP, 0, 1, "Starts"},

--- 1.20/mysql-test/r/events.result	2006-02-16 05:20:54 +01:00
+++ 1.21/mysql-test/r/events.result	2006-02-16 13:11:06 +01:00
@@ -171,7 +171,7 @@ set names latin1;
 CREATE EVENT intact_check ON SCHEDULE EVERY 10 HOUR DO SELECT "nothing";
 SHOW EVENTS;
 Db	Name	Definer	Type	Execute at	Interval value	Interval field	Starts	Ends	Status
-events_test	intact_check	root@localhost	RECURRING	NULL	10	10 HOUR	#	#	ENABLED
+events_test	intact_check	root@localhost	RECURRING	NULL	10	HOUR	#	#	ENABLED
 ALTER TABLE mysql.event ADD dummy INT FIRST;
 SHOW EVENTS;
 ERROR HY000: Column count of mysql.event is wrong. Expected 16, found 17. Table probably corrupted
@@ -181,7 +181,7 @@ ERROR HY000: Column count of mysql.event
 ALTER TABLE mysql.event DROP dummy2;
 SHOW EVENTS;
 Db	Name	Definer	Type	Execute at	Interval value	Interval field	Starts	Ends	Status
-events_test	intact_check	root@localhost	RECURRING	NULL	10	10 HOUR	#	#	ENABLED
+events_test	intact_check	root@localhost	RECURRING	NULL	10	HOUR	#	#	ENABLED
 CREATE TABLE event_like LIKE mysql.event;
 INSERT INTO event_like SELECT * FROM mysql.event;
 ALTER TABLE mysql.event MODIFY db char(20) character set utf8 collate utf8_bin default '';
@@ -212,7 +212,7 @@ ALTER TABLE mysql.event MODIFY db char(6
 "This should work"
 SHOW EVENTS;
 Db	Name	Definer	Type	Execute at	Interval value	Interval field	Starts	Ends	Status
-events_test	intact_check	root@localhost	RECURRING	NULL	10	10 HOUR	#	#	ENABLED
+events_test	intact_check	root@localhost	RECURRING	NULL	10	HOUR	#	#	ENABLED
 ALTER TABLE mysql.event MODIFY db char(64) character set cp1251 default '';
 SELECT event_name FROM INFORMATION_SCHEMA.EVENTS;
 ERROR HY000: Cannot load from mysql.event. Table probably corrupted. See error log.
@@ -228,15 +228,15 @@ INSERT INTO  mysql.event SELECT * FROM e
 DROP TABLE event_like;
 SHOW EVENTS;
 Db	Name	Definer	Type	Execute at	Interval value	Interval field	Starts	Ends	Status
-events_test	intact_check	root@localhost	RECURRING	NULL	10	10 HOUR	#	#	ENABLED
+events_test	intact_check	root@localhost	RECURRING	NULL	10	HOUR	#	#	ENABLED
 DROP EVENT intact_check;
 create event one_event on schedule every 10 second do select 123;
 SHOW EVENTS;
 Db	Name	Definer	Type	Execute at	Interval value	Interval field	Starts	Ends	Status
-events_test	one_event	root@localhost	RECURRING	NULL	10	10 SECOND	#	#	ENABLED
+events_test	one_event	root@localhost	RECURRING	NULL	10	SECOND	#	#	ENABLED
 SELECT EVENT_CATALOG, EVENT_SCHEMA, EVENT_NAME, DEFINER, EVENT_BODY, EVENT_TYPE, EXECUTE_AT, INTERVAL_VALUE, INTERVAL_FIELD, STATUS,ON_COMPLETION, EVENT_COMMENT from information_schema.events;
 EVENT_CATALOG	EVENT_SCHEMA	EVENT_NAME	DEFINER	EVENT_BODY	EVENT_TYPE	EXECUTE_AT	INTERVAL_VALUE	INTERVAL_FIELD	STATUS	ON_COMPLETION	EVENT_COMMENT
-NULL	events_test	one_event	root@localhost	select 123	RECURRING	NULL	10	10 SECOND	ENABLED	NOT PRESERVE	
+NULL	events_test	one_event	root@localhost	select 123	RECURRING	NULL	10	SECOND	ENABLED	NOT PRESERVE	
 CREATE DATABASE events_test2;
 CREATE USER ev_test@localhost;
 GRANT ALL ON events_test.* to ev_test@localhost;
@@ -270,20 +270,20 @@ create event three_event on schedule eve
 "Now we should see 3 events:";
 SHOW EVENTS;
 Db	Name	Definer	Type	Execute at	Interval value	Interval field	Starts	Ends	Status
-events_test	one_event	ev_test@localhost	RECURRING	NULL	20	20 SECOND	#	#	ENABLED
-events_test	three_event	ev_test@localhost	RECURRING	NULL	20	20 SECOND	#	#	ENABLED
-events_test	two_event	ev_test@localhost	RECURRING	NULL	20	20 SECOND	#	#	ENABLED
+events_test	one_event	ev_test@localhost	RECURRING	NULL	20	SECOND	#	#	ENABLED
+events_test	three_event	ev_test@localhost	RECURRING	NULL	20	SECOND	#	#	ENABLED
+events_test	two_event	ev_test@localhost	RECURRING	NULL	20	SECOND	#	#	ENABLED
 "This should show us only 3 events:";
 SHOW FULL EVENTS;
 Db	Name	Definer	Type	Execute at	Interval value	Interval field	Starts	Ends	Status
-events_test	one_event	ev_test@localhost	RECURRING	NULL	20	20 SECOND	#	#	ENABLED
-events_test	three_event	ev_test@localhost	RECURRING	NULL	20	20 SECOND	#	#	ENABLED
-events_test	two_event	ev_test@localhost	RECURRING	NULL	20	20 SECOND	#	#	ENABLED
+events_test	one_event	ev_test@localhost	RECURRING	NULL	20	SECOND	#	#	ENABLED
+events_test	three_event	ev_test@localhost	RECURRING	NULL	20	SECOND	#	#	ENABLED
+events_test	two_event	ev_test@localhost	RECURRING	NULL	20	SECOND	#	#	ENABLED
 "This should show us only 2 events:";
 SHOW FULL EVENTS LIKE 't%event';
 Db	Name	Definer	Type	Execute at	Interval value	Interval field	Starts	Ends	Status
-events_test	three_event	ev_test@localhost	RECURRING	NULL	20	20 SECOND	#	#	ENABLED
-events_test	two_event	ev_test@localhost	RECURRING	NULL	20	20 SECOND	#	#	ENABLED
+events_test	three_event	ev_test@localhost	RECURRING	NULL	20	SECOND	#	#	ENABLED
+events_test	two_event	ev_test@localhost	RECURRING	NULL	20	SECOND	#	#	ENABLED
 "This should show us no events:";
 SHOW FULL EVENTS FROM test LIKE '%';
 Db	Name	Definer	Type	Execute at	Interval value	Interval field	Starts	Ends	Status
@@ -291,20 +291,20 @@ DROP DATABASE events_test2;
 "should see 1 event:";
 SHOW EVENTS;
 Db	Name	Definer	Type	Execute at	Interval value	Interval field	Starts	Ends	Status
-events_test	one_event	root@localhost	RECURRING	NULL	10	10 SECOND	#	#	ENABLED
+events_test	one_event	root@localhost	RECURRING	NULL	10	SECOND	#	#	ENABLED
 "we should see 4 events now:";
 SHOW FULL EVENTS;
 Db	Name	Definer	Type	Execute at	Interval value	Interval field	Starts	Ends	Status
-events_test	one_event	ev_test@localhost	RECURRING	NULL	20	20 SECOND	#	#	ENABLED
-events_test	three_event	ev_test@localhost	RECURRING	NULL	20	20 SECOND	#	#	ENABLED
-events_test	two_event	ev_test@localhost	RECURRING	NULL	20	20 SECOND	#	#	ENABLED
-events_test	one_event	root@localhost	RECURRING	NULL	10	10 SECOND	#	#	ENABLED
+events_test	one_event	ev_test@localhost	RECURRING	NULL	20	SECOND	#	#	ENABLED
+events_test	three_event	ev_test@localhost	RECURRING	NULL	20	SECOND	#	#	ENABLED
+events_test	two_event	ev_test@localhost	RECURRING	NULL	20	SECOND	#	#	ENABLED
+events_test	one_event	root@localhost	RECURRING	NULL	10	SECOND	#	#	ENABLED
 SELECT EVENT_CATALOG, EVENT_SCHEMA, EVENT_NAME, DEFINER, EVENT_BODY, EVENT_TYPE, EXECUTE_AT, INTERVAL_VALUE, INTERVAL_FIELD, STATUS,ON_COMPLETION, EVENT_COMMENT from information_schema.events;
 EVENT_CATALOG	EVENT_SCHEMA	EVENT_NAME	DEFINER	EVENT_BODY	EVENT_TYPE	EXECUTE_AT	INTERVAL_VALUE	INTERVAL_FIELD	STATUS	ON_COMPLETION	EVENT_COMMENT
-NULL	events_test	one_event	ev_test@localhost	select 123	RECURRING	NULL	20	20 SECOND	ENABLED	NOT PRESERVE	
-NULL	events_test	three_event	ev_test@localhost	select 123	RECURRING	NULL	20	20 SECOND	ENABLED	PRESERVE	three event
-NULL	events_test	two_event	ev_test@localhost	select 123	RECURRING	NULL	20	20 SECOND	ENABLED	NOT PRESERVE	two event
-NULL	events_test	one_event	root@localhost	select 123	RECURRING	NULL	10	10 SECOND	ENABLED	NOT PRESERVE	
+NULL	events_test	one_event	ev_test@localhost	select 123	RECURRING	NULL	20	SECOND	ENABLED	NOT PRESERVE	
+NULL	events_test	three_event	ev_test@localhost	select 123	RECURRING	NULL	20	SECOND	ENABLED	PRESERVE	three event
+NULL	events_test	two_event	ev_test@localhost	select 123	RECURRING	NULL	20	SECOND	ENABLED	NOT PRESERVE	two event
+NULL	events_test	one_event	root@localhost	select 123	RECURRING	NULL	10	SECOND	ENABLED	NOT PRESERVE	
 drop event one_event;
 drop event two_event;
 drop event three_event;
@@ -383,6 +383,7 @@ show processlist;
 Id	User	Host	db	Command	Time	State	Info
 #	root	localhost	events_test	Query	#	NULL	show processlist
 #	event_scheduler	connecting host	NULL	Connect	#	Sleeping	NULL
+#	root	localhost	events_test	Connect	#	User lock	select get_lock("test_lock2_1", 20)
 "Release the lock so the child process should finish. Hence the scheduler also"
 select release_lock("test_lock2_1");
 release_lock("test_lock2_1")

--- 1.29/sql/event.cc	2006-02-16 05:20:54 +01:00
+++ 1.30/sql/event.cc	2006-02-16 13:11:06 +01:00
@@ -457,11 +457,7 @@ common_1_lev_code:
   buf->append(tmp_buff, (uint) (end- tmp_buff));
   if (close_quote)
     buf->append('\'');
-    
-  buf->append(' ');
-  LEX_STRING *ival= &interval_type_to_name[interval];
-  buf->append(ival->str, ival->length);
-  
+
   return 0;
 }
 
@@ -1092,6 +1088,7 @@ evex_remove_from_cache(LEX_STRING *db, L
 {
   //ToDo : Add definer to the tuple (db, name) to become triple
   uint i;
+  int ret= 0;
 
   DBUG_ENTER("evex_remove_from_cache");
   /*
@@ -1126,6 +1123,7 @@ evex_remove_from_cache(LEX_STRING *db, L
       DBUG_PRINT("evex_remove_from_cache", ("delete from queue"));
       evex_queue_delete_element(&EVEX_EQ_NAME, i);
       // ok, we have cleaned
+      ret= 0;
       goto done;
     }
   }
@@ -1134,7 +1132,7 @@ done:
   if (use_lock)
     VOID(pthread_mutex_unlock(&LOCK_event_arrays));
 
-  DBUG_RETURN(0);
+  DBUG_RETURN(ret);
 }
 
 

--- 1.32/sql/event_timed.cc	2006-02-16 05:20:55 +01:00
+++ 1.33/sql/event_timed.cc	2006-02-16 13:11:06 +01:00
@@ -985,6 +985,7 @@ done:
   DBUG_RETURN(ret);
 }
 
+extern LEX_STRING interval_type_to_name[];
 
 /*
   Get SHOW CREATE EVENT as string
@@ -1025,6 +1026,9 @@ event_timed::get_create_event(THD *thd, 
   {
     buf->append(STRING_WITH_LEN("EVERY "));
     buf->append(expr_buf);
+    buf->append(' ');
+    LEX_STRING *ival= &interval_type_to_name[interval];
+    buf->append(ival->str, ival->length);
   }
   else
   {
Thread
bk commit into 5.1 tree (andrey:1.2117)ahristov16 Feb