diff options
author | unknown <msvensson@neptunus.(none)> | 2006-02-21 13:21:17 +0100 |
---|---|---|
committer | unknown <msvensson@neptunus.(none)> | 2006-02-21 13:21:17 +0100 |
commit | 15c37025987829150a164ed93dcf0aa7f9c675cf (patch) | |
tree | 82c30b06d5a28bc8d05f2bc2137d3e3a2375657a /mysql-test/t/mysqldump.test | |
parent | db5fe0fc9772d9ab74d12d735cb67ca2fcb8721d (diff) | |
download | mariadb-git-15c37025987829150a164ed93dcf0aa7f9c675cf.tar.gz |
Bug#14871 mysqldump: invalid view dump output
- Add comments with embeded veriosn info around the parts of the view syntax that are only supported by a certain version of MySQL Server
client/mysqldump.c:
Use information_schema.views to gather information about the view, then replace some parts of the output from "SHOW CREATE VIEW" with comment markers with version, to make thos parts of the view syntax become parsed only of MySQL servers that supports it.
Create common function "open_sql_file_for_table" to open the individual .sql file where to dump the table or view.
mysql-test/r/mysqldump.result:
Update results
mysql-test/t/mysqldump.test:
Add test to see that views can be deumped and reloaded alos when they contain "SECURITY TYPE", "CHECK OPTION" and "DEFINER"
Diffstat (limited to 'mysql-test/t/mysqldump.test')
-rw-r--r-- | mysql-test/t/mysqldump.test | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/mysql-test/t/mysqldump.test b/mysql-test/t/mysqldump.test index e54bf6386c5..95fc1757ad5 100644 --- a/mysql-test/t/mysqldump.test +++ b/mysql-test/t/mysqldump.test @@ -1036,3 +1036,33 @@ insert into t1 values ('',''); drop table t1; # End of 4.1 tests + +# +# Bug 14871 Invalid view dump output +# + +create table t1 (a int); +insert into t1 values (289), (298), (234), (456), (789); +create definer = CURRENT_USER view v1 as select * from t1; +create SQL SECURITY INVOKER view v2 as select * from t1; +create view v3 as select * from t1 with local check option; +create algorithm=merge view v4 as select * from t1 with cascaded check option; +create algorithm =temptable view v5 as select * from t1; + +# dump tables and views +--exec $MYSQL_DUMP test > var/tmp/bug14871.sql + +# drop the db, tables and views +drop table t1; +drop view v1, v2, v3, v4, v5; + +# Reload dump +--exec $MYSQL test < var/tmp/bug14871.sql + +# check that all tables and views could be created +show tables; +select * from v3 order by a; + +drop table t1; +drop view v1, v2, v3, v4, v5; + |