summaryrefslogtreecommitdiff
path: root/mysql-test/r/sp.result
diff options
context:
space:
mode:
authorunknown <anozdrin/alik@alik.opbmk>2007-03-27 21:55:01 +0400
committerunknown <anozdrin/alik@alik.opbmk>2007-03-27 21:55:01 +0400
commit6a594ffd18f52b4bf825eed9714c94207235d22c (patch)
treefc43f9e275db5c513e8dee9c8c719dc0701586b7 /mysql-test/r/sp.result
parent21af9a55dd6b84b22e3ded4c8336330798bd225e (diff)
downloadmariadb-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 'mysql-test/r/sp.result')
-rw-r--r--mysql-test/r/sp.result15
1 files changed, 15 insertions, 0 deletions
diff --git a/mysql-test/r/sp.result b/mysql-test/r/sp.result
index ddd2369d36d..6773facb641 100644
--- a/mysql-test/r/sp.result
+++ b/mysql-test/r/sp.result
@@ -5969,6 +5969,21 @@ SUM(f2) bug25373(f1)
21.300000071526 NULL
DROP FUNCTION bug25373|
DROP TABLE t3|
+DROP DATABASE IF EXISTS mysqltest1|
+DROP DATABASE IF EXISTS mysqltest2|
+CREATE DATABASE mysqltest1|
+CREATE DATABASE mysqltest2|
+CREATE PROCEDURE mysqltest1.p1()
+DROP DATABASE mysqltest2|
+use mysqltest2|
+CALL mysqltest1.p1()|
+Warnings:
+Note 1049 Unknown database 'mysqltest2'
+SELECT DATABASE()|
+DATABASE()
+NULL
+DROP DATABASE mysqltest1|
+use test|
drop table t1,t2;
CREATE TABLE t1 (a int auto_increment primary key) engine=MyISAM;
CREATE TABLE t2 (a int auto_increment primary key, b int) engine=innodb;