diff options
author | unknown <anozdrin/alik@alik.opbmk> | 2007-03-27 21:55:01 +0400 |
---|---|---|
committer | unknown <anozdrin/alik@alik.opbmk> | 2007-03-27 21:55:01 +0400 |
commit | 6a594ffd18f52b4bf825eed9714c94207235d22c (patch) | |
tree | fc43f9e275db5c513e8dee9c8c719dc0701586b7 /sql/sp_head.cc | |
parent | 21af9a55dd6b84b22e3ded4c8336330798bd225e (diff) | |
download | mariadb-git-6a594ffd18f52b4bf825eed9714c94207235d22c.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.
mysql-test/r/sp.result:
Updated result file.
mysql-test/t/sp.test:
Added test case for BUG#25082.
sql/mysql_priv.h:
1. Change mysql_change_db() prototype;
2. Polishing.
sql/sp.cc:
Polishing.
sql/sp_head.cc:
Polishing.
sql/sql_db.cc:
1. Polishing.
2. Fix mysql_change_db().
sql/sql_parse.cc:
Polishing.
sql/sql_show.cc:
Polishing.
Diffstat (limited to 'sql/sp_head.cc')
-rw-r--r-- | sql/sp_head.cc | 2 |
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", |