summaryrefslogtreecommitdiff
path: root/sql/sp.cc
diff options
context:
space:
mode:
authorHe Zhenxing <zhenxing.he@sun.com>2010-01-24 15:03:23 +0800
committerHe Zhenxing <zhenxing.he@sun.com>2010-01-24 15:03:23 +0800
commit6bf8c119feff7e15d19aea0a6893b2706891d3c1 (patch)
tree30ea0d6bf62fef90f4f1499d15e388cb43241707 /sql/sp.cc
parenta365016f8b0cf007d40d12405a3b7b3990951ba2 (diff)
downloadmariadb-git-6bf8c119feff7e15d19aea0a6893b2706891d3c1.tar.gz
Backport Bug#37148 to 5.1
Diffstat (limited to 'sql/sp.cc')
-rw-r--r--sql/sp.cc13
1 files changed, 8 insertions, 5 deletions
diff --git a/sql/sp.cc b/sql/sp.cc
index 6fad1d70ffd..30896acd913 100644
--- a/sql/sp.cc
+++ b/sql/sp.cc
@@ -1105,9 +1105,10 @@ sp_create_routine(THD *thd, int type, sp_head *sp)
/* restore sql_mode when binloging */
thd->variables.sql_mode= saved_mode;
/* Such a statement can always go directly to binlog, no trans cache */
- thd->binlog_query(THD::MYSQL_QUERY_TYPE,
- log_query.c_ptr(), log_query.length(),
- FALSE, FALSE, 0);
+ if (thd->binlog_query(THD::MYSQL_QUERY_TYPE,
+ log_query.c_ptr(), log_query.length(),
+ FALSE, FALSE, 0))
+ ret= SP_INTERNAL_ERROR;
thd->variables.sql_mode= 0;
}
@@ -1166,7 +1167,8 @@ sp_drop_routine(THD *thd, int type, sp_name *name)
if (ret == SP_OK)
{
- write_bin_log(thd, TRUE, thd->query(), thd->query_length());
+ if (write_bin_log(thd, TRUE, thd->query(), thd->query_length()))
+ ret= SP_INTERNAL_ERROR;
sp_cache_invalidate();
}
@@ -1236,7 +1238,8 @@ sp_update_routine(THD *thd, int type, sp_name *name, st_sp_chistics *chistics)
if (ret == SP_OK)
{
- write_bin_log(thd, TRUE, thd->query(), thd->query_length());
+ if (write_bin_log(thd, TRUE, thd->query(), thd->query_length()))
+ ret= SP_INTERNAL_ERROR;
sp_cache_invalidate();
}