summaryrefslogtreecommitdiff
path: root/mysql-test/t/mysqldump.test
diff options
context:
space:
mode:
authorunknown <iggy@recycle.(none)>2007-03-27 12:31:44 -0400
committerunknown <iggy@recycle.(none)>2007-03-27 12:31:44 -0400
commit609277f942e5479976d5a1f31da55fd2cf646109 (patch)
tree57f840a64dcaba1c657b2edea554107300c6653b /mysql-test/t/mysqldump.test
parent65c34cc855ea75b1f790e738e71d304ca72403ae (diff)
downloadmariadb-git-609277f942e5479976d5a1f31da55fd2cf646109.tar.gz
Bug#23491 MySQLDump prefix function call in a view by database name
- mysqldump executes a SHOW CREATE VIEW statement to generate the text that it outputs. When the function name is retrieved it's database name is unconditionally prepended. This change causes the function's database name to be prepended only when it was used to define the function. mysql-test/r/information_schema.result: Bug#23491 MySQLDump prefix function call in a view by database name - Updated Results. mysql-test/r/mysqldump.result: Bug#23491 MySQLDump prefix function call in a view by database name - Added new results. mysql-test/r/sp-code.result: Bug#23491 MySQLDump prefix function call in a view by database name - Updated Results. mysql-test/r/udf.result: Bug#23491 MySQLDump prefix function call in a view by database name - Updated Results. mysql-test/t/mysqldump.test: Bug#23491 MySQLDump prefix function call in a view by database name - Added new testcase. sql/item_func.cc: Bug#23491 MySQLDump prefix function call in a view by database name - Use new m_explicit_name member when deciding whether or not to prepend the db name while building the function name. sql/sp.cc: Bug#23491 MySQLDump prefix function call in a view by database name - Use new sp_name constructor. sql/sp_head.h: Bug#23491 MySQLDump prefix function call in a view by database name - Add m_explicit_name member to sp_name object. - Redefined sp_name constructor to include new member. sql/sql_yacc.yy: Bug#23491 MySQLDump prefix function call in a view by database name - Use new sp_name constructors.
Diffstat (limited to 'mysql-test/t/mysqldump.test')
-rw-r--r--mysql-test/t/mysqldump.test32
1 files changed, 32 insertions, 0 deletions
diff --git a/mysql-test/t/mysqldump.test b/mysql-test/t/mysqldump.test
index 31741cdba9f..d1d3aae5eb7 100644
--- a/mysql-test/t/mysqldump.test
+++ b/mysql-test/t/mysqldump.test
@@ -1430,5 +1430,37 @@ INSERT INTO t1 VALUES(1,0xff00fef0);
DROP TABLE t1;
--echo #
+--echo # Bug #23491: MySQLDump prefix function call in a view by database name
+--echo #
+
+# Setup
+create database bug23491_original;
+create database bug23491_restore;
+use bug23491_original;
+create table t1 (c1 int);
+create view v1 as select * from t1;
+create procedure p1() select 1;
+create function f1() returns int return 1;
+create view v2 as select f1();
+create function f2() returns int return f1();
+create view v3 as select bug23491_original.f1();
+
+# Backup.
+--exec $MYSQL_DUMP --skip-comments -uroot --opt --routines bug23491_original > $MYSQLTEST_VARDIR/tmp/bug23491_backup.sql;
+
+# Restore.
+--exec $MYSQL bug23491_restore < $MYSQLTEST_VARDIR/tmp/bug23491_backup.sql;
+
+# Verify
+use bug23491_restore;
+show create view bug23491_restore.v2;
+show create view bug23491_restore.v3;
+
+# Cleanup
+drop database bug23491_original;
+drop database bug23491_restore;
+use test;
+
+--echo #
--echo # End of 5.0 tests
--echo #