summaryrefslogtreecommitdiff
path: root/sql/sql_parse.cc
diff options
context:
space:
mode:
authorLuis Soares <luis.soares@sun.com>2009-02-10 11:52:19 +0100
committerLuis Soares <luis.soares@sun.com>2009-02-10 11:52:19 +0100
commitb7b6773f6967e3e8d0514cd09477d75d6485c85e (patch)
treed9bbba3758342d4930abd3b10d467ac170dc474d /sql/sql_parse.cc
parent8a98664d3b825f7d98d7acd8372079fc6224dfcb (diff)
downloadmariadb-git-b7b6773f6967e3e8d0514cd09477d75d6485c85e.tar.gz
BUG#13684: SP: DROP PROCEDURE|FUNCTION IF EXISTS not binlogged if routine does not exist
There is an inconsistency with DROP DATABASE IF EXISTS, DROP TABLE IF EXISTS and DROP VIEW IF EXISTS: those are binlogged even if the DB or TABLE does not exist, whereas DROP PROCEDURE IF EXISTS does not. It would be nice or at least consistent if DROP PROCEDURE/STATEMENT worked the same too. Fixed DROP PROCEDURE|FUNCTION IF EXISTS by adding a call to write_bin_log in mysql_execute_command. Checked also if all documented "DROP (...) IF EXISTS" get binlogged. Left out DROP SERVER IF EXISTS because it seems that it only gets binlogged when using row event (see BUG#25705).
Diffstat (limited to 'sql/sql_parse.cc')
-rw-r--r--sql/sql_parse.cc1
1 files changed, 1 insertions, 0 deletions
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index 592dbe9f43b..7c5f469da41 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -4427,6 +4427,7 @@ create_sp_error:
case SP_KEY_NOT_FOUND:
if (lex->drop_if_exists)
{
+ write_bin_log(thd, TRUE, thd->query, thd->query_length);
push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_NOTE,
ER_SP_DOES_NOT_EXIST, ER(ER_SP_DOES_NOT_EXIST),
SP_COM_STRING(lex), lex->spname->m_name.str);