From c2119709c6bd09ff7c49ee4cbda23c853d4809dd Mon Sep 17 00:00:00 2001 From: "cmiller@zippy.cornsilk.net" <> Date: Fri, 20 Oct 2006 17:44:03 -0400 Subject: [PATCH] Fix bad merge from #14262. --- sql/sql_trigger.cc | 2 +- sql/sql_view.cc | 13 ++++++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/sql/sql_trigger.cc b/sql/sql_trigger.cc index 61d2992ed1b..70053e54df0 100644 --- a/sql/sql_trigger.cc +++ b/sql/sql_trigger.cc @@ -284,7 +284,7 @@ end: thd->clear_error(); /* Such a statement can always go directly to binlog, no trans cache. */ - thd->binlog_query(THD::MYSQL_QUERY_TYPE, + thd->binlog_query(THD::MYSQL_STMT_TYPE, stmt_query.ptr(), stmt_query.length(), FALSE, FALSE); } } diff --git a/sql/sql_view.cc b/sql/sql_view.cc index 79ecf12cf27..e3951e78df8 100644 --- a/sql/sql_view.cc +++ b/sql/sql_view.cc @@ -1425,23 +1425,34 @@ bool mysql_drop_view(THD *thd, TABLE_LIST *views, enum_drop_mode drop_mode) thd->query, thd->query_length, FALSE, FALSE); } - VOID(pthread_mutex_unlock(&LOCK_open)); if (error) { + VOID(pthread_mutex_unlock(&LOCK_open)); DBUG_RETURN(TRUE); } if (wrong_object_name) { + VOID(pthread_mutex_unlock(&LOCK_open)); my_error(ER_WRONG_OBJECT, MYF(0), wrong_object_db, wrong_object_name, "VIEW"); DBUG_RETURN(TRUE); } if (non_existant_views.length()) { + VOID(pthread_mutex_unlock(&LOCK_open)); my_error(ER_BAD_TABLE_ERROR, MYF(0), non_existant_views.c_ptr()); DBUG_RETURN(TRUE); } + + if (mysql_bin_log.is_open()) + { + thd->clear_error(); + thd->binlog_query(THD::STMT_QUERY_TYPE, + thd->query, thd->query_length, FALSE, FALSE); + } + send_ok(thd); + VOID(pthread_mutex_unlock(&LOCK_open)); DBUG_RETURN(FALSE); }