List:Commits« Previous MessageNext Message »
From:ahristov Date:May 25 2006 1:03pm
Subject:bk commit into 5.1 tree (andrey:1.2187) BUG#17394
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.2187 06/05/25 15:02:39 andrey@lmy004. +7 -0
  update after manual merge.
  fix for bug#17394 Events namespace is wrong

  sql/sql_show.cc
    1.339 06/05/25 15:02:22 andrey@lmy004. +1 -1
    update after manual merge

  sql/event_scheduler.cc
    1.5 06/05/25 15:02:22 andrey@lmy004. +1 -2
    update after manual merge

  sql/event_priv.h
    1.23 06/05/25 15:02:22 andrey@lmy004. +2 -2
    update after manual merge

  sql/event.h
    1.30 06/05/25 15:02:22 andrey@lmy004. +1 -1
    update after manual merge

  sql/event.cc
    1.42 06/05/25 15:02:21 andrey@lmy004. +25 -17
    update after manual merge

  mysql-test/t/events.test
    1.31 06/05/25 15:02:21 andrey@lmy004. +6 -8
    update test after manual merg
    remove 2 unneeded secs

  mysql-test/r/events.result
    1.36 06/05/25 15:02:21 andrey@lmy004. +4 -8
    update 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-release-17394

--- 1.338/sql/sql_show.cc	2006-05-25 11:31:14 +02:00
+++ 1.339/sql/sql_show.cc	2006-05-25 15:02:22 +02:00
@@ -4184,7 +4184,7 @@ int events_table_index_read_for_db(THD *
 
   DBUG_PRINT("info", ("Using prefix scanning on PK"));
   event_table->file->ha_index_init(0, 1);
-  event_table->field[EVEX_FIELD_DB]->
+  event_table->field[Events::FIELD_DB]->
         store(thd->lex->select_lex.db, strlen(thd->lex->select_lex.db), scs);
   key_info= event_table->key_info;
   key_len= key_info->key_part[0].store_length;

--- 1.35/mysql-test/r/events.result	2006-05-25 11:31:14 +02:00
+++ 1.36/mysql-test/r/events.result	2006-05-25 15:02:21 +02:00
@@ -185,10 +185,10 @@ SHOW CREATE EVENT root20;
 Event	sql_mode	Create Event
 root20		CREATE EVENT `root20` ON SCHEDULE EVERY '50 20:12:45' DAY_SECOND ON COMPLETION NOT PRESERVE ENABLE DO select 1
 set names cp1251;
-create event ðóóò21 on schedule every '50:23:59:95' day_second COMMENT 'òîâà å 1251 êîìåíòàð' do select 1;
-SHOW CREATE EVENT ðóóò21;
 Event	sql_mode	Create Event
-ðóóò21		CREATE EVENT `ðóóò21` ON SCHEDULE EVERY '51 0:0:35' DAY_SECOND ON COMPLETION NOT PRESERVE ENABLE COMMENT 'òîâà å 1251 êîìåíòàð' DO select 1
 insert into mysql.event (db, name, body, definer, interval_value, interval_field) values (database(), "root22", "select 1", user(), 100, "SECOND_MICROSECOND");
 show create event root22;
 ERROR 42000: This version of MySQL doesn't yet support 'MICROSECOND'
@@ -213,7 +213,7 @@ drop event root17_1;
 drop event root18;
 drop event root19;
 drop event root20;
-drop event ðóóò21;
 set names latin1;
 CREATE EVENT intact_check ON SCHEDULE EVERY 10 HOUR DO SELECT "nothing";
 SHOW EVENTS;
@@ -280,7 +280,6 @@ SHOW EVENTS;
 Db	Name	Definer	Type	Execute at	Interval value	Interval field	Starts	Ends	Status
 events_test	intact_check	root@localhost	RECURRING	NULL	10	HOUR	#	#	ENABLED
 DROP EVENT intact_check;
-"Sleep a bit so the server closes the second connection"
 create event e_26 on schedule at '2017-01-01 00:00:00' disable do set @a = 5;
 select db, name, body, definer, convert_tz(execute_at, 'UTC', 'SYSTEM'), on_completion from mysql.event;
 db	name	body	definer	convert_tz(execute_at, 'UTC', 'SYSTEM')	on_completion
@@ -372,9 +371,6 @@ events_test	white_space	root@localhost	s
 drop event white_space;
 create event white_space on schedule every 10 hour disable do
 select 2;
-select event_schema, event_name, definer, event_body from information_schema.events where event_name='white_space';
-event_schema	event_name	definer	event_body
-events_test	white_space	root@localhost	select 2
 select event_schema, event_name, definer, event_body from information_schema.events where event_name='white_space';
 event_schema	event_name	definer	event_body
 events_test	white_space	root@localhost	select 2

--- 1.30/mysql-test/t/events.test	2006-05-25 11:31:13 +02:00
+++ 1.31/mysql-test/t/events.test	2006-05-25 15:02:21 +02:00
@@ -145,12 +145,12 @@ SHOW CREATE EVENT root19;
 create event root20 on schedule every '50:20:12:45' day_second do select 1;
 SHOW CREATE EVENT root20;
 set names cp1251;
-create event ðóóò21 on schedule every '50:23:59:95' day_second COMMENT 'òîâà å 1251 êîìåíòàð' do select 1;
-SHOW CREATE EVENT ðóóò21;
 insert into mysql.event (db, name, body, definer, interval_value, interval_field) values (database(), "root22", "select 1", user(), 100, "SECOND_MICROSECOND");
---error 1235
+--error ER_NOT_SUPPORTED_YET
 show create event root22;
---error 1235
+--error ER_NOT_SUPPORTED_YET
 SHOW EVENTS;
 drop event root22;
 drop event root6;
@@ -171,7 +171,7 @@ drop event root17_1;
 drop event root18;
 drop event root19;
 drop event root20;
-drop event ðóóò21;
 
 set names latin1;
 #
@@ -239,8 +239,6 @@ DROP EVENT intact_check;
 # mysql.event intact checking end
 #
 
---echo "Sleep a bit so the server closes the second connection"
---sleep 2
 create event e_26 on schedule at '2017-01-01 00:00:00' disable do set @a = 5;
 select db, name, body, definer, convert_tz(execute_at, 'UTC', 'SYSTEM'), on_completion from mysql.event;
 drop event e_26;
@@ -284,7 +282,7 @@ select get_lock("test_lock2", 20);
 --echo "Create an event which tries to acquire a mutex. The event locks on the mutex"
 create event закачка on schedule every 10 hour do select get_lock("test_lock2", 20);
 --echo "Let some time pass to the event starts"
---sleep 2
+--sleep 1
 --echo "Should have only 2 processes: the scheduler and the locked event"
 select /*2*/ user, host, db, command, state, info from information_schema.processlist where info is null or info not like '%processlist%' order by info;--echo "Release the mutex, the event worker should finish."
 --echo "Release the mutex, the event worker should finish."

--- 1.41/sql/event.cc	2006-05-25 11:31:13 +02:00
+++ 1.42/sql/event.cc	2006-05-25 15:02:21 +02:00
@@ -502,14 +502,15 @@ evex_db_find_event_by_name(THD *thd, con
     'db' and 'name' and the first key is the primary key over the
     same fields.
   */
-  if (dbname.length > table->field[EVEX_FIELD_DB]->field_length ||
-      ev_name.length > table->field[EVEX_FIELD_NAME]->field_length)
+  if (dbname.length > table->field[Events::FIELD_DB]->field_length ||
+      ev_name.length > table->field[Events::FIELD_NAME]->field_length)
       
     DBUG_RETURN(EVEX_KEY_NOT_FOUND);
 
   table->field[Events::FIELD_DB]->store(dbname.str, dbname.length,
-                                                  &my_charset_bin);
+                                        &my_charset_bin);
   table->field[Events::FIELD_NAME]->store(ev_name.str, ev_name.length,
+                                          &my_charset_bin);
 
   key_copy(key, table->record[0], table->key_info, table->key_info->key_length);
 
@@ -546,6 +547,7 @@ evex_db_find_event_by_name(THD *thd, con
 static int
 evex_fill_row(THD *thd, TABLE *table, Event_timed *et, my_bool is_update)
 {
+  CHARSET_INFO *scs= system_charset_info;
   enum Events::enum_table_field field_num;
 
   DBUG_ENTER("evex_fill_row");
@@ -554,12 +556,16 @@ evex_fill_row(THD *thd, TABLE *table, Ev
   DBUG_PRINT("info", ("name  =[%s]", et->name.str));
   DBUG_PRINT("info", ("body  =[%s]", et->body.str));
 
+  if (table->field[field_num= Events::FIELD_DEFINER]->
+                  store(et->definer.str, et->definer.length, scs))
+    goto err_truncate;
+
   if (table->field[field_num= Events::FIELD_DB]->
-                  store(et->dbname.str, et->dbname.length, system_charset_info))
+                  store(et->dbname.str, et->dbname.length, scs))
     goto err_truncate;
 
   if (table->field[field_num= Events::FIELD_NAME]->
-                  store(et->name.str, et->name.length, system_charset_info))
+                  store(et->name.str, et->name.length, scs))
     goto err_truncate;
 
   /* both ON_COMPLETION and STATUS are NOT NULL thus not calling set_notnull()*/
@@ -578,7 +584,7 @@ evex_fill_row(THD *thd, TABLE *table, Ev
                                store((longlong)thd->variables.sql_mode, true);
 
     if (table->field[field_num= Events::FIELD_BODY]->
-                     store(et->body.str, et->body.length, system_charset_info))
+                     store(et->body.str, et->body.length, scs))
       goto err_truncate;
   }
 
@@ -637,7 +643,7 @@ evex_fill_row(THD *thd, TABLE *table, Ev
   if (et->comment.str)
   {
     if (table->field[field_num= Events::FIELD_COMMENT]->
-                 store(et->comment.str, et->comment.length, system_charset_info))
+                 store(et->comment.str, et->comment.length, scs))
       goto err_truncate;
   }
 
@@ -738,7 +744,7 @@ db_create_event(THD *thd, Event_timed *e
     goto err;
   }
 
-  ((Field_timestamp *)table->field[Eevents::FIELD_CREATED])->set_time();
+  ((Field_timestamp *)table->field[Events::FIELD_CREATED])->set_time();
 
   /*
     evex_fill_row() calls my_error() in case of error so no need to
@@ -801,6 +807,7 @@ err:
 static int
 db_update_event(THD *thd, Event_timed *et, sp_name *new_name)
 {
+  CHARSET_INFO *scs= system_charset_info;
   TABLE *table;
   int ret= EVEX_OPEN_TABLE_FAILED;
   DBUG_ENTER("db_update_event");
@@ -820,8 +827,8 @@ db_update_event(THD *thd, Event_timed *e
   /* first look whether we overwrite */
   if (new_name)
   {
-    if (!sortcmp_lex_string(et->name, new_name->m_name, system_charset_info) &&
-        !sortcmp_lex_string(et->dbname, new_name->m_db, system_charset_info))
+    if (!sortcmp_lex_string(et->name, new_name->m_name, scs) &&
+        !sortcmp_lex_string(et->dbname, new_name->m_db, scs))
     {
       my_error(ER_EVENT_SAME_NAME, MYF(0), et->name.str);
       goto err;    
@@ -850,16 +857,19 @@ db_update_event(THD *thd, Event_timed *e
   /* Don't update create on row update. */
   table->timestamp_field_type= TIMESTAMP_NO_AUTO_SET;
 
-  /* evex_fill_row() calls my_error() in case of error so no need to handle it here */
+  /*
+    evex_fill_row() calls my_error() in case of error so no need to
+    handle it here
+  */
   if ((ret= evex_fill_row(thd, table, et, true)))
     goto err;
 
   if (new_name)
   {    
     table->field[Events::FIELD_DB]->
-      store(new_name->m_db.str, new_name->m_db.length, system_charset_info);
+      store(new_name->m_db.str, new_name->m_db.length, scs);
     table->field[Events::FIELD_NAME]->
-      store(new_name->m_name.str, new_name->m_name.length, system_charset_info);
+      store(new_name->m_name.str, new_name->m_name.length, scs);
   }
 
   if ((ret= table->file->ha_update_row(table->record[1], table->record[0])))
@@ -887,7 +897,6 @@ err:
     db_find_event()
       thd      THD
       name     the name of the event to find
-      definer  who owns the event
       ett      event's data if event is found
       tbl      TABLE object to use when not NULL
 
@@ -1149,7 +1158,6 @@ Events::drop_event(THD *thd, Event_timed
     Events::show_create_event()
       thd        THD
       spn        the name of the event (db, name)
-      definer    the definer of the event
 
   RETURN VALUE
     0  OK
@@ -1157,7 +1165,7 @@ Events::drop_event(THD *thd, Event_timed
 */
 
 int
-Events::show_create_event(THD *thd, sp_name *spn, LEX_STRING definer)
+Events::show_create_event(THD *thd, sp_name *spn)
 {
   int ret;
   Event_timed *et= NULL;
@@ -1167,7 +1175,7 @@ Events::show_create_event(THD *thd, sp_n
   DBUG_PRINT("enter", ("name: %*s", spn->m_name.length, spn->m_name.str));
 
   thd->reset_n_backup_open_tables_state(&backup);
-  ret= db_find_event(thd, spn, &definer, &et, NULL, thd->mem_root);
+  ret= db_find_event(thd, spn, &et, NULL, thd->mem_root);
   thd->restore_backup_open_tables_state(&backup);
 
   if (!ret)

--- 1.29/sql/event.h	2006-05-25 11:31:13 +02:00
+++ 1.30/sql/event.h	2006-05-25 15:02:22 +02:00
@@ -85,7 +85,7 @@ public:
   open_event_table(THD *thd, enum thr_lock_type lock_type, TABLE **table);
 
   static int
-  show_create_event(THD *thd, sp_name *spn, LEX_STRING definer);
+  show_create_event(THD *thd, sp_name *spn);
 
   static int
   reconstruct_interval_expression(String *buf, interval_type interval,

--- 1.22/sql/event_priv.h	2006-05-25 10:40:43 +02:00
+++ 1.23/sql/event_priv.h	2006-05-25 15:02:22 +02:00
@@ -42,8 +42,8 @@ int
 db_drop_event(THD *thd, Event_timed *et, bool drop_if_exists,
               uint *rows_affected);
 int
-db_find_event(THD *thd, sp_name *name, LEX_STRING *definer, Event_timed **ett,
-              TABLE *tbl, MEM_ROOT *root);
+db_find_event(THD *thd, sp_name *name, Event_timed **ett, TABLE *tbl,
+              MEM_ROOT *root);
 
 int
 db_create_event(THD *thd, Event_timed *et, my_bool create_if_not,

--- 1.4/sql/event_scheduler.cc	2006-05-23 17:46:28 +02:00
+++ 1.5/sql/event_scheduler.cc	2006-05-25 15:02:22 +02:00
@@ -2057,8 +2057,7 @@ Event_scheduler::load_named_event(THD *t
   /* No need to use my_error() here because db_find_event() has done it */
   {
     sp_name spn(etn->dbname, etn->name);
-    ret= db_find_event(thd, &spn, &etn->definer, &et_loaded, NULL,
-                       &scheduler_root);
+    ret= db_find_event(thd, &spn, &et_loaded, NULL, &scheduler_root);
   }
   thd->restore_backup_open_tables_state(&backup);
   /* In this case no memory was allocated so we don't need to clean */
Thread
bk commit into 5.1 tree (andrey:1.2187) BUG#17394ahristov25 May