Commit e5f8163b authored by unknown's avatar unknown
Browse files

first cut of WL#3337 (New event scheduler locking infrastructure).

Infrastructure built. Added the  foreseen files and change Makefile.am/CMakeLists.txt
accordingly.


libmysqld/Makefile.am:
  add new files. this is first cut of WL3337u
sql/CMakeLists.txt:
  add more files to build
sql/Makefile.am:
  add new files. this is first cut of WL3337
sql/event_scheduler.cc:
  event_timed.h -> event_data_objects.h (WL#3337)
sql/events.cc:
  event_timed.h -> event_data_objects.h (WL#3337)
sql/share/errmsg.txt:
  new error message
sql/event_data_objects.cc:
  event_timed.h -> event_data_objects.h (WL#3337)
sql/event_data_objects.h:
  event_timed.h -> event_data_objects.h (WL#3337)
sql/sql_parse.cc:
  event_timed.h -> event_data_objects.h (WL#3337)
sql/sql_show.cc:
  event_timed.h -> event_data_objects.h (WL#3337)
sql/sql_yacc.yy:
  event_timed.h -> event_data_objects.h (WL#3337)
parent 42169376
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -68,7 +68,8 @@ sqlsources = derror.cc field.cc field_conv.cc strfunc.cc filesort.cc \
	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 events.cc event_timed.cc \
	event_scheduler.cc events.cc event_data_objects.cc \
        event_queue.cc event_db_repository.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
+2 −1
Original line number Diff line number Diff line
@@ -51,7 +51,8 @@ ADD_EXECUTABLE(mysqld ../sql-common/client.c derror.cc des_key_file.cc
               sql_table.cc sql_test.cc sql_trigger.cc sql_udf.cc sql_union.cc
               sql_update.cc sql_view.cc strfunc.cc table.cc thr_malloc.cc 
               time.cc tztime.cc uniques.cc unireg.cc item_xmlfunc.cc 
               rpl_tblmap.cc sql_binlog.cc event_scheduler.cc event_timed.cc 
               rpl_tblmap.cc sql_binlog.cc event_scheduler.cc event_data_objects.cc
               event_queue.cc event_db_repository.cc 
               sql_tablespace.cc events.cc ../sql-common/my_user.c 
               partition_info.cc
               ${PROJECT_SOURCE_DIR}/sql/sql_yacc.cc
+4 −2
Original line number Diff line number Diff line
@@ -65,7 +65,8 @@ noinst_HEADERS = item.h item_func.h item_sum.h item_cmpfunc.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 events.h events_priv.h \
			sql_plugin.h authors.h sql_partition.h event_timed.h \
			sql_plugin.h authors.h sql_partition.h event_data_objects.h \
                        event_queue.h event_db_repository.h \
			partition_info.h partition_element.h event_scheduler.h \
			contributors.h
mysqld_SOURCES =	sql_lex.cc sql_handler.cc sql_partition.cc \
@@ -104,7 +105,8 @@ mysqld_SOURCES = sql_lex.cc sql_handler.cc sql_partition.cc \
			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 events.cc event_timed.cc \
                        event_scheduler.cc events.cc event_data_objects.cc \
                        event_queue.cc event_db_repository.cc \
			sql_plugin.cc sql_binlog.cc \
			sql_builtin.cc sql_tablespace.cc partition_info.cc

+1 −1
Original line number Diff line number Diff line
@@ -18,7 +18,7 @@
#include "mysql_priv.h"
#include "events_priv.h"
#include "events.h"
#include "event_timed.h"
#include "event_data_objects.h"
#include "sp_head.h"


+89 −4
Original line number Diff line number Diff line
#ifndef _EVENT_TIMED_H_
#define _EVENT_TIMED_H_
#ifndef _EVENT_DATA_OBJECTS_H_
#define _EVENT_DATA_OBJECTS_H_
/* Copyright (C) 2004-2006 MySQL AB

   This program is free software; you can redistribute it and/or modify
@@ -41,6 +41,7 @@


class sp_head;
class Sql_alloc;

class Event_timed
{
@@ -214,4 +215,88 @@ class Event_timed
  set_thread_id(ulong tid) { thread_id= tid; }
};

#endif /* _EVENT_H_ */

class Event_parse_data : public Sql_alloc
{
  Event_parse_data(const Event_parse_data &);	/* Prevent use of these */
  void operator=(Event_parse_data &);

public:
  enum enum_status
  {
    ENABLED = 1,
    DISABLED
  };

  enum enum_on_completion
  {
    ON_COMPLETION_DROP = 1,
    ON_COMPLETION_PRESERVE
  };

  enum enum_on_completion on_completion;
  enum enum_status status;

  const uchar *body_begin;

  LEX_STRING dbname;
  LEX_STRING name;
  LEX_STRING body;

  LEX_STRING definer_user;
  LEX_STRING definer_host;
  LEX_STRING definer;// combination of user and host

  LEX_STRING comment;
  Item* item_starts;
  Item* item_ends;
  Item* item_execute_at;

  TIME starts;
  TIME ends;
  TIME execute_at;
  my_bool starts_null;
  my_bool ends_null;
  my_bool execute_at_null;

  Item* item_expression;
  Item* item_interval;
  longlong expression;
  interval_type interval;

//  ulonglong created;
//  ulonglong modified;

  static Event_parse_data *
  new_instance(THD *thd);

  Event_parse_data() {}
  ~Event_parse_data() {}

  int
  init_definer(THD *thd);

  int
  init_execute_at(THD *thd, Item *expr);

  int
  init_interval(THD *thd, Item *expr, interval_type new_interval);

  void
  init_name(THD *thd, sp_name *spn);

  int
  init_starts(THD *thd, Item *starts);

  int
  init_ends(THD *thd, Item *ends);

  void
  init_body(THD *thd);

  void
  init_comment(THD *thd, LEX_STRING *set_comment);

};

#endif /* _EVENT_DATA_OBJECTS_H_ */
Loading