List:Commits« Previous MessageNext Message »
From:ahristov Date:June 20 2006 5:14pm
Subject:bk commit into 5.1 tree (andrey:1.2224)
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.2224 06/06/20 17:14:36 andrey@lmy004. +12 -0
  manual merge

  sql/event_scheduler.cc
    1.7 06/06/20 17:14:28 andrey@lmy004. +1 -2
    manual merge

  sql/time.cc
    1.62 06/06/20 17:09:42 andrey@lmy004. +0 -0
    Auto merged

  sql/sql_yacc.yy
    1.483 06/06/20 17:09:42 andrey@lmy004. +0 -0
    Auto merged

  sql/sql_show.cc
    1.353 06/06/20 17:09:41 andrey@lmy004. +0 -0
    Auto merged

  sql/sql_parse.cc
    1.562 06/06/20 17:09:41 andrey@lmy004. +0 -0
    Auto merged

  sql/sql_db.cc
    1.137 06/06/20 17:09:40 andrey@lmy004. +0 -0
    Auto merged

  sql/mysqld.cc
    1.561 06/06/20 17:09:40 andrey@lmy004. +0 -0
    Auto merged

  sql/mysql_priv.h
    1.411 06/06/20 17:09:40 andrey@lmy004. +0 -0
    Auto merged

  sql/events.cc
    1.44 06/06/20 17:09:39 andrey@lmy004. +0 -0
    Auto merged

  sql/events.cc
    1.43 06/06/20 17:09:39 andrey@lmy004. +0 -0
    Merge rename: sql/event.cc -> sql/events.cc

  sql/Makefile.am
    1.144 06/06/20 17:09:39 andrey@lmy004. +0 -0
    Auto merged

  libmysqld/Makefile.am
    1.94 06/06/20 17:09:39 andrey@lmy004. +0 -0
    Auto merged

  BitKeeper/etc/ignore
    1.246 06/06/20 17:09:11 andrey@lmy004. +1 -1
    auto-union

# 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-runtime/RESYNC

--- 1.143/sql/Makefile.am	2006-06-09 09:07:26 +02:00
+++ 1.144/sql/Makefile.am	2006-06-20 17:09:39 +02:00
@@ -64,7 +64,7 @@ noinst_HEADERS =	item.h item_func.h item
 			tztime.h my_decimal.h\
 			sp_head.h sp_pcontext.h sp_rcontext.h sp.h sp_cache.h \
 			parse_file.h sql_view.h	sql_trigger.h \
-			sql_array.h sql_cursor.h event.h event_priv.h \
+			sql_array.h sql_cursor.h events.h events_priv.h \
 			sql_plugin.h authors.h sql_partition.h \
 			partition_info.h partition_element.h event_scheduler.h \
 			contributors.h
@@ -104,7 +104,7 @@ mysqld_SOURCES =	sql_lex.cc sql_handler.
 			tztime.cc my_time.c my_user.c my_decimal.cc\
 			sp_head.cc sp_pcontext.cc  sp_rcontext.cc sp.cc \
 			sp_cache.cc parse_file.cc sql_trigger.cc \
-                        event_scheduler.cc event.cc event_timed.cc \
+                        event_scheduler.cc events.cc event_timed.cc \
 			sql_plugin.cc sql_binlog.cc \
 			sql_builtin.cc sql_tablespace.cc partition_info.cc
 

