diff options
author | unknown <cbell/Chuck@mysql_cab_desk.> | 2007-03-26 09:57:16 -0400 |
---|---|---|
committer | unknown <cbell/Chuck@mysql_cab_desk.> | 2007-03-26 09:57:16 -0400 |
commit | ff1d6b2252b8502596e2f7365b9935a4c3b59112 (patch) | |
tree | eb834082bade798b379abe064b064f68b1949da4 /sql/events.cc | |
parent | 11aa04c993280023f46728f3ee57bf22a9adbb50 (diff) | |
parent | 62b41b5fbcf3fe8bd680e28e0064d3194daf4157 (diff) | |
download | mariadb-git-ff1d6b2252b8502596e2f7365b9935a4c3b59112.tar.gz |
Merge mysql_cab_desk.:C:/source/c++/mysql-5.1-new-rpl
into mysql_cab_desk.:C:/source/c++/mysql-5.1_WL_3629
BitKeeper/deleted/.del-init_db.sql~a77d572c39d5a1f8:
Auto merged
BitKeeper/deleted/.del-mysql_create_system_tables.sh:
Auto merged
scripts/mysql_system_tables_fix.sql:
Auto merged
sql/event_data_objects.cc:
Auto merged
sql/slave.cc:
Auto merged
sql/sql_parse.cc:
Auto merged
sql/sql_show.cc:
Auto merged
sql/sql_yacc.yy:
Auto merged
sql/event_data_objects.h:
Manual merge.
sql/event_queue.cc:
Manual merge.
sql/events.cc:
Manual merge.
Diffstat (limited to 'sql/events.cc')
-rw-r--r-- | sql/events.cc | 52 |
1 files changed, 50 insertions, 2 deletions
diff --git a/sql/events.cc b/sql/events.cc index f73dc97e7c2..fbb3828fa80 100644 --- a/sql/events.cc +++ b/sql/events.cc @@ -324,7 +324,15 @@ Events::create_event(THD *thd, Event_parse_data *parse_data, bool if_not_exists) DBUG_RETURN(TRUE); } + /* + Turn off row binlogging of this statement and use statement-based + so that all supporting tables are updated for CREATE EVENT command. + */ + if (thd->current_stmt_binlog_row_based) + thd->clear_current_stmt_binlog_row_based(); + pthread_mutex_lock(&LOCK_event_metadata); + /* On error conditions my_error() is called so no need to handle here */ if (!(ret= db_repository->create_event(thd, parse_data, if_not_exists))) { @@ -339,8 +347,16 @@ Events::create_event(THD *thd, Event_parse_data *parse_data, bool if_not_exists) DBUG_ASSERT(ret == OP_LOAD_ERROR); delete new_element; } - else + else /* Binlog the create event. */ + { event_queue->create_event(thd, new_element); + if (mysql_bin_log.is_open()) + { + thd->clear_error(); + thd->binlog_query(THD::MYSQL_QUERY_TYPE, + thd->query, thd->query_length, FALSE, FALSE); + } + } } pthread_mutex_unlock(&LOCK_event_metadata); @@ -382,7 +398,15 @@ Events::update_event(THD *thd, Event_parse_data *parse_data, sp_name *rename_to) DBUG_RETURN(TRUE); } + /* + Turn off row binlogging of this statement and use statement-based + so that all supporting tables are updated for UPDATE EVENT command. + */ + if (thd->current_stmt_binlog_row_based) + thd->clear_current_stmt_binlog_row_based(); + pthread_mutex_lock(&LOCK_event_metadata); + /* On error conditions my_error() is called so no need to handle here */ if (!(ret= db_repository->update_event(thd, parse_data, new_dbname, new_name))) { @@ -397,9 +421,17 @@ Events::update_event(THD *thd, Event_parse_data *parse_data, sp_name *rename_to) DBUG_ASSERT(ret == OP_LOAD_ERROR); delete new_element; } - else + else /* Binlog the alter event. */ + { event_queue->update_event(thd, parse_data->dbname, parse_data->name, new_element); + if (mysql_bin_log.is_open()) + { + thd->clear_error(); + thd->binlog_query(THD::MYSQL_QUERY_TYPE, + thd->query, thd->query_length, FALSE, FALSE); + } + } } pthread_mutex_unlock(&LOCK_event_metadata); @@ -434,10 +466,26 @@ Events::drop_event(THD *thd, LEX_STRING dbname, LEX_STRING name, bool if_exists) DBUG_RETURN(TRUE); } + /* + Turn off row binlogging of this statement and use statement-based so + that all supporting tables are updated for DROP EVENT command. + */ + if (thd->current_stmt_binlog_row_based) + thd->clear_current_stmt_binlog_row_based(); + pthread_mutex_lock(&LOCK_event_metadata); /* On error conditions my_error() is called so no need to handle here */ if (!(ret= db_repository->drop_event(thd, dbname, name, if_exists))) + { event_queue->drop_event(thd, dbname, name); + /* Binlog the drop event. */ + if (mysql_bin_log.is_open()) + { + thd->clear_error(); + thd->binlog_query(THD::MYSQL_QUERY_TYPE, + thd->query, thd->query_length, FALSE, FALSE); + } + } pthread_mutex_unlock(&LOCK_event_metadata); DBUG_RETURN(ret); } |