summaryrefslogtreecommitdiff
path: root/sql/sql_db.cc
diff options
context:
space:
mode:
authorunknown <mkindahl@dl145h.mysql.com>2007-11-16 15:55:22 +0100
committerunknown <mkindahl@dl145h.mysql.com>2007-11-16 15:55:22 +0100
commit211383388e65e4cacb371fac9c56eed86bb396c5 (patch)
treed5ee1dd616c0b74ef0c99eb5a0ee47d35d876ea3 /sql/sql_db.cc
parent8f798dffea964598eed2a02ed6cfcb7ba7c0fb6e (diff)
downloadmariadb-git-211383388e65e4cacb371fac9c56eed86bb396c5.tar.gz
Bug#32435:
DROP DATABASE statement writes changes to mysql.proc table under RBR When replicating a DROP DATABASE statement with a database holding stored procedures, the changes to the mysql.proc table was recorded in the binary log under row-based replication. With this patch, the thread uses statement-logging format for the duration of the DROP DATABASE statement. The logging format is (already) reset at the end of the statement, so no additional code for resetting the logging format is necessary. sql/sql_db.cc: Clearing the row-based statement flag for the DROP DATABASE statement since it should always be replicated as a statement. mysql-test/extra/binlog_tests/database.test: New BitKeeper file ``mysql-test/extra/binlog_tests/database.test'' mysql-test/suite/binlog/r/binlog_database.result: New BitKeeper file ``mysql-test/suite/binlog/r/binlog_database.result'' mysql-test/suite/binlog/t/binlog_database.test: New BitKeeper file ``mysql-test/suite/binlog/t/binlog_database.test''
Diffstat (limited to 'sql/sql_db.cc')
-rw-r--r--sql/sql_db.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/sql/sql_db.cc b/sql/sql_db.cc
index abbf2131957..ad4e0d803eb 100644
--- a/sql/sql_db.cc
+++ b/sql/sql_db.cc
@@ -883,6 +883,13 @@ bool mysql_rm_db(THD *thd,char *db,bool if_exists, bool silent)
VOID(pthread_mutex_lock(&LOCK_mysql_create_db));
+ /*
+ This statement will be replicated as a statement, even when using
+ row-based replication. The flag will be reset at the end of the
+ statement.
+ */
+ thd->clear_current_stmt_binlog_row_based();
+
length= build_table_filename(path, sizeof(path), db, "", "", 0);
strmov(path+length, MY_DB_OPT_FILE); // Append db option file name
del_dbopt(path); // Remove dboption hash entry