--- 1.410/sql/mysql_priv.h	2006-06-15 13:38:08 +02:00
+++ 1.411/sql/mysql_priv.h	2006-06-20 17:09:40 +02:00
@@ -1751,6 +1751,8 @@ bool date_add_interval(TIME *ltime, inte
 bool calc_time_diff(TIME *l_time1, TIME *l_time2, int l_sign,
                     longlong *seconds_out, long *microseconds_out);
 
+extern LEX_STRING interval_type_to_name[];
+
 extern DATE_TIME_FORMAT *date_time_format_make(timestamp_type format_type,
 					       const char *format_str,
 					       uint format_length);
@@ -1766,6 +1768,7 @@ void make_date(const DATE_TIME_FORMAT *f
                String *str);
 void make_time(const DATE_TIME_FORMAT *format, const TIME *l_time,
                String *str);
+int my_time_compare(TIME *a, TIME *b);
 
 int test_if_number(char *str,int *res,bool allow_wildcards);
 void change_byte(byte *,uint,char,char);
@@ -1783,6 +1786,7 @@ void filesort_free_buffers(TABLE *table)
 void change_double_for_sort(double nr,byte *to);
 double my_double_round(double value, int dec, bool truncate);
 int get_quick_record(SQL_SELECT *select);
+
 int calc_weekday(long daynr,bool sunday_first_day_of_week);
 uint calc_week(TIME *l_time, uint week_behaviour, uint *year);
 void find_date(char *pos,uint *vek,uint flag);

--- 1.560/sql/mysqld.cc	2006-06-19 16:58:48 +02:00
+++ 1.561/sql/mysqld.cc	2006-06-20 17:09:40 +02:00
@@ -24,7 +24,7 @@
 #include "stacktrace.h"
 #include "mysqld_suffix.h"
 #include "mysys_err.h"
-#include "event.h"
+#include "events.h"
 
 #include "ha_myisam.h"
 

--- 1.136/sql/sql_db.cc	2006-06-14 21:41:56 +02:00
+++ 1.137/sql/sql_db.cc	2006-06-20 17:09:40 +02:00
@@ -20,7 +20,7 @@
 #include "mysql_priv.h"
 #include <mysys_err.h>
 #include "sp.h"
-#include "event.h"
+#include "events.h"
 #include <my_dir.h>
 #include <m_ctype.h>
 #ifdef __WIN__

--- 1.561/sql/sql_parse.cc	2006-06-18 12:20:28 +02:00
+++ 1.562/sql/sql_parse.cc	2006-06-20 17:09:41 +02:00
@@ -26,7 +26,8 @@
 #include "sp_head.h"
 #include "sp.h"
 #include "sp_cache.h"
-#include "event.h"
+#include "events.h"
+#include "event_timed.h"
 
 #ifdef HAVE_OPENSSL
 /*

--- 1.352/sql/sql_show.cc	2006-06-19 16:57:35 +02:00
+++ 1.353/sql/sql_show.cc	2006-06-20 17:09:41 +02:00
@@ -26,7 +26,8 @@
 #include "sql_trigger.h"
 #include "authors.h"
 #include "contributors.h"
-#include "event.h"
+#include "events.h"
+#include "event_timed.h"
 #include <my_dir.h>
 
 #ifdef WITH_PARTITION_STORAGE_ENGINE

--- 1.482/sql/sql_yacc.yy	2006-06-18 12:20:29 +02:00
+++ 1.483/sql/sql_yacc.yy	2006-06-20 17:09:42 +02:00
@@ -38,7 +38,7 @@
 #include "sp_pcontext.h"
 #include "sp_rcontext.h"
 #include "sp.h"
-#include "event.h"
+#include "event_timed.h"
 #include <myisam.h>
 #include <myisammrg.h>
 

--- 1.61/sql/time.cc	2006-06-06 01:47:26 +02:00
+++ 1.62/sql/time.cc	2006-06-20 17:09:42 +02:00
@@ -24,6 +24,30 @@
 	/* Some functions to calculate dates */
 
 #ifndef TESTTIME
+
+LEX_STRING interval_type_to_name[INTERVAL_LAST] = {
+  { C_STRING_WITH_LEN("YEAR")},
+  { C_STRING_WITH_LEN("QUARTER")},
+  { C_STRING_WITH_LEN("MONTH")},
+  { C_STRING_WITH_LEN("DAY")},
+  { C_STRING_WITH_LEN("HOUR")},
+  { C_STRING_WITH_LEN("MINUTE")},
+  { C_STRING_WITH_LEN("WEEK")},
+  { C_STRING_WITH_LEN("SECOND")},
+  { C_STRING_WITH_LEN("MICROSECOND")},
+  { C_STRING_WITH_LEN("YEAR_MONTH")},
+  { C_STRING_WITH_LEN("DAY_HOUR")},
+  { C_STRING_WITH_LEN("DAY_MINUTE")},
+  { C_STRING_WITH_LEN("DAY_SECOND")},
+  { C_STRING_WITH_LEN("HOUR_MINUTE")},
+  { C_STRING_WITH_LEN("HOUR_SECOND")},
+  { C_STRING_WITH_LEN("MINUTE_SECOND")},
+  { C_STRING_WITH_LEN("DAY_MICROSECOND")},
+  { C_STRING_WITH_LEN("HOUR_MICROSECOND")},
+  { C_STRING_WITH_LEN("MINUTE_MICROSECOND")},
+  { C_STRING_WITH_LEN("SECOND_MICROSECOND")}
+}; 
+
 	/* Calc weekday from daynr */
 	/* Returns 0 for monday, 1 for tuesday .... */
 
@@ -909,5 +933,37 @@ calc_time_diff(TIME *l_time1, TIME *l_ti
   return neg;
 }
 
+
+/*
+  Compares 2 TIME structures
+
+  SYNOPSIS
+    my_time_compare()
+
+      a - first time
+      b - second time
+
+  RETURN VALUE
+   -1   - a < b
+    0   - a == b
+    1   - a > b
+
+  NOTES
+    TIME.second_part is not considered during comparison
+*/
+
+int
+my_time_compare(TIME *a, TIME *b)
+{
+  my_ulonglong a_t= TIME_to_ulonglong_datetime(a);
+  my_ulonglong b_t= TIME_to_ulonglong_datetime(b);
+
+  if (a_t > b_t)
+    return 1;
+  else if (a_t < b_t)
+    return -1;
+
+  return 0;
+}
 
 #endif

--- 1.42/sql/event.cc	2006-06-04 20:05:16 +02:00
+++ 1.44/sql/events.cc	2006-06-20 17:09:39 +02:00
@@ -14,8 +14,10 @@
    along with this program; if not, write to the Free Software
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
 
-#include "event_priv.h"
-#include "event.h"
+#include "mysql_priv.h"
+#include "events_priv.h"
+#include "events.h"
+#include "event_timed.h"
 #include "event_scheduler.h"
 #include "sp.h"
 #include "sp_head.h"
@@ -160,35 +162,11 @@ TABLE_FIELD_W_TYPE event_table_fields[Ev
 };
 
 
-LEX_STRING interval_type_to_name[] = {
-  {(char *) STRING_WITH_LEN("YEAR")},
-  {(char *) STRING_WITH_LEN("QUARTER")},
-  {(char *) STRING_WITH_LEN("MONTH")},
-  {(char *) STRING_WITH_LEN("DAY")},
-  {(char *) STRING_WITH_LEN("HOUR")},
-  {(char *) STRING_WITH_LEN("MINUTE")},
-  {(char *) STRING_WITH_LEN("WEEK")},
-  {(char *) STRING_WITH_LEN("SECOND")},
-  {(char *) STRING_WITH_LEN("MICROSECOND")},
-  {(char *) STRING_WITH_LEN("YEAR_MONTH")},
-  {(char *) STRING_WITH_LEN("DAY_HOUR")},
-  {(char *) STRING_WITH_LEN("DAY_MINUTE")},
-  {(char *) STRING_WITH_LEN("DAY_SECOND")},
-  {(char *) STRING_WITH_LEN("HOUR_MINUTE")},
-  {(char *) STRING_WITH_LEN("HOUR_SECOND")},
-  {(char *) STRING_WITH_LEN("MINUTE_SECOND")},
-  {(char *) STRING_WITH_LEN("DAY_MICROSECOND")},
-  {(char *) STRING_WITH_LEN("HOUR_MICROSECOND")},
-  {(char *) STRING_WITH_LEN("MINUTE_MICROSECOND")},
-  {(char *) STRING_WITH_LEN("SECOND_MICROSECOND")}
-}; 
-
-
 /*
   Compares 2 LEX strings regarding case.
 
   SYNOPSIS
-    my_time_compare()
+    sortcmp_lex_string()
 
       s - first LEX_STRING
       t - second LEX_STRING
@@ -211,68 +189,6 @@ int sortcmp_lex_string(LEX_STRING s, LEX
 
 
 /*
-  Compares 2 TIME structures
-
-  SYNOPSIS
-    my_time_compare()
-
-      a - first TIME
-      b - second time
-
-  RETURN VALUE
-   -1   - a < b
-    0   - a == b
-    1   - a > b
-
-  NOTES
-    TIME.second_part is not considered during comparison
-*/
-
-int
-my_time_compare(TIME *a, TIME *b)
-{
-  my_ulonglong a_t= TIME_to_ulonglong_datetime(a);
-  my_ulonglong b_t= TIME_to_ulonglong_datetime(b);
-
-  if (a_t > b_t)
-    return 1;
-  else if (a_t < b_t)
-    return -1;
-
-  return 0;
-}
-
-
-/*
-  Compares the execute_at members of 2 Event_timed instances.
-  Used as callback for the prioritized queue when shifting
-  elements inside.
-
-  SYNOPSIS
-    event_timed_compare()
-  
-      vptr - not used (set it to NULL)
-      a    - first Event_timed object
-      b    - second Event_timed object
-
-  RETURNS:
-   -1   - a->execute_at < b->execute_at
-    0   - a->execute_at == b->execute_at
-    1   - a->execute_at > b->execute_at
-    
-  Notes
-    execute_at.second_part is not considered during comparison
-*/
-
-int 
-event_timed_compare_q(void *vptr, byte* a, byte *b)
-{
-  return my_time_compare(&((Event_timed *)a)->execute_at,
-                         &((Event_timed *)b)->execute_at);
-}
-
-
-/*
   Reconstructs interval expression from interval type and expression
   value that is in form of a value of the smalles entity:
   For
@@ -1002,7 +918,8 @@ Events::create_event(THD *thd, Event_tim
                              rows_affected)))
   {
     Event_scheduler *scheduler= Event_scheduler::get_instance();
-    if (scheduler->initialized() && (ret= scheduler->add_event(thd, et, true)))
+    if (scheduler->initialized() &&
+        (ret= scheduler->create_event(thd, et, true)))
       my_error(ER_EVENT_MODIFY_QUEUE_ERROR, MYF(0), ret);
   }
   /* No need to close the table, it will be closed in sql_parse::do_command */
@@ -1047,7 +964,7 @@ Events::update_event(THD *thd, Event_tim
   {
     Event_scheduler *scheduler= Event_scheduler::get_instance();
     if (scheduler->initialized() &&
-        (ret= scheduler->replace_event(thd, et,
+        (ret= scheduler->update_event(thd, et,
                                        new_name? &new_name->m_db: NULL,
                                        new_name? &new_name->m_name: NULL)))
       my_error(ER_EVENT_MODIFY_QUEUE_ERROR, MYF(0), ret);

--- 1.6/sql/event_scheduler.cc	2006-06-05 05:16:03 +02:00
+++ 1.7/sql/event_scheduler.cc	2006-06-20 17:14:28 +02:00
@@ -14,8 +14,10 @@
    along with this program; if not, write to the Free Software
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
 
-#include "event_priv.h"
-#include "event.h"
+#include "mysql_priv.h"
+#include "events_priv.h"
+#include "events.h"
+#include "event_timed.h"
 #include "event_scheduler.h"
 #include "sp_head.h"
 
@@ -46,8 +48,8 @@
   The scheduler only manages execution of the events. Their creation,
   alteration and deletion is delegated to other routines found in event.cc .
   These routines interact with the scheduler :
-  - CREATE EVENT -> Event_scheduler::add_event()
-  - ALTER EVENT  -> Event_scheduler::replace_event()
+  - CREATE EVENT -> Event_scheduler::create_event()
+  - ALTER EVENT  -> Event_scheduler::update_event()
   - DROP EVENT   -> Event_scheduler::drop_event()
 
   There is one mutex in the single Event_scheduler object which controls
@@ -299,6 +301,35 @@ public:
 
 
 /*
+  Compares the execute_at members of 2 Event_timed instances.
+  Used as callback for the prioritized queue when shifting
+  elements inside.
+
+  SYNOPSIS
+    event_timed_compare_q()
+  
+      vptr - not used (set it to NULL)
+      a    - first Event_timed object
+      b    - second Event_timed object
+
+  RETURN VALUE
+   -1   - a->execute_at < b->execute_at
+    0   - a->execute_at == b->execute_at
+    1   - a->execute_at > b->execute_at
+    
+  NOTES
+    execute_at.second_part is not considered during comparison
+*/
+
+static int 
+event_timed_compare_q(void *vptr, byte* a, byte *b)
+{
+  return my_time_compare(&((Event_timed *)a)->execute_at,
+                         &((Event_timed *)b)->execute_at);
+}
+
+
+/*
   Prints the stack of infos, warnings, errors from thd to
   the console so it can be fetched by the logs-into-tables and
   checked later.
@@ -740,10 +771,10 @@ Event_scheduler::destroy()
 
 
 /*
-  Adds an event to the scheduler queue
+  Creates an event in the scheduler queue
 
   SYNOPSIS
-    Event_scheduler::add_event()
+    Event_scheduler::create_event()
       et              The event to add
       check_existence Whether to check if already loaded.
 
@@ -753,11 +784,11 @@ Event_scheduler::destroy()
 */
 
 enum Event_scheduler::enum_error_code
-Event_scheduler::add_event(THD *thd, Event_timed *et, bool check_existence)
+Event_scheduler::create_event(THD *thd, Event_timed *et, bool check_existence)
 {
   enum enum_error_code res;
   Event_timed *et_new;
-  DBUG_ENTER("Event_scheduler::add_event");
+  DBUG_ENTER("Event_scheduler::create_event");
   DBUG_PRINT("enter", ("thd=%p et=%p lock=%p",thd,et,&LOCK_scheduler_data));
 
   LOCK_SCHEDULER_DATA();
@@ -859,7 +890,7 @@ Event_scheduler::drop_event(THD *thd, Ev
 
 
 /*
-  Replaces an event in the scheduler queue
+  Updates an event from the scheduler queue
 
   SYNOPSIS
     Event_scheduler::replace_event()
@@ -873,7 +904,7 @@ Event_scheduler::drop_event(THD *thd, Ev
 */
 
 enum Event_scheduler::enum_error_code
-Event_scheduler::replace_event(THD *thd, Event_timed *et,
+Event_scheduler::update_event(THD *thd, Event_timed *et,
                                LEX_STRING *new_schema,
                                LEX_STRING *new_name)
 {
@@ -886,7 +917,7 @@ Event_scheduler::replace_event(THD *thd,
   LINT_INIT(old_name.str);
   LINT_INIT(old_name.length);
 
-  DBUG_ENTER("Event_scheduler::replace_event");
+  DBUG_ENTER("Event_scheduler::update_event");
   DBUG_PRINT("enter", ("thd=%p et=%p et=[%s.%s] lock=%p",
              thd, et, et->dbname.str, et->name.str, &LOCK_scheduler_data));
 

--- 1.93/libmysqld/Makefile.am	2006-06-09 09:23:51 +02:00
+++ 1.94/libmysqld/Makefile.am	2006-06-20 17:09:39 +02:00
@@ -68,7 +68,7 @@ sqlsources = derror.cc field.cc field_co
 	spatial.cc gstream.cc sql_help.cc tztime.cc sql_cursor.cc \
 	sp_head.cc sp_pcontext.cc sp.cc sp_cache.cc sp_rcontext.cc \
 	parse_file.cc sql_view.cc sql_trigger.cc my_decimal.cc \
-	event_scheduler.cc event.cc event_timed.cc \
+	event_scheduler.cc events.cc event_timed.cc \
 	rpl_filter.cc sql_partition.cc sql_builtin.cc sql_plugin.cc \
 	sql_tablespace.cc \
 	rpl_injector.cc my_user.c partition_info.cc

--- 1.245/BitKeeper/etc/ignore	2006-06-13 21:58:27 +02:00
+++ 1.246/BitKeeper/etc/ignore	2006-06-20 17:09:11 +02:00
@@ -462,6 +462,7 @@ libmysqld/event.cc
 libmysqld/event_executor.cc
 libmysqld/event_scheduler.cc
 libmysqld/event_timed.cc
+libmysqld/events.cc
 libmysqld/examples/client_test.c
 libmysqld/examples/client_test.cc
 libmysqld/examples/completion_hash.cc
Thread
bk commit into 5.1 tree (andrey:1.2224)ahristov20 Jun