summaryrefslogtreecommitdiff
path: root/sql/sp_head.cc
diff options
context:
space:
mode:
authoranozdrin/alik@alik.opbmk <>2007-03-27 21:55:01 +0400
committeranozdrin/alik@alik.opbmk <>2007-03-27 21:55:01 +0400
commitcc83bb07845eede90a713d93ae332a885dc0519b (patch)
treefc43f9e275db5c513e8dee9c8c719dc0701586b7 /sql/sp_head.cc
parentf18d5d04f814c2ddaf2b3ab6b4b5f4c354e11c07 (diff)
downloadmariadb-git-cc83bb07845eede90a713d93ae332a885dc0519b.tar.gz
Fix for BUG#25082: default database change on trigger
execution breaks replication. When a stored routine is executed, we switch current database to the database, in which the routine has been created. When the stored routine finishes, we switch back to the original database. The problem was that if the original database does not exist (anymore) after routine execution, we raised an error. The fix is to report a warning, and switch to the NULL database.
Diffstat (limited to 'sql/sp_head.cc')
-rw-r--r--sql/sp_head.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/sql/sp_head.cc b/sql/sp_head.cc
index 9d7fc55ff70..bba231ba685 100644
--- a/sql/sp_head.cc
+++ b/sql/sp_head.cc
@@ -1130,7 +1130,7 @@ sp_head::execute(THD *thd)
(It would generate an error from mysql_change_db() when old_db=="")
*/
if (! thd->killed)
- err_status|= mysql_change_db(thd, old_db.str, 1);
+ err_status|= mysql_change_db(thd, &old_db, TRUE);
}
m_flags&= ~IS_INVOKED;
DBUG_PRINT("info",