diff options
Diffstat (limited to 'sql/sql_db.cc')
-rw-r--r-- | sql/sql_db.cc | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sql/sql_db.cc b/sql/sql_db.cc index ad4e0d803eb..d425510320e 100644 --- a/sql/sql_db.cc +++ b/sql/sql_db.cc @@ -921,6 +921,8 @@ bool mysql_rm_db(THD *thd,char *db,bool if_exists, bool silent) { ha_drop_database(path); query_cache_invalidate1(db); + (void) sp_drop_db_routines(thd, db); /* @todo Do not ignore errors */ + Events::drop_schema_events(thd, db); error = 0; } } @@ -956,6 +958,7 @@ bool mysql_rm_db(THD *thd,char *db,bool if_exists, bool silent) /* These DDL methods and logging protected with LOCK_mysql_create_db */ mysql_bin_log.write(&qinfo); } + thd->clear_error(); thd->server_status|= SERVER_STATUS_DB_DROPPED; send_ok(thd, (ulong) deleted); thd->server_status&= ~SERVER_STATUS_DB_DROPPED; @@ -999,8 +1002,6 @@ bool mysql_rm_db(THD *thd,char *db,bool if_exists, bool silent) } exit: - (void)sp_drop_db_routines(thd, db); /* QQ Ignore errors for now */ - Events::drop_schema_events(thd, db); /* If this database was the client's selected database, we silently change the client's selected database to nothing (to have an empty |