summaryrefslogtreecommitdiff
path: root/sql/sql_udf.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/sql_udf.cc')
-rw-r--r--sql/sql_udf.cc10
1 files changed, 8 insertions, 2 deletions
diff --git a/sql/sql_udf.cc b/sql/sql_udf.cc
index 57c9110405a..d0e446fb157 100644
--- a/sql/sql_udf.cc
+++ b/sql/sql_udf.cc
@@ -531,8 +531,11 @@ int mysql_create_function(THD *thd,udf_func *udf)
/* Binlog the create function. */
if (write_bin_log(thd, TRUE, thd->query(), thd->query_length()))
+ {
+ /* Restore the state of binlog format */
+ thd->current_stmt_binlog_row_based= save_binlog_row_based;
DBUG_RETURN(1);
-
+ }
/* Restore the state of binlog format */
thd->current_stmt_binlog_row_based= save_binlog_row_based;
DBUG_RETURN(0);
@@ -612,8 +615,11 @@ int mysql_drop_function(THD *thd,const LEX_STRING *udf_name)
/* Binlog the drop function. */
if (write_bin_log(thd, TRUE, thd->query(), thd->query_length()))
+ {
+ /* Restore the state of binlog format */
+ thd->current_stmt_binlog_row_based= save_binlog_row_based;
DBUG_RETURN(1);
-
+ }
/* Restore the state of binlog format */
thd->current_stmt_binlog_row_based= save_binlog_row_based;
DBUG_RETURN(0);