summaryrefslogtreecommitdiff
path: root/sql/sp.cc
diff options
context:
space:
mode:
authorLeonard Zhou <leonard@mysql.com>2009-02-28 09:35:18 +0800
committerLeonard Zhou <leonard@mysql.com>2009-02-28 09:35:18 +0800
commit63c9bb320f9541898142a170a1b8c8bcb76a354e (patch)
treea85444d1ff16d917ed93250b86780191db0dfc48 /sql/sp.cc
parentd61f114f7f753e8443d48190826f121662066967 (diff)
downloadmariadb-git-63c9bb320f9541898142a170a1b8c8bcb76a354e.tar.gz
BUG#39526 sql_mode not retained in binary log for CREATE PROCEDURE
Set wrong sql_mode when creating a procedure. So that the sql_mode can't be writen into binary log correctly. Restore the current session sql_mode right before generating the binlog event when creating a procedure. mysql-test/suite/binlog/r/binlog_sql_mode.result: Test result mysql-test/suite/binlog/t/binlog_sql_mode.test: Test file for sql_mode testing sql/sp.cc: Restore the current session sql_mode right before generating the binlog event.
Diffstat (limited to 'sql/sp.cc')
-rw-r--r--sql/sp.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/sql/sp.cc b/sql/sp.cc
index cc545992857..b2c7c389136 100644
--- a/sql/sp.cc
+++ b/sql/sp.cc
@@ -936,10 +936,12 @@ sp_create_routine(THD *thd, int type, sp_head *sp)
ret= SP_INTERNAL_ERROR;
goto done;
}
-
+ /* 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);
+ thd->variables.sql_mode= 0;
}
}