summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorunknown <andrey@lmy004.>2006-06-27 08:48:50 +0200
committerunknown <andrey@lmy004.>2006-06-27 08:48:50 +0200
commite5f8163b88d019942c5eb205a023a24c3e9cee04 (patch)
tree94511d4e2c22850a000807e33c619929ebf5bdd7 /sql
parent42169376f04a575fc5b21d8c57974493a6444d5e (diff)
downloadmariadb-git-e5f8163b88d019942c5eb205a023a24c3e9cee04.tar.gz
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)
Diffstat (limited to 'sql')
-rw-r--r--sql/CMakeLists.txt3
-rw-r--r--sql/Makefile.am6
-rw-r--r--sql/event_data_objects.cc (renamed from sql/event_timed.cc)2
-rw-r--r--sql/event_data_objects.h (renamed from sql/event_timed.h)93
-rw-r--r--sql/event_db_repository.cc19
-rw-r--r--sql/event_db_repository.h20
-rw-r--r--sql/event_queue.cc19
-rw-r--r--sql/event_queue.h20
-rw-r--r--sql/event_scheduler.cc2
-rw-r--r--sql/events.cc2
-rw-r--r--sql/share/errmsg.txt3
-rw-r--r--sql/sql_parse.cc2
-rw-r--r--sql/sql_show.cc2
-rw-r--r--sql/sql_yacc.yy2
14 files changed, 182 insertions, 13 deletions
diff --git a/sql/CMakeLists.txt b/sql/CMakeLists.txt
index d80a51bb829..9c4d544233f 100644
--- a/sql/CMakeLists.txt
+++ b/sql/CMakeLists.txt
@@ -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
diff --git a/sql/Makefile.am b/sql/Makefile.am
index 387f18c2ae9..29645302ecc 100644
--- a/sql/Makefile.am
+++ b/sql/Makefile.am
@@ -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
diff --git a/sql/event_timed.cc b/sql/event_data_objects.cc
index 4ec875f32a3..ebd45dd1a23 100644
--- a/sql/event_timed.cc
+++ b/sql/event_data_objects.cc
@@ -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"
diff --git a/sql/event_timed.h b/sql/event_data_objects.h
index 0652cece361..0c122211a9d 100644
--- a/sql/event_timed.h
+++ b/sql/event_data_objects.h
@@ -1,5 +1,5 @@
-#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
{
@@ -213,5 +214,89 @@ public:
void
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_ */
diff --git a/sql/event_db_repository.cc b/sql/event_db_repository.cc
new file mode 100644
index 00000000000..547e1e6887b
--- /dev/null
+++ b/sql/event_db_repository.cc
@@ -0,0 +1,19 @@
+/* Copyright (C) 2004-2006 MySQL AB
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+
+#include "mysql_priv.h"
+#include "event_db_repository.h"
+#include "event_data_objects.h"
diff --git a/sql/event_db_repository.h b/sql/event_db_repository.h
new file mode 100644
index 00000000000..d8a8784089e
--- /dev/null
+++ b/sql/event_db_repository.h
@@ -0,0 +1,20 @@
+#ifndef _EVENT_DB_REPOSITORY_H_
+#define _EVENT_DB_REPOSITORY_H_
+/* Copyright (C) 2004-2006 MySQL AB
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+
+
+#endif /* _EVENT_DB_REPOSITORY_H_ */
diff --git a/sql/event_queue.cc b/sql/event_queue.cc
new file mode 100644
index 00000000000..46f965678c6
--- /dev/null
+++ b/sql/event_queue.cc
@@ -0,0 +1,19 @@
+/* Copyright (C) 2004-2006 MySQL AB
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+
+#include "mysql_priv.h"
+#include "event_queue.h"
+#include "event_data_objects.h"
diff --git a/sql/event_queue.h b/sql/event_queue.h
new file mode 100644
index 00000000000..b3aa6133840
--- /dev/null
+++ b/sql/event_queue.h
@@ -0,0 +1,20 @@
+#ifndef _EVENT_QUEUE_H_
+#define _EVENT_QUEUE_H_
+/* Copyright (C) 2004-2006 MySQL AB
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+
+
+#endif /* _EVENT_QUEUE_H_ */
diff --git a/sql/event_scheduler.cc b/sql/event_scheduler.cc
index 1b4a0d290e6..fc2ad75b272 100644
--- a/sql/event_scheduler.cc
+++ b/sql/event_scheduler.cc
@@ -17,7 +17,7 @@
#include "mysql_priv.h"
#include "events_priv.h"
#include "events.h"
-#include "event_timed.h"
+#include "event_data_objects.h"
#include "event_scheduler.h"
#include "sp_head.h"
diff --git a/sql/events.cc b/sql/events.cc
index b4e50cdedee..391ecd6ba16 100644
--- a/sql/events.cc
+++ b/sql/events.cc
@@ -17,7 +17,7 @@
#include "mysql_priv.h"
#include "events_priv.h"
#include "events.h"
-#include "event_timed.h"
+#include "event_data_objects.h"
#include "event_scheduler.h"
#include "sp.h"
#include "sp_head.h"
diff --git a/sql/share/errmsg.txt b/sql/share/errmsg.txt
index 476bc2f2f02..ac4f2dd9237 100644
--- a/sql/share/errmsg.txt
+++ b/sql/share/errmsg.txt
@@ -5839,3 +5839,6 @@ ER_CANT_ACTIVATE_LOG
eng "Cannot activate '%-.64s' log."
ER_RBR_NOT_AVAILABLE
eng "The server was not built with row-based replication"
+ER_EVENT_RECURSIVITY_FORBIDDEN
+ eng "Recursivity of EVENT DDL statements is forbidden when body is present"
+
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index 6e89b91ff4c..3ebf700b715 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -27,7 +27,7 @@
#include "sp.h"
#include "sp_cache.h"
#include "events.h"
-#include "event_timed.h"
+#include "event_data_objects.h"
#ifdef HAVE_OPENSSL
/*
diff --git a/sql/sql_show.cc b/sql/sql_show.cc
index 8776189b493..33fa9758c6c 100644
--- a/sql/sql_show.cc
+++ b/sql/sql_show.cc
@@ -27,7 +27,7 @@
#include "authors.h"
#include "contributors.h"
#include "events.h"
-#include "event_timed.h"
+#include "event_data_objects.h"
#include <my_dir.h>
#ifdef WITH_PARTITION_STORAGE_ENGINE
diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy
index 5d89e8a618b..e9e00828b7e 100644
--- a/sql/sql_yacc.yy
+++ b/sql/sql_yacc.yy
@@ -38,7 +38,7 @@
#include "sp_pcontext.h"
#include "sp_rcontext.h"
#include "sp.h"
-#include "event_timed.h"
+#include "event_data_objects.h"
#include <myisam.h>
#include <myisammrg.h>