diff options
author | unknown <cbell/Chuck@mysql_cab_desk.> | 2007-03-29 09:54:59 -0400 |
---|---|---|
committer | unknown <cbell/Chuck@mysql_cab_desk.> | 2007-03-29 09:54:59 -0400 |
commit | 4a0f5887b71ca3bda0d06e5d0641f985a0ca679a (patch) | |
tree | b882e0f7e923a5f2e63a816eb86059d4de1a3abd /sql/sql_udf.cc | |
parent | cbbb40346ffaed733ba9784c7ee9f461667d45fd (diff) | |
parent | 7e43b1f586142693a9b1ec1cf5ac92e6a38a3190 (diff) | |
download | mariadb-git-4a0f5887b71ca3bda0d06e5d0641f985a0ca679a.tar.gz |
Merge cbell@bk-internal.mysql.com:/home/bk/mysql-5.1-new-rpl
into mysql_cab_desk.:C:/source/c++/mysql-5.1-new-rpl
mysql-test/t/events.test:
Auto merged
sql/event_queue.cc:
Auto merged
sql/events.cc:
Auto merged
sql/lex.h:
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
BitKeeper/deleted/.del-init_db.sql~a77d572c39d5a1f8:
WL#3629 : Replication of Invocation and Invoked Features
Manual merge prior to pushing patches.
BitKeeper/deleted/.del-mysql_create_system_tables.sh:
WL#3629 : Replication of Invocation and Invoked Features
Manual merge prior to pushing patches.
mysql-test/r/events.result:
WL#3629 : Replication of Invocation and Invoked Features
Manual merge prior to pushing patches.
mysql-test/r/events_grant.result:
WL#3629 : Replication of Invocation and Invoked Features
Manual merge prior to pushing patches.
mysql-test/r/events_restart_phase1.result:
WL#3629 : Replication of Invocation and Invoked Features
Manual merge prior to pushing patches.
mysql-test/r/system_mysql_db.result:
WL#3629 : Replication of Invocation and Invoked Features
Manual merge prior to pushing patches.
mysql-test/t/events_restart_phase1.test:
WL#3629 : Replication of Invocation and Invoked Features
Manual merge prior to pushing patches.
scripts/mysql_system_tables.sql:
WL#3629 : Replication of Invocation and Invoked Features
Manual merge prior to pushing patches.
scripts/mysql_system_tables_fix.sql:
WL#3629 : Replication of Invocation and Invoked Features
Manual merge prior to pushing patches.
sql/event_data_objects.cc:
WL#3629 : Replication of Invocation and Invoked Features
Manual merge prior to pushing patches.
sql/event_data_objects.h:
WL#3629 : Replication of Invocation and Invoked Features
Manual merge prior to pushing patches.
sql/event_db_repository.cc:
WL#3629 : Replication of Invocation and Invoked Features
Manual merge prior to pushing patches.
sql/event_db_repository.h:
WL#3629 : Replication of Invocation and Invoked Features
Manual merge prior to pushing patches.
sql/sql_udf.cc:
WL#3629 : Replication of Invocation and Invoked Features
Manual merge prior to pushing patches.
Diffstat (limited to 'sql/sql_udf.cc')
-rw-r--r-- | sql/sql_udf.cc | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/sql/sql_udf.cc b/sql/sql_udf.cc index 4c584bff72a..da5c1b0bc66 100644 --- a/sql/sql_udf.cc +++ b/sql/sql_udf.cc @@ -403,6 +403,13 @@ int mysql_create_function(THD *thd,udf_func *udf) DBUG_RETURN(1); } + /* + Turn off row binlogging of this statement and use statement-based + so that all supporting tables are updated for CREATE FUNCTION command. + */ + if (thd->current_stmt_binlog_row_based) + thd->clear_current_stmt_binlog_row_based(); + rw_wrlock(&THR_LOCK_udf); if ((hash_search(&udf_hash,(byte*) udf->name.str, udf->name.length))) { @@ -466,6 +473,15 @@ int mysql_create_function(THD *thd,udf_func *udf) goto err; } rw_unlock(&THR_LOCK_udf); + + /* Binlog the create function. */ + if (mysql_bin_log.is_open()) + { + thd->clear_error(); + thd->binlog_query(THD::MYSQL_QUERY_TYPE, + thd->query, thd->query_length, FALSE, FALSE); + } + DBUG_RETURN(0); err: @@ -484,11 +500,20 @@ int mysql_drop_function(THD *thd,const LEX_STRING *udf_name) char *exact_name_str; uint exact_name_len; DBUG_ENTER("mysql_drop_function"); + if (!initialized) { my_message(ER_OUT_OF_RESOURCES, ER(ER_OUT_OF_RESOURCES), MYF(0)); DBUG_RETURN(1); } + + /* + Turn off row binlogging of this statement and use statement-based + so that all supporting tables are updated for DROP FUNCTION command. + */ + if (thd->current_stmt_binlog_row_based) + thd->clear_current_stmt_binlog_row_based(); + rw_wrlock(&THR_LOCK_udf); if (!(udf=(udf_func*) hash_search(&udf_hash,(byte*) udf_name->str, (uint) udf_name->length))) @@ -524,6 +549,15 @@ int mysql_drop_function(THD *thd,const LEX_STRING *udf_name) close_thread_tables(thd); rw_unlock(&THR_LOCK_udf); + + /* Binlog the drop function. */ + if (mysql_bin_log.is_open()) + { + thd->clear_error(); + thd->binlog_query(THD::MYSQL_QUERY_TYPE, + thd->query, thd->query_length, FALSE, FALSE); + } + DBUG_RETURN(0); err: rw_unlock(&THR_LOCK_udf); |