summaryrefslogtreecommitdiff
path: root/sql/event_data_objects.h
diff options
context:
space:
mode:
authorunknown <cbell/Chuck@mysql_cab_desk.>2007-03-16 09:56:57 -0400
committerunknown <cbell/Chuck@mysql_cab_desk.>2007-03-16 09:56:57 -0400
commit62b41b5fbcf3fe8bd680e28e0064d3194daf4157 (patch)
tree15f703b3b46120a527b00e8e328eb91286163cec /sql/event_data_objects.h
parent9a14d8832246a78995657efc7f7564dbc65c0559 (diff)
downloadmariadb-git-62b41b5fbcf3fe8bd680e28e0064d3194daf4157.tar.gz
WL#3629 - Replication of Invocation and Invoked Features
This changeset adds replication of events and user-defined functions. There are several bug reports involved in this change: BUG#16421, BUG#17857, BUG#20384: This patch modifies the mysql.events table to permit the addition of another enum value for the status column. The column now has values of ('DISABLED','SLAVESIDE_DISABLED','ENABLED'). A status of SLAVESIDE_DISABLED is set on the slave during replication of events. This enables users to determine which events werereplicated from the master and to later enable them if they promote the slave to a master. The CREATE, ALTER, and DROP statements are binlogged. A new test was added for replication of events (rpl_events). BUG#17671: This patch modifies the code to permit logging of user-defined functions. Note: this is the CREATE FUNCTION ... SONAME variety. A more friendly error message to be displayed should a replicated user-defined function not be found in the loadable library or if the library is missing from the slave.The CREATE andDROP statements are binlogged. A new test was added for replication of user-defined functions (rpl_udf). The patch also adds a new column to the mysql.event table named 'originator' that is used to store the server_id of the server that the event originated on. This enables users to promote a slave to a master and later return the promoted slave to a slave and disable the replicated events. mysql-test/lib/init_db.sql: WL#3629 - Replication of Invocation and Invoked Feature This patch adds the SLAVESIDE_DISABLED to the list of enumerated values for the mysql.event table. This patch adds the column 'originator' to the mysql.event table. mysql-test/r/events.result: WL#3629 - Replication of Invocation and Invoked Feature This patch adds the 'originator' column to the events test results. This was necessary to ensure the manual insert into mysql.event table succeeds because the originator column is set to NOT NULL. mysql-test/r/events_grant.result: WL#3629 - Replication of Invocation and Invoked Feature This patch adds the 'originator' column to the events_grant test results. This was necessary to ensure the manual insert into mysql.event table succeeds because the originator column is set to NOT NULL. mysql-test/r/events_restart_phase1.result: WL#3629 - Replication of Invocation and Invoked Feature This patch adds the 'originator' column to the events_restart_phase1 test results. This was necessary to ensure the manual insert into mysql.event table succeeds because the originator column is set to NOT NULL. mysql-test/r/system_mysql_db.result: WL#3629 - Replication of Invocation and Invoked Feature This patch adds the SLAVESIDE_DISABLED to the list of enumerated values for the mysql.event table. This patch adds the column 'originator' to the mysql.event table. These changes to the result file were necessary to ensure correct test results. mysql-test/t/events.test: WL#3629 - Replication of Invocation and Invoked Feature This patch adds the 'originator' column to the events test. This was necessary to ensure the manual insert into mysql.event table succeeds because the originator column is set to NOT NULL. mysql-test/t/events_restart_phase1.test: WL#3629 - Replication of Invocation and Invoked Feature This patch adds the 'originator' column to the events_restart_phase1 test. This was necessary to ensure the manual insert into mysql.event table succeeds because the originator column is set to NOT NULL. scripts/mysql_create_system_tables.sh: WL#3629 - Replication of Invocation and Invoked Feature This patch adds the SLAVESIDE_DISABLED to the list of enumerated values for the mysql.event table. This patch adds the column 'originator' to the mysql.event table. scripts/mysql_fix_privilege_tables.sql: WL#3629 - Replication of Invocation and Invoked Feature This patch adds the SLAVESIDE_DISABLED to the list of enumerated values for the mysql.event table. This patch adds the column 'originator' to the mysql.event table. sql/event_data_objects.cc: WL#3629 - Replication of Invocation and Invoked Features This patch modifies the code to permit processing of the new enum SLAVESIDE_DISABLED which is set on the slave during replication of events. This patch uses the new Event_basic:: enumerated values. sql/event_data_objects.h: WL#3629 - Replication of Invocation and Invoked Features This patch moves the duplicated enumeration values for ENABLED, SLAVESIDE_DISABLED, and DISABLED to the Event_basic class removing them from the other Event_* classes. sql/event_db_repository.cc: WL#3629 - Replication of Invocation and Invoked Features This patch modifies the code to permit processing of the new enum SLAVESIDE_DISABLED which is set on the slave during replication of events. The patch also adds a new column to the mysql.event table named 'originator' that is used to store the server_id of the server that the event originated on. This enables users to promote a slave to a master and later return the promoted slave to a slave and disable the replicated events. sql/event_db_repository.h: WL#3629 - Replication of Invocation and Invoked Features This patch modifies the code to add a new field named 'originator' to the enum_event_table_field and associated structure. sql/event_queue.cc: WL#3629 - Replication of Invocation and Invoked Features This patch modifies the code to permit processing of the new enum SLAVESIDE_DISABLED which is set on the slave during replication of events. sql/events.cc: WL#3629 - Replication of Invocation and Invoked Features This patch modifies the code to permit processing of the new enum SLAVESIDE_DISABLED which is set on the slave during replication of events. sql/lex.h: WL#3629 - Replication of Invocation and Invoked Features This patch modifies the code to add the new SLAVESIDE_DISABLE symbol to the lexical parser. sql/slave.cc: WL#3629 - Replication of Invocation and Invoked Features This patch modifies the code to permit the capture of the error on the slave when a UDF from a loadable library is not loaded on the server when replicated from the master. sql/sql_parse.cc: WL#3629 - Replication of Invocation and Invoked Features This patch removes the comment because drop functions commands are replicated. sql/sql_show.cc: WL#3629 - Replication of Invocation and Invoked Features This patch modifies the code to permit processing of the new enum SLAVESIDE_DISABLED which is set on the slave during replication of events. The code also adds changes the display width of the status column for the schema table for the show events command and also adds the new column 'originator' to the events_field_info structure. sql/sql_udf.cc: WL#3629 - Replication of Invocation and Invoked Features This patch modifies the code to add the binlogging of the create and drop function events. sql/sql_yacc.yy: WL#3629 - Replication of Invocation and Invoked Features This patch modifies the code to change the enumeration of the status column for the events in the parser. The code uses the Event_basic:: enumerations allowing the enums to be defined in one place. mysql-test/t/rpl_events.test: WL#3629 - Replication of Invocation and Invoked Features This patch adds a new test for testing replication of events. The test uses include files so that the test can test under both RBR and SBR. mysql-test/r/rpl_events.result: WL#3629 - Replication of Invocation and Invoked Features This patch adds a new result file for testing replication of events. mysql-test/r/rpl_udf.result: WL#3629 - Replication of Invocation and Invoked Features This patch adds a new result file for testing replication of UDFs. mysql-test/t/rpl_udf.test: WL#3629 - Replication of Invocation and Invoked Features This patch adds a new test for testing replication of UDFs. The test uses include files so that the test can test under both RBR and SBR. mysql-test/include/rpl_events.inc: WL#3629 - Replication of Invocation and Invoked Features This patch adds a new include file for testing replication of events. This file contains the core test procedures. mysql-test/include/rpl_udf.inc: WL#3629 - Replication of Invocation and Invoked Features This patch adds a new include file for testing replication of UDFs. This file contains the core test procedures.
Diffstat (limited to 'sql/event_data_objects.h')
-rw-r--r--sql/event_data_objects.h53
1 files changed, 25 insertions, 28 deletions
diff --git a/sql/event_data_objects.h b/sql/event_data_objects.h
index e00b0b94eaf..a63340e67c8 100644
--- a/sql/event_data_objects.h
+++ b/sql/event_data_objects.h
@@ -22,17 +22,33 @@
#define EVEX_BAD_PARAMS -5
#define EVEX_MICROSECOND_UNSUP -6
-
class sp_head;
class Sql_alloc;
-
class Event_basic
{
protected:
MEM_ROOT mem_root;
public:
+ /*
+ ENABLED = feature can function normally (is turned on)
+ SLAVESIDE_DISABLED = feature is turned off on slave
+ DISABLED = feature is turned off
+ */
+ enum enum_status
+ {
+ ENABLED = 1,
+ DISABLED,
+ SLAVESIDE_DISABLED
+ };
+
+ enum enum_on_completion
+ {
+ ON_COMPLETION_DROP = 1,
+ ON_COMPLETION_PRESERVE
+ };
+
LEX_STRING dbname;
LEX_STRING name;
LEX_STRING definer;// combination of user and host
@@ -57,20 +73,9 @@ protected:
bool last_executed_changed;
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;
+ int on_completion;
+ int status;
+ longlong originator;
TIME last_executed;
TIME execute_at;
@@ -194,19 +199,10 @@ private:
class Event_parse_data : public Sql_alloc
{
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;
+ int on_completion;
+ int status;
+ longlong originator;
const uchar *body_begin;
@@ -268,6 +264,7 @@ private:
report_bad_value(const char *item_name, Item *bad_item);
Event_parse_data(const Event_parse_data &); /* Prevent use of these */
+ void Event_parse_data::check_originator_id(THD *thd);
void operator=(Event_parse_data &);
};