#At file:///export/home/tmp/rpl/wl4568/mysql-6.0-backup/
2700 Hema Sridharan 2008-09-27
WL#4568 Moving all backup tests from main to backup suite
removed:
mysql-test/r/backup_timeout.result
mysql-test/r/backup_triggers_and_events.result
mysql-test/r/backup_view_on_view.result
mysql-test/r/backup_views.result
mysql-test/t/backup_timeout.test
mysql-test/t/backup_triggers_and_events.test
mysql-test/t/backup_view_on_view.test
mysql-test/t/backup_views.test
added:
mysql-test/suite/backup/r/backup_timeout.result
mysql-test/suite/backup/r/backup_triggers_and_events.result
mysql-test/suite/backup/r/backup_view_on_view.result
mysql-test/suite/backup/r/backup_views.result
mysql-test/suite/backup/t/backup_timeout.test
mysql-test/suite/backup/t/backup_triggers_and_events.test
mysql-test/suite/backup/t/backup_view_on_view.test
mysql-test/suite/backup/t/backup_views.test
mysql-test/suite/backup/t/disabled.def
=== removed file 'mysql-test/r/backup_timeout.result'
--- a/mysql-test/r/backup_timeout.result 2008-08-19 15:35:29 +0000
+++ b/mysql-test/r/backup_timeout.result 1970-01-01 00:00:00 +0000
@@ -1,73 +0,0 @@
-SET DEBUG_SYNC= 'reset';
-DROP DATABASE IF EXISTS bup_ddl_blocker;
-CREATE DATABASE bup_ddl_blocker;
-con1: Creating tables
-CREATE TABLE bup_ddl_blocker.t1 (col_a CHAR(40)) ENGINE=INNODB;
-con1: Loading data
-INSERT INTO bup_ddl_blocker.t1 VALUES ("01 Some data to test");
-INSERT INTO bup_ddl_blocker.t1 VALUES ("02 Some data to test");
-INSERT INTO bup_ddl_blocker.t1 VALUES ("03 Some data to test");
-SHOW VARIABLES LIKE 'backup_wait%';
-Variable_name Value
-backup_wait_timeout 50
-Part A
-con1: Activate synchronization points for backup.
-SET DEBUG_SYNC= 'after_block_ddl SIGNAL bup_blocked WAIT_FOR timeout_done';
-con1: Get a backup going and stop after the DDL blocker is fired.
-BACKUP DATABASE bup_ddl_blocker TO "bup_ddl_blocker.bak";
-SET DEBUG_SYNC= 'now WAIT_FOR bup_blocked';
-Set ddl timeout to 1 second
-SET backup_wait_timeout = 1;
-SHOW VARIABLES LIKE 'backup_wait%';
-Variable_name Value
-backup_wait_timeout 1
-con2: Try a ddl operation and watch it expire
-CREATE TABLE bup_ddl_blocker.t2 (col_a CHAR(40)) ENGINE=MEMORY;
-ERROR HY000: The backup wait timeout has expired for query 'CREATE TABLE bup_ddl_blocker.t2 (col_a CHAR(40)) ENGINE=MEMORY'.
-release the lock.
-con5: Resume all.
-SET DEBUG_SYNC= 'now SIGNAL timeout_done';
-backup_id
-#
-Part B
-con1: Activate synchronization points for backup.
-SET DEBUG_SYNC= 'after_block_ddl SIGNAL bup_blocked WAIT_FOR timeout_done';
-con1: Get a backup going and stop after the DDL blocker is fired.
-BACKUP DATABASE bup_ddl_blocker TO "bup_ddl_blocker.bak";
-SET DEBUG_SYNC= 'now WAIT_FOR bup_blocked';
-Set ddl timeout to 0 seconds
-SET backup_wait_timeout = 0;
-SHOW VARIABLES LIKE 'backup_wait%';
-Variable_name Value
-backup_wait_timeout 0
-con2: Try a ddl operation and it should expire
-CREATE TABLE bup_ddl_blocker.t3 (col_a CHAR(40)) ENGINE=MEMORY;
-ERROR HY000: The backup wait timeout has expired for query 'CREATE TABLE bup_ddl_blocker.t3 (col_a CHAR(40)) ENGINE=MEMORY'.
-SET backup_wait_timeout = 100;
-SHOW VARIABLES LIKE 'backup_wait%';
-Variable_name Value
-backup_wait_timeout 100
-con3: Try a ddl operation and it should not expire
-CREATE TABLE bup_ddl_blocker.t3 (col_a CHAR(40)) ENGINE=MEMORY;
-release the lock.
-con5: Resume all.
-SET DEBUG_SYNC= 'now SIGNAL timeout_done';
-backup_id
-#
-USE bup_ddl_blocker;
-SHOW FULL TABLES;
-Tables_in_bup_ddl_blocker Table_type
-t1 BASE TABLE
-t3 BASE TABLE
-Part C
-Show that the variable can be reset to its timeout value using
-SET backup_wait_timeout = DEFAULT;
-SET backup_wait_timeout = 1;
-SHOW VARIABLES LIKE 'backup_wait%';
-Variable_name Value
-backup_wait_timeout 1
-SET backup_wait_timeout = DEFAULT;
-SHOW VARIABLES LIKE 'backup_wait%';
-Variable_name Value
-backup_wait_timeout 50
-DROP DATABASE bup_ddl_blocker;
=== removed file 'mysql-test/r/backup_triggers_and_events.result'
--- a/mysql-test/r/backup_triggers_and_events.result 2008-06-26 15:52:25 +0000
+++ b/mysql-test/r/backup_triggers_and_events.result 1970-01-01 00:00:00 +0000
@@ -1,196 +0,0 @@
-SET GLOBAL event_scheduler=off;
-SET DEBUG_SYNC = 'RESET';
-Creating log table.
-DROP TABLE IF EXISTS test.logt;
-CREATE TABLE test.logt(ts timestamp, db char(8), msg text);
-Creating database db and its objects.
-DROP DATABASE IF EXISTS db;
-CREATE DATABASE db;
-USE db;
-CREATE TABLE t1 (a int);
-INSERT INTO t1 VALUES (0),(1),(2),(3),(4),(5),(6);
-CREATE EVENT ev ON SCHEDULE EVERY 1 second DO
-BEGIN
-INSERT INTO test.logt(db, msg) VALUES ('db','Db event fired!');
-END;
-||
-CREATE PROCEDURE trg_msg(a int)
-BEGIN
-INSERT INTO test.logt(db, msg) VALUES ('db','Db trigger fired!');
-END;
-||
-CREATE TRIGGER after_ins AFTER INSERT ON t1 FOR EACH ROW
-CALL trg_msg(NEW.a);
-||
-CREATE TRIGGER after_upd AFTER UPDATE ON t1 FOR EACH ROW
-CALL trg_msg(NEW.a);
-||
-CREATE TRIGGER after_del AFTER DELETE ON t1 FOR EACH ROW
-CALL trg_msg(OLD.a);
-||
-CREATE TRIGGER before_ins BEFORE INSERT ON t1 FOR EACH ROW
-CALL trg_msg(NEW.a);
-||
-CREATE TRIGGER before_upd BEFORE UPDATE ON t1 FOR EACH ROW
-CALL trg_msg(NEW.a);
-||
-CREATE TRIGGER before_del BEFORE DELETE ON t1 FOR EACH ROW
-CALL trg_msg(OLD.a);
-||
-USE test||
-DROP EVENT IF EXISTS ev||
-DROP TABLE IF EXISTS t1||
-DROP TRIGGER IF EXISTS trg||
-CREATE EVENT ev ON SCHEDULE EVERY 1 second DO
-BEGIN
-INSERT INTO test.logt(db, msg) VALUES ('test','Test event fired!');
-END;
-||
-CREATE TABLE t1 (a int)||
-CREATE TRIGGER trg AFTER INSERT ON t1 FOR EACH ROW
-BEGIN
-INSERT INTO test.logt(db, msg) VALUES ('test','Test trigger fired');
-END;
-||
-Backing-up database db and dropping it.
-BACKUP DATABASE db TO 'db.bak';
-backup_id
-#
-DROP DATABASE db;
-Enabling event scheduler.
-SET GLOBAL event_scheduler=on;
-con1: clearing log table and starting RESTORE operation.
-con1: RESTORE will pause after restoring table data.
-SET DEBUG_SYNC = 'restore_table_data_before_end SIGNAL waiting WAIT_FOR continue';
-DELETE FROM test.logt;
-RESTORE FROM 'db.bak';
-SELECT now() INTO @start;
-con2: checking that there are no triggers and events at the end of RESTORE execution.
-SET DEBUG_SYNC = 'now WAIT_FOR waiting';
-SHOW TRIGGERS FROM db;
-SHOW EVENTS IN db;
-con2: activating trigger in test database.
-INSERT INTO test.t1 VALUES (1);
-con2: ensuring that RESTORE takes at least 3 secs.
-SET DEBUG_SYNC = 'now SIGNAL continue';
-con1: finishing RESTORE operation.
-backup_id
-#
-SET GLOBAL event_scheduler=off;
-con2: checking that RESTORE took more than 2 secs.
-SELECT timediff(now(),@start) > 2;
-timediff(now(),@start) > 2
-1
-Checking that objects have been restored.
-USE db;
-SHOW TABLES IN db;
-Tables_in_db
-t1
-SELECT count(*) FROM db.t1;
-count(*)
-7
-SHOW TRIGGERS FROM db;
-Trigger before_ins
-Event INSERT
-Table t1
-Statement CALL trg_msg(NEW.a)
-Timing BEFORE
-Created NULL
-sql_mode
-Definer root@localhost
-character_set_client #
-collation_connection latin1_swedish_ci
-Database Collation latin1_swedish_ci
-Trigger after_ins
-Event INSERT
-Table t1
-Statement CALL trg_msg(NEW.a)
-Timing AFTER
-Created NULL
-sql_mode
-Definer root@localhost
-character_set_client #
-collation_connection latin1_swedish_ci
-Database Collation latin1_swedish_ci
-Trigger before_upd
-Event UPDATE
-Table t1
-Statement CALL trg_msg(NEW.a)
-Timing BEFORE
-Created NULL
-sql_mode
-Definer root@localhost
-character_set_client #
-collation_connection latin1_swedish_ci
-Database Collation latin1_swedish_ci
-Trigger after_upd
-Event UPDATE
-Table t1
-Statement CALL trg_msg(NEW.a)
-Timing AFTER
-Created NULL
-sql_mode
-Definer root@localhost
-character_set_client #
-collation_connection latin1_swedish_ci
-Database Collation latin1_swedish_ci
-Trigger before_del
-Event DELETE
-Table t1
-Statement CALL trg_msg(OLD.a)
-Timing BEFORE
-Created NULL
-sql_mode
-Definer root@localhost
-character_set_client #
-collation_connection latin1_swedish_ci
-Database Collation latin1_swedish_ci
-Trigger after_del
-Event DELETE
-Table t1
-Statement CALL trg_msg(OLD.a)
-Timing AFTER
-Created NULL
-sql_mode
-Definer root@localhost
-character_set_client #
-collation_connection latin1_swedish_ci
-Database Collation latin1_swedish_ci
-SHOW EVENTS IN db;
-Db db
-Name ev
-Definer root@localhost
-Time zone SYSTEM
-Type RECURRING
-Execute at NULL
-Interval value 1
-Interval field SECOND
-Starts #
-Ends NULL
-Status ENABLED
-Originator 1
-character_set_client latin1
-collation_connection latin1_swedish_ci
-Database Collation latin1_swedish_ci
-Checking that no db event or trigger fired during RESTORE.
-SELECT * FROM test.logt WHERE db = 'db' AND timediff(ts,@start) < 2;
-ts db msg
-Checking that test event and trigger could fire.
-SELECT count(*) > 0 FROM test.logt
-WHERE db = 'test'
-AND msg LIKE '%trigger fired%'
-AND timediff(ts,@start) < 2;
-count(*) > 0
-1
-SELECT count(*) > 0 FROM test.logt
-WHERE db = 'test'
-AND msg LIKE '%event fired%'
-AND timediff(ts,@start) < 2;
-count(*) > 0
-1
-Cleaning up.
-DROP EVENT test.ev;
-DROP TRIGGER test.trg;
-DROP TABLE test.logt;
-DROP TABLE test.t1;
-DROP DATABASE db;
=== removed file 'mysql-test/r/backup_view_on_view.result'
--- a/mysql-test/r/backup_view_on_view.result 2008-06-25 13:39:04 +0000
+++ b/mysql-test/r/backup_view_on_view.result 1970-01-01 00:00:00 +0000
@@ -1,38 +0,0 @@
-SET GLOBAL debug="d,backup:d,backup_data";
-DROP DATABASE IF EXISTS db1;
-CREATE DATABASE db1;
-CREATE TABLE db1.t1(a int) ENGINE=INNODB;
-CREATE VIEW db1.v1 AS SELECT * FROM db1.t1;
-CREATE VIEW db1.v2 AS SELECT * FROM db1.v1;
-INSERT INTO db1.t1 VALUES (1),(2),(3),(5),(7),(11);
-BACKUP DATABASE db1 TO 'test.bak';
-backup_id
-#
-RESTORE FROM 'test.bak';
-backup_id
-#
-SELECT * FROM db1.v2;
-a
-1
-2
-3
-5
-7
-11
-SELECT * FROM db1.v1;
-a
-1
-2
-3
-5
-7
-11
-SELECT * FROM db1.t1;
-a
-1
-2
-3
-5
-7
-11
-DROP DATABASE db1;
=== removed file 'mysql-test/r/backup_views.result'
--- a/mysql-test/r/backup_views.result 2008-08-20 13:23:10 +0000
+++ b/mysql-test/r/backup_views.result 1970-01-01 00:00:00 +0000
@@ -1,598 +0,0 @@
-
-starting the test for backup
-
-DROP DATABASE IF EXISTS bup_db1;
-DROP DATABASE IF EXISTS bup_db2;
-CREATE DATABASE bup_db1;
-USE bup_db1;
-Creating Table t1
-CREATE TABLE bup_db1.t1(
-id INT NOT NULL PRIMARY KEY,
-name CHAR(10),
-city VARCHAR(10)
-)ENGINE=INNODB;
-loading data
-INSERT INTO bup_db1.t1 VALUES
-(1,'aa1','RR1'),(2,'aa2','RR2'),(3,'aa3','RR3'),(4,'aa4','RR4'),
-(5,'aa5','RR5'),(6,'aa6','RR6'),(7,'aa7','RR7'),(8,'aa8','RR8');
-SELECT * FROM bup_db1.t1 ORDER BY id;
-id name city
-1 aa1 RR1
-2 aa2 RR2
-3 aa3 RR3
-4 aa4 RR4
-5 aa5 RR5
-6 aa6 RR6
-7 aa7 RR7
-8 aa8 RR8
-Creating Table t3
-CREATE TABLE bup_db1.t3(
-ccode INT,
-District CHAR(20) NOT NULL PRIMARY KEY,
-scode INT,
-FOREIGN KEY (scode) REFERENCES bup_db1.t1(id)
-)ENGINE=INNODB;
-Loading Data
-INSERT INTO t3 VALUES
-(234, 'zuloa',1),(321,'yyy',2),(765,'iug',3),
-(124,'LKJ',4),(235,'uth',6);
-SELECT * FROM bup_db1.t3 ORDER BY scode;
-ccode District scode
-234 zuloa 1
-321 yyy 2
-765 iug 3
-124 LKJ 4
-235 uth 6
-*****Create view from the table bup_db1.t1*******
-CREATE VIEW bup_db1.v1 AS SELECT * FROM bup_db1.t1;
-***Create views from 2 tables(t1 and t3) within same DB bup_db1****
-CREATE VIEW bup_db1.vcomb AS
-SELECT name, city, ccode FROM bup_db1.t1, bup_db1.t3 WHERE id=scode;
-CREATE DATABASE bup_db2;
-CREATE TABLE bup_db2.t2(
-idno INT,
-age INT PRIMARY KEY,
-education CHAR(20) ,
-FOREIGN KEY (idno) REFERENCES bup_db1.t1(id)
-)ENGINE=INNODB;
-INSERT INTO bup_db2.t2 VALUES
-(1,23,'BS'),(2,24,'BE'),(3,19,'School'),(4,28,'MS'),
-(5,43,'PHD'),(6,30,'Doctor'),(7,31,'Lawyer'),(8,27,'Undergrad');
-SELECT * FROM bup_db2.t2 ORDER BY age;
-idno age education
-3 19 School
-1 23 BS
-2 24 BE
-8 27 Undergrad
-4 28 MS
-6 30 Doctor
-7 31 Lawyer
-5 43 PHD
-****Create view in bup_db2****
-CREATE VIEW bup_db2.v2 AS SELECT age, education FROM bup_db2.t2;
-******Create views from combination of 2 databases*******
-CREATE VIEW bup_db2.v3 AS SELECT name, age, education
-FROM bup_db1.t1 , bup_db2.t2 WHERE id=idno;
-*********Create view from another view in bup_db2***********.
-CREATE VIEW bup_db2.vv (N, A, E) AS SELECT * FROM bup_db2.v3;
-*****Create view from other Database********
-CREATE VIEW bup_db2.v4 AS SELECT * FROM bup_db1.t3;
-Rename the view name
-RENAME TABLE bup_db2.v4 to bup_db2.student_details;
-*******Create view from database bup_db2**********
-CREATE VIEW bup_db1.v5 AS SELECT * FROM bup_db2.t2;
-Creating Table t5
-CREATE TABLE bup_db1.t5(
-Gender CHAR(5),
-cand_age INT,
-FOREIGN KEY(cand_age) REFERENCES bup_db2.t2(age)
-)ENGINE=INNODB;
-Loading data into table t5
-INSERT INTO bup_db1.t5 VALUES
-('F',23),('F',24),('M',19),('F',28),
-('M',43),('F',30),('M',31),('M',27);
-SELECT * FROM bup_db1.t5 ORDER BY Gender;
-Gender cand_age
-F 23
-F 24
-F 28
-F 30
-M 19
-M 43
-M 31
-M 27
-******Create view v6********
-CREATE VIEW bup_db1.v6 AS SELECT education,gender
-FROM bup_db2.v2, bup_db1.t5 WHERE cand_age=age;
-SELECT * FROM bup_db1.t1 ORDER BY id;
-id name city
-1 aa1 RR1
-2 aa2 RR2
-3 aa3 RR3
-4 aa4 RR4
-5 aa5 RR5
-6 aa6 RR6
-7 aa7 RR7
-8 aa8 RR8
-SELECT * FROM bup_db1.t3 ORDER BY scode;
-ccode District scode
-234 zuloa 1
-321 yyy 2
-765 iug 3
-124 LKJ 4
-235 uth 6
-SELECT * FROM bup_db1.t5 ORDER BY Gender;
-Gender cand_age
-F 23
-F 24
-F 28
-F 30
-M 19
-M 43
-M 31
-M 27
-SELECT * FROM bup_db1.v1;
-id name city
-1 aa1 RR1
-2 aa2 RR2
-3 aa3 RR3
-4 aa4 RR4
-5 aa5 RR5
-6 aa6 RR6
-7 aa7 RR7
-8 aa8 RR8
-SELECT * FROM bup_db1.vcomb ORDER BY name;
-name city ccode
-aa1 RR1 234
-aa2 RR2 321
-aa3 RR3 765
-aa4 RR4 124
-aa6 RR6 235
-SELECT * FROM bup_db1.v5 ORDER BY age;
-idno age education
-3 19 School
-1 23 BS
-2 24 BE
-8 27 Undergrad
-4 28 MS
-6 30 Doctor
-7 31 Lawyer
-5 43 PHD
-SELECT * FROM bup_db1.v6 ORDER BY education, gender;
-education gender
-BE F
-BS F
-Doctor F
-Lawyer M
-MS F
-PHD M
-School M
-Undergrad M
-excercise objects of bup_db2
-SELECT * FROM bup_db2.t2 ORDER BY age;
-idno age education
-3 19 School
-1 23 BS
-2 24 BE
-8 27 Undergrad
-4 28 MS
-6 30 Doctor
-7 31 Lawyer
-5 43 PHD
-SELECT * FROM bup_db2.v2 ORDER BY age;
-age education
-19 School
-23 BS
-24 BE
-27 Undergrad
-28 MS
-30 Doctor
-31 Lawyer
-43 PHD
-SELECT * FROM bup_db2.v3 ORDER BY age;
-name age education
-aa3 19 School
-aa1 23 BS
-aa2 24 BE
-aa8 27 Undergrad
-aa4 28 MS
-aa6 30 Doctor
-aa7 31 Lawyer
-aa5 43 PHD
-SELECT * FROM bup_db2.vv;
-N A E
-aa1 23 BS
-aa2 24 BE
-aa3 19 School
-aa4 28 MS
-aa5 43 PHD
-aa6 30 Doctor
-aa7 31 Lawyer
-aa8 27 Undergrad
-SELECT * FROM bup_db2.student_details;
-ccode District scode
-765 iug 3
-124 LKJ 4
-235 uth 6
-321 yyy 2
-234 zuloa 1
-showing objects and create statements.
-SHOW FULL TABLES FROM bup_db1;;
-Tables_in_bup_db1 t1
-Table_type BASE TABLE
-Tables_in_bup_db1 t3
-Table_type BASE TABLE
-Tables_in_bup_db1 t5
-Table_type BASE TABLE
-Tables_in_bup_db1 v1
-Table_type VIEW
-Tables_in_bup_db1 v5
-Table_type VIEW
-Tables_in_bup_db1 v6
-Table_type VIEW
-Tables_in_bup_db1 vcomb
-Table_type VIEW
-SHOW FULL TABLES FROM bup_db2;;
-Tables_in_bup_db2 student_details
-Table_type VIEW
-Tables_in_bup_db2 t2
-Table_type BASE TABLE
-Tables_in_bup_db2 v2
-Table_type VIEW
-Tables_in_bup_db2 v3
-Table_type VIEW
-Tables_in_bup_db2 vv
-Table_type VIEW
-SHOW CREATE VIEW bup_db1.v1;;
-View v1
-Create View CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`id` AS `id`,`t1`.`name` AS `name`,`t1`.`city` AS `city` from `t1`
-character_set_client latin1
-collation_connection latin1_swedish_ci
-SHOW CREATE VIEW bup_db1.vcomb;;
-View vcomb
-Create View CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `vcomb` AS select `t1`.`name` AS `name`,`t1`.`city` AS `city`,`t3`.`ccode` AS `ccode` from (`t1` join `t3`) where (`t1`.`id` = `t3`.`scode`)
-character_set_client latin1
-collation_connection latin1_swedish_ci
-SHOW CREATE VIEW bup_db2.v3;;
-View v3
-Create View CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `bup_db2`.`v3` AS select `bup_db1`.`t1`.`name` AS `name`,`bup_db2`.`t2`.`age` AS `age`,`bup_db2`.`t2`.`education` AS `education` from (`bup_db1`.`t1` join `bup_db2`.`t2`) where (`bup_db1`.`t1`.`id` = `bup_db2`.`t2`.`idno`)
-character_set_client latin1
-collation_connection latin1_swedish_ci
-backup database
-BACKUP DATABASE bup_db1, bup_db2 TO 'bup_objectview.bak';
-backup_id
-#
-BACKUP DATABASE bup_db1 TO 'bup_objectview1.bak';
-backup_id
-#
-BACKUP DATABASE bup_db2 TO 'bup_objectview2.bak';
-backup_id
-#
-dropping database.
-DROP TABLE bup_db1.t3;
-DROP TABLE bup_db1.t5;
-DROP TABLE bup_db2.t2;
-DROP DATABASE bup_db1;
-DROP DATABASE bup_db2;
-Restore database.
-restore database with view dependency to other, non-existing db
-RESTORE FROM 'bup_objectview1.bak';
-ERROR HY000: Could not restore view `bup_db1`.`v5`. Please check the view definition for possible missing dependencies.
-DROP DATABASE bup_db1;
-RESTORE FROM 'bup_objectview2.bak';
-ERROR HY000: Could not restore view `bup_db2`.`student_details`. Please check the view definition for possible missing dependencies.
-DROP DATABASE bup_db2;
-RESTORE FROM 'bup_objectview.bak';
-backup_id
-#
-showing objects and create statements
-SHOW CREATE DATABASE bup_db1;;
-Database bup_db1
-Create Database CREATE DATABASE `bup_db1` /*!40100 DEFAULT CHARACTER SET latin1 */
-SHOW FULL TABLES FROM bup_db1;;
-Tables_in_bup_db1 t1
-Table_type BASE TABLE
-Tables_in_bup_db1 t3
-Table_type BASE TABLE
-Tables_in_bup_db1 t5
-Table_type BASE TABLE
-Tables_in_bup_db1 v1
-Table_type VIEW
-Tables_in_bup_db1 v5
-Table_type VIEW
-Tables_in_bup_db1 v6
-Table_type VIEW
-Tables_in_bup_db1 vcomb
-Table_type VIEW
-SHOW FULL TABLES FROM bup_db2;;
-Tables_in_bup_db2 student_details
-Table_type VIEW
-Tables_in_bup_db2 t2
-Table_type BASE TABLE
-Tables_in_bup_db2 v2
-Table_type VIEW
-Tables_in_bup_db2 v3
-Table_type VIEW
-Tables_in_bup_db2 vv
-Table_type VIEW
-SHOW CREATE VIEW bup_db1.v1;;
-View v1
-Create View CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `bup_db1`.`v1` AS select `bup_db1`.`t1`.`id` AS `id`,`bup_db1`.`t1`.`name` AS `name`,`bup_db1`.`t1`.`city` AS `city` from `bup_db1`.`t1`
-character_set_client latin1
-collation_connection latin1_swedish_ci
-SHOW CREATE VIEW bup_db1.vcomb;;
-View vcomb
-Create View CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `bup_db1`.`vcomb` AS select `bup_db1`.`t1`.`name` AS `name`,`bup_db1`.`t1`.`city` AS `city`,`bup_db1`.`t3`.`ccode` AS `ccode` from (`bup_db1`.`t1` join `bup_db1`.`t3`) where (`bup_db1`.`t1`.`id` = `bup_db1`.`t3`.`scode`)
-character_set_client latin1
-collation_connection latin1_swedish_ci
-SHOW CREATE VIEW bup_db2.v3;;
-View v3
-Create View CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `bup_db2`.`v3` AS select `bup_db1`.`t1`.`name` AS `name`,`bup_db2`.`t2`.`age` AS `age`,`bup_db2`.`t2`.`education` AS `education` from (`bup_db1`.`t1` join `bup_db2`.`t2`) where (`bup_db1`.`t1`.`id` = `bup_db2`.`t2`.`idno`)
-character_set_client latin1
-collation_connection latin1_swedish_ci
-****check for view contents after Restore*****
-SELECT * FROM bup_db1.t1 ORDER BY id;
-id name city
-1 aa1 RR1
-2 aa2 RR2
-3 aa3 RR3
-4 aa4 RR4
-5 aa5 RR5
-6 aa6 RR6
-7 aa7 RR7
-8 aa8 RR8
-SELECT * FROM bup_db1.t3 ORDER BY scode;
-ccode District scode
-234 zuloa 1
-321 yyy 2
-765 iug 3
-124 LKJ 4
-235 uth 6
-SELECT * FROM bup_db1.t5 ORDER BY Gender;
-Gender cand_age
-F 23
-F 24
-F 28
-F 30
-M 19
-M 43
-M 31
-M 27
-SELECT * FROM bup_db1.v1;
-id name city
-1 aa1 RR1
-2 aa2 RR2
-3 aa3 RR3
-4 aa4 RR4
-5 aa5 RR5
-6 aa6 RR6
-7 aa7 RR7
-8 aa8 RR8
-SELECT * FROM bup_db1.vcomb ORDER BY name;
-name city ccode
-aa1 RR1 234
-aa2 RR2 321
-aa3 RR3 765
-aa4 RR4 124
-aa6 RR6 235
-SELECT * FROM bup_db1.v5 ORDER BY age;
-idno age education
-3 19 School
-1 23 BS
-2 24 BE
-8 27 Undergrad
-4 28 MS
-6 30 Doctor
-7 31 Lawyer
-5 43 PHD
-SELECT * FROM bup_db1.v6 ORDER BY education, gender;
-education gender
-BE F
-BS F
-Doctor F
-Lawyer M
-MS F
-PHD M
-School M
-Undergrad M
-excercise objects of bup_db2
-SELECT * FROM bup_db2.t2 ORDER BY age;
-idno age education
-3 19 School
-1 23 BS
-2 24 BE
-8 27 Undergrad
-4 28 MS
-6 30 Doctor
-7 31 Lawyer
-5 43 PHD
-SELECT * FROM bup_db2.v2 ORDER BY age;
-age education
-19 School
-23 BS
-24 BE
-27 Undergrad
-28 MS
-30 Doctor
-31 Lawyer
-43 PHD
-SELECT * FROM bup_db2.v3 ORDER BY age;
-name age education
-aa3 19 School
-aa1 23 BS
-aa2 24 BE
-aa8 27 Undergrad
-aa4 28 MS
-aa6 30 Doctor
-aa7 31 Lawyer
-aa5 43 PHD
-SELECT * FROM bup_db2.vv;
-N A E
-aa1 23 BS
-aa2 24 BE
-aa3 19 School
-aa4 28 MS
-aa5 43 PHD
-aa6 30 Doctor
-aa7 31 Lawyer
-aa8 27 Undergrad
-SELECT * FROM bup_db2.student_details;
-ccode District scode
-765 iug 3
-124 LKJ 4
-235 uth 6
-321 yyy 2
-234 zuloa 1
-ALTER TABLE bup_db1.t1 CHANGE name name VARCHAR(10);
-DESCRIBE bup_db1.t1;
-Field Type Null Key Default Extra
-id int(11) NO PRI NULL
-name varchar(10) YES NULL
-city varchar(10) YES NULL
-SELECT * FROM bup_db1.t1 ORDER BY id;
-id name city
-1 aa1 RR1
-2 aa2 RR2
-3 aa3 RR3
-4 aa4 RR4
-5 aa5 RR5
-6 aa6 RR6
-7 aa7 RR7
-8 aa8 RR8
-SELECT * FROM bup_db1.v1;
-id name city
-1 aa1 RR1
-2 aa2 RR2
-3 aa3 RR3
-4 aa4 RR4
-5 aa5 RR5
-6 aa6 RR6
-7 aa7 RR7
-8 aa8 RR8
-SELECT * FROM bup_db2.v3 ORDER BY age;
-name age education
-aa3 19 School
-aa1 23 BS
-aa2 24 BE
-aa8 27 Undergrad
-aa4 28 MS
-aa6 30 Doctor
-aa7 31 Lawyer
-aa5 43 PHD
-BACKUP DATABASE bup_db1, bup_db2 TO 'bup_objectview3.bak';
-backup_id
-#
-DROP TABLE bup_db1.t3;
-DROP TABLE bup_db1.t5;
-DROP TABLE bup_db2.t2;
-DROP DATABASE bup_db1;
-DROP DATABASE bup_db2;
-RESTORE FROM 'bup_objectview3.bak';
-backup_id
-#
-SELECT * FROM bup_db2.v3 ORDER BY age;
-name age education
-aa3 19 School
-aa1 23 BS
-aa2 24 BE
-aa8 27 Undergrad
-aa4 28 MS
-aa6 30 Doctor
-aa7 31 Lawyer
-aa5 43 PHD
-SELECT * FROM bup_db1.t1 ORDER BY id;
-id name city
-1 aa1 RR1
-2 aa2 RR2
-3 aa3 RR3
-4 aa4 RR4
-5 aa5 RR5
-6 aa6 RR6
-7 aa7 RR7
-8 aa8 RR8
-
-*** ENTER Backup of database with missing view dependency
-*** should fail but not crash server
-*** Test for bug#34902 ***
-initializing test
-DROP TABLE bup_db1.t3;
-DROP TABLE bup_db1.t5;
-DROP TABLE bup_db2.t2;
-DROP DATABASE bup_db1;
-DROP DATABASE bup_db2;
-RESTORE FROM 'bup_objectview.bak';
-backup_id
-#
-SELECT * FROM bup_db1.t1;
-id name city
-1 aa1 RR1
-2 aa2 RR2
-3 aa3 RR3
-4 aa4 RR4
-5 aa5 RR5
-6 aa6 RR6
-7 aa7 RR7
-8 aa8 RR8
-SELECT * FROM bup_db1.v1;
-id name city
-1 aa1 RR1
-2 aa2 RR2
-3 aa3 RR3
-4 aa4 RR4
-5 aa5 RR5
-6 aa6 RR6
-7 aa7 RR7
-8 aa8 RR8
-DROP TABLE bup_db1.t3;
-DROP TABLE bup_db1.t5;
-DROP TABLE bup_db2.t2;
-DROP TABLE bup_db1.t1;
-
-Testing backup with missing view dependency in same db
-
-SELECT * FROM bup_db1.v1;
-ERROR HY000: View 'bup_db1.v1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
-BACKUP DATABASE bup_db1 TO 'bup_shouldfail1.bak';
-ERROR HY000: Failed to add view `bup_db1`.`v1` to the catalog
-
-Testing backup with missing view dependency in other db
-
-USE bup_db2;
-SELECT * from bup_db2.v3;
-ERROR HY000: View 'bup_db2.v3' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
-BACKUP DATABASE bup_db2 TO 'bup_shouldfail2.bak';
-ERROR HY000: Failed to add view `bup_db2`.`student_details` to the catalog
-
-*** EXIT Backup of database with missing view dependency
-
-
-*** ENTER Backup of database with altered view should report error, not crash server
-Test for bug#34867
-initializing test
-DROP DATABASE bup_db1;
-DROP DATABASE bup_db2;
-RESTORE FROM 'bup_objectview.bak';
-backup_id
-#
-USE bup_db1;
-CREATE VIEW alter1 AS SELECT 5;
-CREATE VIEW alter2 AS SELECT * FROM alter1;
-ALTER VIEW alter1 AS SELECT 6;
-
-Testing view selecting from altered view
-
-SELECT * FROM alter2;
-ERROR HY000: View 'bup_db1.alter2' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
-BACKUP DATABASE bup_db1 TO 'bup_alterview.bak';
-ERROR HY000: View 'bup_db1.alter2' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
-
-*** EXIT Backup of database with altered view
-
-
-*** DROP bup_db1, bup_db2 DATABASE ****
-
-DROP TABLE bup_db1.t3;
-DROP TABLE bup_db1.t5;
-DROP TABLE bup_db2.t2;
-DROP DATABASE bup_db1;
-DROP DATABASE bup_db2;
=== added file 'mysql-test/suite/backup/r/backup_timeout.result'
--- a/mysql-test/suite/backup/r/backup_timeout.result 1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/backup/r/backup_timeout.result 2008-09-26 22:16:02 +0000
@@ -0,0 +1,73 @@
+SET DEBUG_SYNC= 'reset';
+DROP DATABASE IF EXISTS bup_ddl_blocker;
+CREATE DATABASE bup_ddl_blocker;
+con1: Creating tables
+CREATE TABLE bup_ddl_blocker.t1 (col_a CHAR(40)) ENGINE=INNODB;
+con1: Loading data
+INSERT INTO bup_ddl_blocker.t1 VALUES ("01 Some data to test");
+INSERT INTO bup_ddl_blocker.t1 VALUES ("02 Some data to test");
+INSERT INTO bup_ddl_blocker.t1 VALUES ("03 Some data to test");
+SHOW VARIABLES LIKE 'backup_wait%';
+Variable_name Value
+backup_wait_timeout 50
+Part A
+con1: Activate synchronization points for backup.
+SET DEBUG_SYNC= 'after_block_ddl SIGNAL bup_blocked WAIT_FOR timeout_done';
+con1: Get a backup going and stop after the DDL blocker is fired.
+BACKUP DATABASE bup_ddl_blocker TO "bup_ddl_blocker.bak";
+SET DEBUG_SYNC= 'now WAIT_FOR bup_blocked';
+Set ddl timeout to 1 second
+SET backup_wait_timeout = 1;
+SHOW VARIABLES LIKE 'backup_wait%';
+Variable_name Value
+backup_wait_timeout 1
+con2: Try a ddl operation and watch it expire
+CREATE TABLE bup_ddl_blocker.t2 (col_a CHAR(40)) ENGINE=MEMORY;
+ERROR HY000: The backup wait timeout has expired for query 'CREATE TABLE bup_ddl_blocker.t2 (col_a CHAR(40)) ENGINE=MEMORY'.
+release the lock.
+con5: Resume all.
+SET DEBUG_SYNC= 'now SIGNAL timeout_done';
+backup_id
+#
+Part B
+con1: Activate synchronization points for backup.
+SET DEBUG_SYNC= 'after_block_ddl SIGNAL bup_blocked WAIT_FOR timeout_done';
+con1: Get a backup going and stop after the DDL blocker is fired.
+BACKUP DATABASE bup_ddl_blocker TO "bup_ddl_blocker.bak";
+SET DEBUG_SYNC= 'now WAIT_FOR bup_blocked';
+Set ddl timeout to 0 seconds
+SET backup_wait_timeout = 0;
+SHOW VARIABLES LIKE 'backup_wait%';
+Variable_name Value
+backup_wait_timeout 0
+con2: Try a ddl operation and it should expire
+CREATE TABLE bup_ddl_blocker.t3 (col_a CHAR(40)) ENGINE=MEMORY;
+ERROR HY000: The backup wait timeout has expired for query 'CREATE TABLE bup_ddl_blocker.t3 (col_a CHAR(40)) ENGINE=MEMORY'.
+SET backup_wait_timeout = 100;
+SHOW VARIABLES LIKE 'backup_wait%';
+Variable_name Value
+backup_wait_timeout 100
+con3: Try a ddl operation and it should not expire
+CREATE TABLE bup_ddl_blocker.t3 (col_a CHAR(40)) ENGINE=MEMORY;
+release the lock.
+con5: Resume all.
+SET DEBUG_SYNC= 'now SIGNAL timeout_done';
+backup_id
+#
+USE bup_ddl_blocker;
+SHOW FULL TABLES;
+Tables_in_bup_ddl_blocker Table_type
+t1 BASE TABLE
+t3 BASE TABLE
+Part C
+Show that the variable can be reset to its timeout value using
+SET backup_wait_timeout = DEFAULT;
+SET backup_wait_timeout = 1;
+SHOW VARIABLES LIKE 'backup_wait%';
+Variable_name Value
+backup_wait_timeout 1
+SET backup_wait_timeout = DEFAULT;
+SHOW VARIABLES LIKE 'backup_wait%';
+Variable_name Value
+backup_wait_timeout 50
+DROP DATABASE bup_ddl_blocker;
=== added file 'mysql-test/suite/backup/r/backup_triggers_and_events.result'
--- a/mysql-test/suite/backup/r/backup_triggers_and_events.result 1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/backup/r/backup_triggers_and_events.result 2008-09-26 22:16:02 +0000
@@ -0,0 +1,196 @@
+SET GLOBAL event_scheduler=off;
+SET DEBUG_SYNC = 'RESET';
+Creating log table.
+DROP TABLE IF EXISTS test.logt;
+CREATE TABLE test.logt(ts timestamp, db char(8), msg text);
+Creating database db and its objects.
+DROP DATABASE IF EXISTS db;
+CREATE DATABASE db;
+USE db;
+CREATE TABLE t1 (a int);
+INSERT INTO t1 VALUES (0),(1),(2),(3),(4),(5),(6);
+CREATE EVENT ev ON SCHEDULE EVERY 1 second DO
+BEGIN
+INSERT INTO test.logt(db, msg) VALUES ('db','Db event fired!');
+END;
+||
+CREATE PROCEDURE trg_msg(a int)
+BEGIN
+INSERT INTO test.logt(db, msg) VALUES ('db','Db trigger fired!');
+END;
+||
+CREATE TRIGGER after_ins AFTER INSERT ON t1 FOR EACH ROW
+CALL trg_msg(NEW.a);
+||
+CREATE TRIGGER after_upd AFTER UPDATE ON t1 FOR EACH ROW
+CALL trg_msg(NEW.a);
+||
+CREATE TRIGGER after_del AFTER DELETE ON t1 FOR EACH ROW
+CALL trg_msg(OLD.a);
+||
+CREATE TRIGGER before_ins BEFORE INSERT ON t1 FOR EACH ROW
+CALL trg_msg(NEW.a);
+||
+CREATE TRIGGER before_upd BEFORE UPDATE ON t1 FOR EACH ROW
+CALL trg_msg(NEW.a);
+||
+CREATE TRIGGER before_del BEFORE DELETE ON t1 FOR EACH ROW
+CALL trg_msg(OLD.a);
+||
+USE test||
+DROP EVENT IF EXISTS ev||
+DROP TABLE IF EXISTS t1||
+DROP TRIGGER IF EXISTS trg||
+CREATE EVENT ev ON SCHEDULE EVERY 1 second DO
+BEGIN
+INSERT INTO test.logt(db, msg) VALUES ('test','Test event fired!');
+END;
+||
+CREATE TABLE t1 (a int)||
+CREATE TRIGGER trg AFTER INSERT ON t1 FOR EACH ROW
+BEGIN
+INSERT INTO test.logt(db, msg) VALUES ('test','Test trigger fired');
+END;
+||
+Backing-up database db and dropping it.
+BACKUP DATABASE db TO 'db.bak';
+backup_id
+#
+DROP DATABASE db;
+Enabling event scheduler.
+SET GLOBAL event_scheduler=on;
+con1: clearing log table and starting RESTORE operation.
+con1: RESTORE will pause after restoring table data.
+SET DEBUG_SYNC = 'restore_table_data_before_end SIGNAL waiting WAIT_FOR continue';
+DELETE FROM test.logt;
+RESTORE FROM 'db.bak';
+SELECT now() INTO @start;
+con2: checking that there are no triggers and events at the end of RESTORE execution.
+SET DEBUG_SYNC = 'now WAIT_FOR waiting';
+SHOW TRIGGERS FROM db;
+SHOW EVENTS IN db;
+con2: activating trigger in test database.
+INSERT INTO test.t1 VALUES (1);
+con2: ensuring that RESTORE takes at least 3 secs.
+SET DEBUG_SYNC = 'now SIGNAL continue';
+con1: finishing RESTORE operation.
+backup_id
+#
+SET GLOBAL event_scheduler=off;
+con2: checking that RESTORE took more than 2 secs.
+SELECT timediff(now(),@start) > 2;
+timediff(now(),@start) > 2
+1
+Checking that objects have been restored.
+USE db;
+SHOW TABLES IN db;
+Tables_in_db
+t1
+SELECT count(*) FROM db.t1;
+count(*)
+7
+SHOW TRIGGERS FROM db;
+Trigger before_ins
+Event INSERT
+Table t1
+Statement CALL trg_msg(NEW.a)
+Timing BEFORE
+Created NULL
+sql_mode
+Definer root@localhost
+character_set_client #
+collation_connection latin1_swedish_ci
+Database Collation latin1_swedish_ci
+Trigger after_ins
+Event INSERT
+Table t1
+Statement CALL trg_msg(NEW.a)
+Timing AFTER
+Created NULL
+sql_mode
+Definer root@localhost
+character_set_client #
+collation_connection latin1_swedish_ci
+Database Collation latin1_swedish_ci
+Trigger before_upd
+Event UPDATE
+Table t1
+Statement CALL trg_msg(NEW.a)
+Timing BEFORE
+Created NULL
+sql_mode
+Definer root@localhost
+character_set_client #
+collation_connection latin1_swedish_ci
+Database Collation latin1_swedish_ci
+Trigger after_upd
+Event UPDATE
+Table t1
+Statement CALL trg_msg(NEW.a)
+Timing AFTER
+Created NULL
+sql_mode
+Definer root@localhost
+character_set_client #
+collation_connection latin1_swedish_ci
+Database Collation latin1_swedish_ci
+Trigger before_del
+Event DELETE
+Table t1
+Statement CALL trg_msg(OLD.a)
+Timing BEFORE
+Created NULL
+sql_mode
+Definer root@localhost
+character_set_client #
+collation_connection latin1_swedish_ci
+Database Collation latin1_swedish_ci
+Trigger after_del
+Event DELETE
+Table t1
+Statement CALL trg_msg(OLD.a)
+Timing AFTER
+Created NULL
+sql_mode
+Definer root@localhost
+character_set_client #
+collation_connection latin1_swedish_ci
+Database Collation latin1_swedish_ci
+SHOW EVENTS IN db;
+Db db
+Name ev
+Definer root@localhost
+Time zone SYSTEM
+Type RECURRING
+Execute at NULL
+Interval value 1
+Interval field SECOND
+Starts #
+Ends NULL
+Status ENABLED
+Originator 1
+character_set_client latin1
+collation_connection latin1_swedish_ci
+Database Collation latin1_swedish_ci
+Checking that no db event or trigger fired during RESTORE.
+SELECT * FROM test.logt WHERE db = 'db' AND timediff(ts,@start) < 2;
+ts db msg
+Checking that test event and trigger could fire.
+SELECT count(*) > 0 FROM test.logt
+WHERE db = 'test'
+AND msg LIKE '%trigger fired%'
+AND timediff(ts,@start) < 2;
+count(*) > 0
+1
+SELECT count(*) > 0 FROM test.logt
+WHERE db = 'test'
+AND msg LIKE '%event fired%'
+AND timediff(ts,@start) < 2;
+count(*) > 0
+1
+Cleaning up.
+DROP EVENT test.ev;
+DROP TRIGGER test.trg;
+DROP TABLE test.logt;
+DROP TABLE test.t1;
+DROP DATABASE db;
=== added file 'mysql-test/suite/backup/r/backup_view_on_view.result'
--- a/mysql-test/suite/backup/r/backup_view_on_view.result 1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/backup/r/backup_view_on_view.result 2008-09-26 22:16:02 +0000
@@ -0,0 +1,38 @@
+SET GLOBAL debug="d,backup:d,backup_data";
+DROP DATABASE IF EXISTS db1;
+CREATE DATABASE db1;
+CREATE TABLE db1.t1(a int) ENGINE=INNODB;
+CREATE VIEW db1.v1 AS SELECT * FROM db1.t1;
+CREATE VIEW db1.v2 AS SELECT * FROM db1.v1;
+INSERT INTO db1.t1 VALUES (1),(2),(3),(5),(7),(11);
+BACKUP DATABASE db1 TO 'test.bak';
+backup_id
+#
+RESTORE FROM 'test.bak';
+backup_id
+#
+SELECT * FROM db1.v2;
+a
+1
+2
+3
+5
+7
+11
+SELECT * FROM db1.v1;
+a
+1
+2
+3
+5
+7
+11
+SELECT * FROM db1.t1;
+a
+1
+2
+3
+5
+7
+11
+DROP DATABASE db1;
=== added file 'mysql-test/suite/backup/r/backup_views.result'
--- a/mysql-test/suite/backup/r/backup_views.result 1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/backup/r/backup_views.result 2008-09-26 22:16:02 +0000
@@ -0,0 +1,598 @@
+
+starting the test for backup
+
+DROP DATABASE IF EXISTS bup_db1;
+DROP DATABASE IF EXISTS bup_db2;
+CREATE DATABASE bup_db1;
+USE bup_db1;
+Creating Table t1
+CREATE TABLE bup_db1.t1(
+id INT NOT NULL PRIMARY KEY,
+name CHAR(10),
+city VARCHAR(10)
+)ENGINE=INNODB;
+loading data
+INSERT INTO bup_db1.t1 VALUES
+(1,'aa1','RR1'),(2,'aa2','RR2'),(3,'aa3','RR3'),(4,'aa4','RR4'),
+(5,'aa5','RR5'),(6,'aa6','RR6'),(7,'aa7','RR7'),(8,'aa8','RR8');
+SELECT * FROM bup_db1.t1 ORDER BY id;
+id name city
+1 aa1 RR1
+2 aa2 RR2
+3 aa3 RR3
+4 aa4 RR4
+5 aa5 RR5
+6 aa6 RR6
+7 aa7 RR7
+8 aa8 RR8
+Creating Table t3
+CREATE TABLE bup_db1.t3(
+ccode INT,
+District CHAR(20) NOT NULL PRIMARY KEY,
+scode INT,
+FOREIGN KEY (scode) REFERENCES bup_db1.t1(id)
+)ENGINE=INNODB;
+Loading Data
+INSERT INTO t3 VALUES
+(234, 'zuloa',1),(321,'yyy',2),(765,'iug',3),
+(124,'LKJ',4),(235,'uth',6);
+SELECT * FROM bup_db1.t3 ORDER BY scode;
+ccode District scode
+234 zuloa 1
+321 yyy 2
+765 iug 3
+124 LKJ 4
+235 uth 6
+*****Create view from the table bup_db1.t1*******
+CREATE VIEW bup_db1.v1 AS SELECT * FROM bup_db1.t1;
+***Create views from 2 tables(t1 and t3) within same DB bup_db1****
+CREATE VIEW bup_db1.vcomb AS
+SELECT name, city, ccode FROM bup_db1.t1, bup_db1.t3 WHERE id=scode;
+CREATE DATABASE bup_db2;
+CREATE TABLE bup_db2.t2(
+idno INT,
+age INT PRIMARY KEY,
+education CHAR(20) ,
+FOREIGN KEY (idno) REFERENCES bup_db1.t1(id)
+)ENGINE=INNODB;
+INSERT INTO bup_db2.t2 VALUES
+(1,23,'BS'),(2,24,'BE'),(3,19,'School'),(4,28,'MS'),
+(5,43,'PHD'),(6,30,'Doctor'),(7,31,'Lawyer'),(8,27,'Undergrad');
+SELECT * FROM bup_db2.t2 ORDER BY age;
+idno age education
+3 19 School
+1 23 BS
+2 24 BE
+8 27 Undergrad
+4 28 MS
+6 30 Doctor
+7 31 Lawyer
+5 43 PHD
+****Create view in bup_db2****
+CREATE VIEW bup_db2.v2 AS SELECT age, education FROM bup_db2.t2;
+******Create views from combination of 2 databases*******
+CREATE VIEW bup_db2.v3 AS SELECT name, age, education
+FROM bup_db1.t1 , bup_db2.t2 WHERE id=idno;
+*********Create view from another view in bup_db2***********.
+CREATE VIEW bup_db2.vv (N, A, E) AS SELECT * FROM bup_db2.v3;
+*****Create view from other Database********
+CREATE VIEW bup_db2.v4 AS SELECT * FROM bup_db1.t3;
+Rename the view name
+RENAME TABLE bup_db2.v4 to bup_db2.student_details;
+*******Create view from database bup_db2**********
+CREATE VIEW bup_db1.v5 AS SELECT * FROM bup_db2.t2;
+Creating Table t5
+CREATE TABLE bup_db1.t5(
+Gender CHAR(5),
+cand_age INT,
+FOREIGN KEY(cand_age) REFERENCES bup_db2.t2(age)
+)ENGINE=INNODB;
+Loading data into table t5
+INSERT INTO bup_db1.t5 VALUES
+('F',23),('F',24),('M',19),('F',28),
+('M',43),('F',30),('M',31),('M',27);
+SELECT * FROM bup_db1.t5 ORDER BY Gender;
+Gender cand_age
+F 23
+F 24
+F 28
+F 30
+M 19
+M 43
+M 31
+M 27
+******Create view v6********
+CREATE VIEW bup_db1.v6 AS SELECT education,gender
+FROM bup_db2.v2, bup_db1.t5 WHERE cand_age=age;
+SELECT * FROM bup_db1.t1 ORDER BY id;
+id name city
+1 aa1 RR1
+2 aa2 RR2
+3 aa3 RR3
+4 aa4 RR4
+5 aa5 RR5
+6 aa6 RR6
+7 aa7 RR7
+8 aa8 RR8
+SELECT * FROM bup_db1.t3 ORDER BY scode;
+ccode District scode
+234 zuloa 1
+321 yyy 2
+765 iug 3
+124 LKJ 4
+235 uth 6
+SELECT * FROM bup_db1.t5 ORDER BY Gender;
+Gender cand_age
+F 23
+F 24
+F 28
+F 30
+M 19
+M 43
+M 31
+M 27
+SELECT * FROM bup_db1.v1;
+id name city
+1 aa1 RR1
+2 aa2 RR2
+3 aa3 RR3
+4 aa4 RR4
+5 aa5 RR5
+6 aa6 RR6
+7 aa7 RR7
+8 aa8 RR8
+SELECT * FROM bup_db1.vcomb ORDER BY name;
+name city ccode
+aa1 RR1 234
+aa2 RR2 321
+aa3 RR3 765
+aa4 RR4 124
+aa6 RR6 235
+SELECT * FROM bup_db1.v5 ORDER BY age;
+idno age education
+3 19 School
+1 23 BS
+2 24 BE
+8 27 Undergrad
+4 28 MS
+6 30 Doctor
+7 31 Lawyer
+5 43 PHD
+SELECT * FROM bup_db1.v6 ORDER BY education, gender;
+education gender
+BE F
+BS F
+Doctor F
+Lawyer M
+MS F
+PHD M
+School M
+Undergrad M
+excercise objects of bup_db2
+SELECT * FROM bup_db2.t2 ORDER BY age;
+idno age education
+3 19 School
+1 23 BS
+2 24 BE
+8 27 Undergrad
+4 28 MS
+6 30 Doctor
+7 31 Lawyer
+5 43 PHD
+SELECT * FROM bup_db2.v2 ORDER BY age;
+age education
+19 School
+23 BS
+24 BE
+27 Undergrad
+28 MS
+30 Doctor
+31 Lawyer
+43 PHD
+SELECT * FROM bup_db2.v3 ORDER BY age;
+name age education
+aa3 19 School
+aa1 23 BS
+aa2 24 BE
+aa8 27 Undergrad
+aa4 28 MS
+aa6 30 Doctor
+aa7 31 Lawyer
+aa5 43 PHD
+SELECT * FROM bup_db2.vv;
+N A E
+aa1 23 BS
+aa2 24 BE
+aa3 19 School
+aa4 28 MS
+aa5 43 PHD
+aa6 30 Doctor
+aa7 31 Lawyer
+aa8 27 Undergrad
+SELECT * FROM bup_db2.student_details;
+ccode District scode
+765 iug 3
+124 LKJ 4
+235 uth 6
+321 yyy 2
+234 zuloa 1
+showing objects and create statements.
+SHOW FULL TABLES FROM bup_db1;;
+Tables_in_bup_db1 t1
+Table_type BASE TABLE
+Tables_in_bup_db1 t3
+Table_type BASE TABLE
+Tables_in_bup_db1 t5
+Table_type BASE TABLE
+Tables_in_bup_db1 v1
+Table_type VIEW
+Tables_in_bup_db1 v5
+Table_type VIEW
+Tables_in_bup_db1 v6
+Table_type VIEW
+Tables_in_bup_db1 vcomb
+Table_type VIEW
+SHOW FULL TABLES FROM bup_db2;;
+Tables_in_bup_db2 student_details
+Table_type VIEW
+Tables_in_bup_db2 t2
+Table_type BASE TABLE
+Tables_in_bup_db2 v2
+Table_type VIEW
+Tables_in_bup_db2 v3
+Table_type VIEW
+Tables_in_bup_db2 vv
+Table_type VIEW
+SHOW CREATE VIEW bup_db1.v1;;
+View v1
+Create View CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`id` AS `id`,`t1`.`name` AS `name`,`t1`.`city` AS `city` from `t1`
+character_set_client latin1
+collation_connection latin1_swedish_ci
+SHOW CREATE VIEW bup_db1.vcomb;;
+View vcomb
+Create View CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `vcomb` AS select `t1`.`name` AS `name`,`t1`.`city` AS `city`,`t3`.`ccode` AS `ccode` from (`t1` join `t3`) where (`t1`.`id` = `t3`.`scode`)
+character_set_client latin1
+collation_connection latin1_swedish_ci
+SHOW CREATE VIEW bup_db2.v3;;
+View v3
+Create View CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `bup_db2`.`v3` AS select `bup_db1`.`t1`.`name` AS `name`,`bup_db2`.`t2`.`age` AS `age`,`bup_db2`.`t2`.`education` AS `education` from (`bup_db1`.`t1` join `bup_db2`.`t2`) where (`bup_db1`.`t1`.`id` = `bup_db2`.`t2`.`idno`)
+character_set_client latin1
+collation_connection latin1_swedish_ci
+backup database
+BACKUP DATABASE bup_db1, bup_db2 TO 'bup_objectview.bak';
+backup_id
+#
+BACKUP DATABASE bup_db1 TO 'bup_objectview1.bak';
+backup_id
+#
+BACKUP DATABASE bup_db2 TO 'bup_objectview2.bak';
+backup_id
+#
+dropping database.
+DROP TABLE bup_db1.t3;
+DROP TABLE bup_db1.t5;
+DROP TABLE bup_db2.t2;
+DROP DATABASE bup_db1;
+DROP DATABASE bup_db2;
+Restore database.
+restore database with view dependency to other, non-existing db
+RESTORE FROM 'bup_objectview1.bak';
+ERROR HY000: Could not restore view `bup_db1`.`v5`. Please check the view definition for possible missing dependencies.
+DROP DATABASE bup_db1;
+RESTORE FROM 'bup_objectview2.bak';
+ERROR HY000: Could not restore view `bup_db2`.`student_details`. Please check the view definition for possible missing dependencies.
+DROP DATABASE bup_db2;
+RESTORE FROM 'bup_objectview.bak';
+backup_id
+#
+showing objects and create statements
+SHOW CREATE DATABASE bup_db1;;
+Database bup_db1
+Create Database CREATE DATABASE `bup_db1` /*!40100 DEFAULT CHARACTER SET latin1 */
+SHOW FULL TABLES FROM bup_db1;;
+Tables_in_bup_db1 t1
+Table_type BASE TABLE
+Tables_in_bup_db1 t3
+Table_type BASE TABLE
+Tables_in_bup_db1 t5
+Table_type BASE TABLE
+Tables_in_bup_db1 v1
+Table_type VIEW
+Tables_in_bup_db1 v5
+Table_type VIEW
+Tables_in_bup_db1 v6
+Table_type VIEW
+Tables_in_bup_db1 vcomb
+Table_type VIEW
+SHOW FULL TABLES FROM bup_db2;;
+Tables_in_bup_db2 student_details
+Table_type VIEW
+Tables_in_bup_db2 t2
+Table_type BASE TABLE
+Tables_in_bup_db2 v2
+Table_type VIEW
+Tables_in_bup_db2 v3
+Table_type VIEW
+Tables_in_bup_db2 vv
+Table_type VIEW
+SHOW CREATE VIEW bup_db1.v1;;
+View v1
+Create View CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `bup_db1`.`v1` AS select `bup_db1`.`t1`.`id` AS `id`,`bup_db1`.`t1`.`name` AS `name`,`bup_db1`.`t1`.`city` AS `city` from `bup_db1`.`t1`
+character_set_client latin1
+collation_connection latin1_swedish_ci
+SHOW CREATE VIEW bup_db1.vcomb;;
+View vcomb
+Create View CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `bup_db1`.`vcomb` AS select `bup_db1`.`t1`.`name` AS `name`,`bup_db1`.`t1`.`city` AS `city`,`bup_db1`.`t3`.`ccode` AS `ccode` from (`bup_db1`.`t1` join `bup_db1`.`t3`) where (`bup_db1`.`t1`.`id` = `bup_db1`.`t3`.`scode`)
+character_set_client latin1
+collation_connection latin1_swedish_ci
+SHOW CREATE VIEW bup_db2.v3;;
+View v3
+Create View CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `bup_db2`.`v3` AS select `bup_db1`.`t1`.`name` AS `name`,`bup_db2`.`t2`.`age` AS `age`,`bup_db2`.`t2`.`education` AS `education` from (`bup_db1`.`t1` join `bup_db2`.`t2`) where (`bup_db1`.`t1`.`id` = `bup_db2`.`t2`.`idno`)
+character_set_client latin1
+collation_connection latin1_swedish_ci
+****check for view contents after Restore*****
+SELECT * FROM bup_db1.t1 ORDER BY id;
+id name city
+1 aa1 RR1
+2 aa2 RR2
+3 aa3 RR3
+4 aa4 RR4
+5 aa5 RR5
+6 aa6 RR6
+7 aa7 RR7
+8 aa8 RR8
+SELECT * FROM bup_db1.t3 ORDER BY scode;
+ccode District scode
+234 zuloa 1
+321 yyy 2
+765 iug 3
+124 LKJ 4
+235 uth 6
+SELECT * FROM bup_db1.t5 ORDER BY Gender;
+Gender cand_age
+F 23
+F 24
+F 28
+F 30
+M 19
+M 43
+M 31
+M 27
+SELECT * FROM bup_db1.v1;
+id name city
+1 aa1 RR1
+2 aa2 RR2
+3 aa3 RR3
+4 aa4 RR4
+5 aa5 RR5
+6 aa6 RR6
+7 aa7 RR7
+8 aa8 RR8
+SELECT * FROM bup_db1.vcomb ORDER BY name;
+name city ccode
+aa1 RR1 234
+aa2 RR2 321
+aa3 RR3 765
+aa4 RR4 124
+aa6 RR6 235
+SELECT * FROM bup_db1.v5 ORDER BY age;
+idno age education
+3 19 School
+1 23 BS
+2 24 BE
+8 27 Undergrad
+4 28 MS
+6 30 Doctor
+7 31 Lawyer
+5 43 PHD
+SELECT * FROM bup_db1.v6 ORDER BY education, gender;
+education gender
+BE F
+BS F
+Doctor F
+Lawyer M
+MS F
+PHD M
+School M
+Undergrad M
+excercise objects of bup_db2
+SELECT * FROM bup_db2.t2 ORDER BY age;
+idno age education
+3 19 School
+1 23 BS
+2 24 BE
+8 27 Undergrad
+4 28 MS
+6 30 Doctor
+7 31 Lawyer
+5 43 PHD
+SELECT * FROM bup_db2.v2 ORDER BY age;
+age education
+19 School
+23 BS
+24 BE
+27 Undergrad
+28 MS
+30 Doctor
+31 Lawyer
+43 PHD
+SELECT * FROM bup_db2.v3 ORDER BY age;
+name age education
+aa3 19 School
+aa1 23 BS
+aa2 24 BE
+aa8 27 Undergrad
+aa4 28 MS
+aa6 30 Doctor
+aa7 31 Lawyer
+aa5 43 PHD
+SELECT * FROM bup_db2.vv;
+N A E
+aa1 23 BS
+aa2 24 BE
+aa3 19 School
+aa4 28 MS
+aa5 43 PHD
+aa6 30 Doctor
+aa7 31 Lawyer
+aa8 27 Undergrad
+SELECT * FROM bup_db2.student_details;
+ccode District scode
+765 iug 3
+124 LKJ 4
+235 uth 6
+321 yyy 2
+234 zuloa 1
+ALTER TABLE bup_db1.t1 CHANGE name name VARCHAR(10);
+DESCRIBE bup_db1.t1;
+Field Type Null Key Default Extra
+id int(11) NO PRI NULL
+name varchar(10) YES NULL
+city varchar(10) YES NULL
+SELECT * FROM bup_db1.t1 ORDER BY id;
+id name city
+1 aa1 RR1
+2 aa2 RR2
+3 aa3 RR3
+4 aa4 RR4
+5 aa5 RR5
+6 aa6 RR6
+7 aa7 RR7
+8 aa8 RR8
+SELECT * FROM bup_db1.v1;
+id name city
+1 aa1 RR1
+2 aa2 RR2
+3 aa3 RR3
+4 aa4 RR4
+5 aa5 RR5
+6 aa6 RR6
+7 aa7 RR7
+8 aa8 RR8
+SELECT * FROM bup_db2.v3 ORDER BY age;
+name age education
+aa3 19 School
+aa1 23 BS
+aa2 24 BE
+aa8 27 Undergrad
+aa4 28 MS
+aa6 30 Doctor
+aa7 31 Lawyer
+aa5 43 PHD
+BACKUP DATABASE bup_db1, bup_db2 TO 'bup_objectview3.bak';
+backup_id
+#
+DROP TABLE bup_db1.t3;
+DROP TABLE bup_db1.t5;
+DROP TABLE bup_db2.t2;
+DROP DATABASE bup_db1;
+DROP DATABASE bup_db2;
+RESTORE FROM 'bup_objectview3.bak';
+backup_id
+#
+SELECT * FROM bup_db2.v3 ORDER BY age;
+name age education
+aa3 19 School
+aa1 23 BS
+aa2 24 BE
+aa8 27 Undergrad
+aa4 28 MS
+aa6 30 Doctor
+aa7 31 Lawyer
+aa5 43 PHD
+SELECT * FROM bup_db1.t1 ORDER BY id;
+id name city
+1 aa1 RR1
+2 aa2 RR2
+3 aa3 RR3
+4 aa4 RR4
+5 aa5 RR5
+6 aa6 RR6
+7 aa7 RR7
+8 aa8 RR8
+
+*** ENTER Backup of database with missing view dependency
+*** should fail but not crash server
+*** Test for bug#34902 ***
+initializing test
+DROP TABLE bup_db1.t3;
+DROP TABLE bup_db1.t5;
+DROP TABLE bup_db2.t2;
+DROP DATABASE bup_db1;
+DROP DATABASE bup_db2;
+RESTORE FROM 'bup_objectview.bak';
+backup_id
+#
+SELECT * FROM bup_db1.t1;
+id name city
+1 aa1 RR1
+2 aa2 RR2
+3 aa3 RR3
+4 aa4 RR4
+5 aa5 RR5
+6 aa6 RR6
+7 aa7 RR7
+8 aa8 RR8
+SELECT * FROM bup_db1.v1;
+id name city
+1 aa1 RR1
+2 aa2 RR2
+3 aa3 RR3
+4 aa4 RR4
+5 aa5 RR5
+6 aa6 RR6
+7 aa7 RR7
+8 aa8 RR8
+DROP TABLE bup_db1.t3;
+DROP TABLE bup_db1.t5;
+DROP TABLE bup_db2.t2;
+DROP TABLE bup_db1.t1;
+
+Testing backup with missing view dependency in same db
+
+SELECT * FROM bup_db1.v1;
+ERROR HY000: View 'bup_db1.v1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
+BACKUP DATABASE bup_db1 TO 'bup_shouldfail1.bak';
+ERROR HY000: Failed to add view `bup_db1`.`v1` to the catalog
+
+Testing backup with missing view dependency in other db
+
+USE bup_db2;
+SELECT * from bup_db2.v3;
+ERROR HY000: View 'bup_db2.v3' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
+BACKUP DATABASE bup_db2 TO 'bup_shouldfail2.bak';
+ERROR HY000: Failed to add view `bup_db2`.`student_details` to the catalog
+
+*** EXIT Backup of database with missing view dependency
+
+
+*** ENTER Backup of database with altered view should report error, not crash server
+Test for bug#34867
+initializing test
+DROP DATABASE bup_db1;
+DROP DATABASE bup_db2;
+RESTORE FROM 'bup_objectview.bak';
+backup_id
+#
+USE bup_db1;
+CREATE VIEW alter1 AS SELECT 5;
+CREATE VIEW alter2 AS SELECT * FROM alter1;
+ALTER VIEW alter1 AS SELECT 6;
+
+Testing view selecting from altered view
+
+SELECT * FROM alter2;
+ERROR HY000: View 'bup_db1.alter2' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
+BACKUP DATABASE bup_db1 TO 'bup_alterview.bak';
+ERROR HY000: View 'bup_db1.alter2' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
+
+*** EXIT Backup of database with altered view
+
+
+*** DROP bup_db1, bup_db2 DATABASE ****
+
+DROP TABLE bup_db1.t3;
+DROP TABLE bup_db1.t5;
+DROP TABLE bup_db2.t2;
+DROP DATABASE bup_db1;
+DROP DATABASE bup_db2;
=== added file 'mysql-test/suite/backup/t/backup_timeout.test'
--- a/mysql-test/suite/backup/t/backup_timeout.test 1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/backup/t/backup_timeout.test 2008-09-26 22:16:02 +0000
@@ -0,0 +1,162 @@
+#
+# This test is for the DDL blocker timeout feature.
+#
+
+--source include/have_innodb.inc
+--source include/have_debug.inc
+--source include/not_embedded.inc
+--source include/have_debug_sync.inc
+
+SET DEBUG_SYNC= 'reset';
+
+#
+# Remove backup files (if they exist)
+#
+
+--error 0,1
+--remove_file $MYSQLTEST_VARDIR/master-data/bup_ddl_blocker.bak;
+
+#
+# Connections used in this test
+#
+# con1 used to create data, load data, and run the backup
+# con2-con4 used for DDL statements: 2 before backup and 2 during backup
+# con5 used for setting and releasing breakpoints
+#
+
+connect (con1,localhost,root,,);
+connect (con2,localhost,root,,);
+connect (con3,localhost,root,,);
+connect (con4,localhost,root,,);
+connect (con5,localhost,root,,);
+
+connection con1;
+
+# Create data for this test and tailor it to the test.
+--disable_warnings
+DROP DATABASE IF EXISTS bup_ddl_blocker;
+--enable_warnings
+
+CREATE DATABASE bup_ddl_blocker;
+
+# Create a table and load it with data.
+--echo con1: Creating tables
+CREATE TABLE bup_ddl_blocker.t1 (col_a CHAR(40)) ENGINE=INNODB;
+
+--echo con1: Loading data
+INSERT INTO bup_ddl_blocker.t1 VALUES ("01 Some data to test");
+INSERT INTO bup_ddl_blocker.t1 VALUES ("02 Some data to test");
+INSERT INTO bup_ddl_blocker.t1 VALUES ("03 Some data to test");
+
+SHOW VARIABLES LIKE 'backup_wait%';
+
+#
+# Part A - test timeout for one session
+#
+--echo Part A
+
+--error 0,1
+--remove_file $MYSQLTEST_VARDIR/master-data/bup_ddl_blocker.bak
+
+connection con1;
+
+--echo con1: Activate synchronization points for backup.
+SET DEBUG_SYNC= 'after_block_ddl SIGNAL bup_blocked WAIT_FOR timeout_done';
+
+--echo con1: Get a backup going and stop after the DDL blocker is fired.
+send BACKUP DATABASE bup_ddl_blocker TO "bup_ddl_blocker.bak";
+
+connection con2;
+
+SET DEBUG_SYNC= 'now WAIT_FOR bup_blocked';
+
+--echo Set ddl timeout to 1 second
+SET backup_wait_timeout = 1;
+SHOW VARIABLES LIKE 'backup_wait%';
+
+--echo con2: Try a ddl operation and watch it expire
+--error ER_DDL_TIMEOUT
+CREATE TABLE bup_ddl_blocker.t2 (col_a CHAR(40)) ENGINE=MEMORY;
+
+connection con5;
+--echo release the lock.
+--echo con5: Resume all.
+SET DEBUG_SYNC= 'now SIGNAL timeout_done';
+
+# Reconnect to con1 and let backup finish.
+
+connection con1;
+--replace_column 1 #
+reap;
+
+#
+# Part B - test timeout for a session with a timeout,
+# and a session with no timeout (backup_wait_timeout = 0)
+#
+--echo Part B
+
+--error 0,1
+--remove_file $MYSQLTEST_VARDIR/master-data/bup_ddl_blocker.bak
+
+connection con1;
+
+--echo con1: Activate synchronization points for backup.
+SET DEBUG_SYNC= 'after_block_ddl SIGNAL bup_blocked WAIT_FOR timeout_done';
+
+--echo con1: Get a backup going and stop after the DDL blocker is fired.
+send BACKUP DATABASE bup_ddl_blocker TO "bup_ddl_blocker.bak";
+
+connection con2;
+
+SET DEBUG_SYNC= 'now WAIT_FOR bup_blocked';
+
+--echo Set ddl timeout to 0 seconds
+SET backup_wait_timeout = 0;
+SHOW VARIABLES LIKE 'backup_wait%';
+
+--echo con2: Try a ddl operation and it should expire
+--error ER_DDL_TIMEOUT
+CREATE TABLE bup_ddl_blocker.t3 (col_a CHAR(40)) ENGINE=MEMORY;
+
+connection con3;
+
+SET backup_wait_timeout = 100;
+SHOW VARIABLES LIKE 'backup_wait%';
+
+--echo con3: Try a ddl operation and it should not expire
+send CREATE TABLE bup_ddl_blocker.t3 (col_a CHAR(40)) ENGINE=MEMORY;
+
+connection con5;
+--echo release the lock.
+--echo con5: Resume all.
+SET DEBUG_SYNC= 'now SIGNAL timeout_done';
+
+# Reconnect to con1 and let backup finish.
+
+connection con1;
+--replace_column 1 #
+reap;
+
+connection con3;
+reap;
+
+USE bup_ddl_blocker;
+SHOW FULL TABLES;
+
+#
+# Part C - test default behavior: set backup timeout = default
+#
+--echo Part C
+
+connection con1;
+
+--echo Show that the variable can be reset to its timeout value using
+--echo SET backup_wait_timeout = DEFAULT;
+SET backup_wait_timeout = 1;
+SHOW VARIABLES LIKE 'backup_wait%';
+SET backup_wait_timeout = DEFAULT;
+SHOW VARIABLES LIKE 'backup_wait%';
+
+DROP DATABASE bup_ddl_blocker;
+
+--remove_file $MYSQLTEST_VARDIR/master-data/bup_ddl_blocker.bak
=== added file 'mysql-test/suite/backup/t/backup_triggers_and_events.test'
--- a/mysql-test/suite/backup/t/backup_triggers_and_events.test 1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/backup/t/backup_triggers_and_events.test 2008-09-26 22:16:02 +0000
@@ -0,0 +1,214 @@
+--source include/have_debug_sync.inc
+--source include/not_embedded.inc
+
+# This test checks that re-created events or triggers are not fired during
+# RESTORE operation.
+#
+# Author: Rafal Somla
+
+--disable_warnings
+--error 0,1
+remove_file $MYSQL_TEST_DIR/var/master-data/db.bak;
+--enable_warnings
+
+SET GLOBAL event_scheduler=off;
+SET DEBUG_SYNC = 'RESET';
+
+# We need a separate connection to measure timing for RESTORE command. This is
+# because of BUG#35806: time stops in a thread executing RESTORE command.
+
+connect(con1, localhost, root,,);
+connect(con2, localhost, root,,);
+
+--connection con1
+
+# Events and triggers will insert entries into a log table so that we can see
+# if they have fired.
+
+--echo Creating log table.
+
+--disable_warnings
+DROP TABLE IF EXISTS test.logt;
+--enable_warnings
+
+CREATE TABLE test.logt(ts timestamp, db char(8), msg text);
+
+--echo Creating database db and its objects.
+
+--disable_warnings
+DROP DATABASE IF EXISTS db;
+--enable_warnings
+
+CREATE DATABASE db;
+USE db;
+
+CREATE TABLE t1 (a int);
+INSERT INTO t1 VALUES (0),(1),(2),(3),(4),(5),(6);
+
+delimiter ||;
+
+CREATE EVENT ev ON SCHEDULE EVERY 1 second DO
+BEGIN
+ INSERT INTO test.logt(db, msg) VALUES ('db','Db event fired!');
+END;
+||
+
+CREATE PROCEDURE trg_msg(a int)
+BEGIN
+ INSERT INTO test.logt(db, msg) VALUES ('db','Db trigger fired!');
+END;
+||
+
+CREATE TRIGGER after_ins AFTER INSERT ON t1 FOR EACH ROW
+CALL trg_msg(NEW.a);
+||
+
+CREATE TRIGGER after_upd AFTER UPDATE ON t1 FOR EACH ROW
+CALL trg_msg(NEW.a);
+||
+
+CREATE TRIGGER after_del AFTER DELETE ON t1 FOR EACH ROW
+CALL trg_msg(OLD.a);
+||
+
+CREATE TRIGGER before_ins BEFORE INSERT ON t1 FOR EACH ROW
+CALL trg_msg(NEW.a);
+||
+
+CREATE TRIGGER before_upd BEFORE UPDATE ON t1 FOR EACH ROW
+CALL trg_msg(NEW.a);
+||
+
+CREATE TRIGGER before_del BEFORE DELETE ON t1 FOR EACH ROW
+CALL trg_msg(OLD.a);
+||
+
+# Create an event and trigger in test database to see that they are not
+# affected by RESTORE of another database.
+
+USE test||
+
+--disable_warnings
+DROP EVENT IF EXISTS ev||
+DROP TABLE IF EXISTS t1||
+DROP TRIGGER IF EXISTS trg||
+--enable_warnings
+
+CREATE EVENT ev ON SCHEDULE EVERY 1 second DO
+BEGIN
+ INSERT INTO test.logt(db, msg) VALUES ('test','Test event fired!');
+END;
+||
+
+CREATE TABLE t1 (a int)||
+
+CREATE TRIGGER trg AFTER INSERT ON t1 FOR EACH ROW
+BEGIN
+ INSERT INTO test.logt(db, msg) VALUES ('test','Test trigger fired');
+END;
+||
+
+delimiter ;||
+
+--echo Backing-up database db and dropping it.
+
+--replace_column 1 #
+BACKUP DATABASE db TO 'db.bak';
+DROP DATABASE db;
+
+--echo Enabling event scheduler.
+SET GLOBAL event_scheduler=on;
+
+--connection con1
+
+--echo con1: clearing log table and starting RESTORE operation.
+--echo con1: RESTORE will pause after restoring table data.
+
+# Synchronization point 'restore_table_data_before_end' is inside RESTORE code,
+# after restore drivers have finished their job but before they have been shoot
+# down.
+
+SET DEBUG_SYNC = 'restore_table_data_before_end SIGNAL waiting WAIT_FOR continue';
+DELETE FROM test.logt;
+--send RESTORE FROM 'db.bak'
+
+--connection con2
+
+# Record the time when RESTORE has started.
+SELECT now() INTO @start;
+
+--echo con2: checking that there are no triggers and events at the end of RESTORE execution.
+
+# Wait until RESTORE reaches the moment when all table data is restored.
+SET DEBUG_SYNC = 'now WAIT_FOR waiting';
+# There should be no triggers and no events at this moment (they are created
+# after table data is restored)
+--query_vertical SHOW TRIGGERS FROM db
+--query_vertical SHOW EVENTS IN db
+
+--echo con2: activating trigger in test database.
+INSERT INTO test.t1 VALUES (1);
+
+--echo con2: ensuring that RESTORE takes at least 3 secs.
+
+# This is so that db.ev event has chance to fire if it is not correctly handled
+# (e.g. enabled during table data restore).
+--sleep 3
+SET DEBUG_SYNC = 'now SIGNAL continue';
+
+--connection con1
+
+--echo con1: finishing RESTORE operation.
+--replace_column 1 #
+--reap
+SET GLOBAL event_scheduler=off;
+
+--connection con2
+
+-- echo con2: checking that RESTORE took more than 2 secs.
+
+SELECT timediff(now(),@start) > 2;
+
+--echo Checking that objects have been restored.
+
+USE db;
+
+SHOW TABLES IN db;
+SELECT count(*) FROM db.t1;
+--replace_column 9 #
+--query_vertical SHOW TRIGGERS FROM db
+--replace_column 9 #
+--query_vertical SHOW EVENTS IN db
+
+--echo Checking that no db event or trigger fired during RESTORE.
+
+# There should be no entries in the log table from the time when RESTORE
+# was running (but there could be entries inserted by event firing *after*
+# RESTORE has completed). We know that RESTORE took at least 3 sec and we
+# take 2 sec window form the beginning of the operation. This is enough
+# to see db.ev in case it fired during RESTORE operation (this event is sheduled
+# to fire every second).
+
+SELECT * FROM test.logt WHERE db = 'db' AND timediff(ts,@start) < 2;
+
+--echo Checking that test event and trigger could fire.
+
+# Checking that the trigger has fired.
+SELECT count(*) > 0 FROM test.logt
+WHERE db = 'test'
+AND msg LIKE '%trigger fired%'
+AND timediff(ts,@start) < 2;
+
+# Checking that the event has fired.
+SELECT count(*) > 0 FROM test.logt
+WHERE db = 'test'
+AND msg LIKE '%event fired%'
+AND timediff(ts,@start) < 2;
+
+--echo Cleaning up.
+DROP EVENT test.ev;
+DROP TRIGGER test.trg;
+DROP TABLE test.logt;
+DROP TABLE test.t1;
+DROP DATABASE db;
+remove_file $MYSQL_TEST_DIR/var/master-data/db.bak;
=== added file 'mysql-test/suite/backup/t/backup_view_on_view.test'
--- a/mysql-test/suite/backup/t/backup_view_on_view.test 1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/backup/t/backup_view_on_view.test 2008-09-26 22:16:02 +0000
@@ -0,0 +1,32 @@
+# Test case for bug#34758
+
+--source include/not_embedded.inc
+--source include/have_debug.inc
+--source include/have_innodb.inc
+
+# Setup the server to use the backup breakpoints
+SET GLOBAL debug="d,backup:d,backup_data";
+
+--disable_warnings
+DROP DATABASE IF EXISTS db1;
+--enable_warnings
+
+CREATE DATABASE db1;
+
+CREATE TABLE db1.t1(a int) ENGINE=INNODB;
+CREATE VIEW db1.v1 AS SELECT * FROM db1.t1;
+CREATE VIEW db1.v2 AS SELECT * FROM db1.v1;
+
+INSERT INTO db1.t1 VALUES (1),(2),(3),(5),(7),(11);
+
+replace_column 1 #;
+BACKUP DATABASE db1 TO 'test.bak';
+replace_column 1 #;
+RESTORE FROM 'test.bak';
+
+SELECT * FROM db1.v2;
+SELECT * FROM db1.v1;
+SELECT * FROM db1.t1;
+
+DROP DATABASE db1;
+
=== added file 'mysql-test/suite/backup/t/backup_views.test'
--- a/mysql-test/suite/backup/t/backup_views.test 1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/backup/t/backup_views.test 2008-09-26 22:16:02 +0000
@@ -0,0 +1,387 @@
+###########################################################################
+# Author: Hema
+# Date: 2008-04-11
+# Purpose: To test the metadata consistency of views.
+###############################################################################
+--source include/have_innodb.inc
+--source include/not_embedded.inc
+--source include/have_debug.inc
+
+connect (backup,localhost,root,,);
+connect (breakpoints,localhost,root,,);
+
+##############################################################
+--echo
+--echo starting the test for backup
+--echo
+##############################################################
+
+--error 0,1
+--remove_file $MYSQLTEST_VARDIR/master-data/bup_objectview.bak
+
+#Create Database and object view for this test.
+
+--disable_warnings
+DROP DATABASE IF EXISTS bup_db1;
+DROP DATABASE IF EXISTS bup_db2;
+
+#
+# We are creating 2 databases bup_db1 and bup_db2 to accomplish wide testing
+# of views in order to check their consistency after BACKUP AND RESTORE.
+# In bup_db1 DATABASE consists of tables :t1 t3 t5
+# and views v1(based on t1 alone), vcomb(based on t1 and t3),
+# v5( based on bup_db2.t2), v6(based on bup_db2.v2,bup_db1.t5)
+#
+# In bup_db2,it consists table t2
+# views v2(based on t2), v3( based on combination of bup_db1 and bup_db2),
+# v4( based on bup_db1.t3), vv( based on v3)
+#
+
+--enable_warnings
+CREATE DATABASE bup_db1;
+USE bup_db1;
+
+#Create table and load with data.
+
+--echo Creating Table t1
+CREATE TABLE bup_db1.t1(
+id INT NOT NULL PRIMARY KEY,
+name CHAR(10),
+city VARCHAR(10)
+)ENGINE=INNODB;
+
+--echo loading data
+INSERT INTO bup_db1.t1 VALUES
+(1,'aa1','RR1'),(2,'aa2','RR2'),(3,'aa3','RR3'),(4,'aa4','RR4'),
+(5,'aa5','RR5'),(6,'aa6','RR6'),(7,'aa7','RR7'),(8,'aa8','RR8');
+
+SELECT * FROM bup_db1.t1 ORDER BY id;
+
+--echo Creating Table t3
+
+CREATE TABLE bup_db1.t3(
+ccode INT,
+District CHAR(20) NOT NULL PRIMARY KEY,
+scode INT,
+FOREIGN KEY (scode) REFERENCES bup_db1.t1(id)
+)ENGINE=INNODB;
+
+--echo Loading Data
+
+INSERT INTO t3 VALUES
+(234, 'zuloa',1),(321,'yyy',2),(765,'iug',3),
+(124,'LKJ',4),(235,'uth',6);
+
+SELECT * FROM bup_db1.t3 ORDER BY scode;
+
+--echo *****Create view from the table bup_db1.t1*******
+
+CREATE VIEW bup_db1.v1 AS SELECT * FROM bup_db1.t1;
+
+--echo ***Create views from 2 tables(t1 and t3) within same DB bup_db1****
+
+CREATE VIEW bup_db1.vcomb AS
+SELECT name, city, ccode FROM bup_db1.t1, bup_db1.t3 WHERE id=scode;
+
+CREATE DATABASE bup_db2;
+
+CREATE TABLE bup_db2.t2(
+idno INT,
+age INT PRIMARY KEY,
+education CHAR(20) ,
+FOREIGN KEY (idno) REFERENCES bup_db1.t1(id)
+)ENGINE=INNODB;
+
+INSERT INTO bup_db2.t2 VALUES
+(1,23,'BS'),(2,24,'BE'),(3,19,'School'),(4,28,'MS'),
+(5,43,'PHD'),(6,30,'Doctor'),(7,31,'Lawyer'),(8,27,'Undergrad');
+
+SELECT * FROM bup_db2.t2 ORDER BY age;
+
+--echo ****Create view in bup_db2****
+
+CREATE VIEW bup_db2.v2 AS SELECT age, education FROM bup_db2.t2;
+
+--echo ******Create views from combination of 2 databases*******
+
+CREATE VIEW bup_db2.v3 AS SELECT name, age, education
+FROM bup_db1.t1 , bup_db2.t2 WHERE id=idno;
+
+--echo *********Create view from another view in bup_db2***********.
+
+# Bug#35347 Mysql Server crash while doing restore with views for default driver
+# BUG#34758 Server crashes if database with views backed up using CS driver
+#Creating view from another view is possible if bug#35347 and bug#34758is fixed.
+
+CREATE VIEW bup_db2.vv (N, A, E) AS SELECT * FROM bup_db2.v3;
+
+--echo *****Create view from other Database********
+
+CREATE VIEW bup_db2.v4 AS SELECT * FROM bup_db1.t3;
+
+--echo Rename the view name
+
+RENAME TABLE bup_db2.v4 to bup_db2.student_details;
+
+--echo *******Create view from database bup_db2**********
+
+CREATE VIEW bup_db1.v5 AS SELECT * FROM bup_db2.t2;
+
+--echo Creating Table t5
+
+CREATE TABLE bup_db1.t5(
+Gender CHAR(5),
+cand_age INT,
+FOREIGN KEY(cand_age) REFERENCES bup_db2.t2(age)
+)ENGINE=INNODB;
+
+--echo Loading data into table t5
+
+INSERT INTO bup_db1.t5 VALUES
+('F',23),('F',24),('M',19),('F',28),
+('M',43),('F',30),('M',31),('M',27);
+
+SELECT * FROM bup_db1.t5 ORDER BY Gender;
+
+#Bug#36213 Restore fails for a database that has views created using
+#another database .
+
+--echo ******Create view v6********
+CREATE VIEW bup_db1.v6 AS SELECT education,gender
+FROM bup_db2.v2, bup_db1.t5 WHERE cand_age=age;
+
+#Excercise the objects of bup_db1
+
+SELECT * FROM bup_db1.t1 ORDER BY id;
+SELECT * FROM bup_db1.t3 ORDER BY scode;
+SELECT * FROM bup_db1.t5 ORDER BY Gender;
+SELECT * FROM bup_db1.v1;
+SELECT * FROM bup_db1.vcomb ORDER BY name;
+SELECT * FROM bup_db1.v5 ORDER BY age;
+SELECT * FROM bup_db1.v6 ORDER BY education, gender;
+
+--echo excercise objects of bup_db2
+
+SELECT * FROM bup_db2.t2 ORDER BY age;
+SELECT * FROM bup_db2.v2 ORDER BY age;
+SELECT * FROM bup_db2.v3 ORDER BY age;
+SELECT * FROM bup_db2.vv;
+SELECT * FROM bup_db2.student_details; #view v4 is renamed as student_details
+
+#Show the data and Create statements
+
+--echo showing objects and create statements.
+--query_vertical SHOW FULL TABLES FROM bup_db1;
+--query_vertical SHOW FULL TABLES FROM bup_db2;
+--query_vertical SHOW CREATE VIEW bup_db1.v1;
+--query_vertical SHOW CREATE VIEW bup_db1.vcomb;
+--query_vertical SHOW CREATE VIEW bup_db2.v3;
+
+#Backup and restore data.
+--echo backup database
+
+replace_column 1 #;
+BACKUP DATABASE bup_db1, bup_db2 TO 'bup_objectview.bak';
+
+replace_column 1 #;
+BACKUP DATABASE bup_db1 TO 'bup_objectview1.bak';
+
+replace_column 1 #;
+BACKUP DATABASE bup_db2 TO 'bup_objectview2.bak';
+
+--echo dropping database.
+DROP TABLE bup_db1.t3;
+DROP TABLE bup_db1.t5;
+DROP TABLE bup_db2.t2;
+DROP DATABASE bup_db1;
+DROP DATABASE bup_db2;
+
+--echo Restore database.
+
+# Individual databases cannot be restored because of VIEW DEPENDENCY
+# For restoring we need base tables in the database, otherwise the
+# Restore will fail. Once this bug is fixed, we can remove the '#'
+# for the restore below.
+
+--echo restore database with view dependency to other, non-existing db
+
+--error ER_BACKUP_CANT_RESTORE_VIEW
+RESTORE FROM 'bup_objectview1.bak';
+
+# An incomplete bup_db1 was created by the failing restore operation.
+# Remove it before trying restore of bup_db2.
+DROP DATABASE bup_db1;
+
+--error ER_BACKUP_CANT_RESTORE_VIEW
+RESTORE FROM 'bup_objectview2.bak';
+
+# An incomplete bup_db2 was created by the failing restore operation.
+# Remove it before reverting to the working backup image
+DROP DATABASE bup_db2;
+
+replace_column 1 #;
+RESTORE FROM 'bup_objectview.bak';
+
+#show data and create statements
+--echo showing objects and create statements
+--query_vertical SHOW CREATE DATABASE bup_db1;
+--query_vertical SHOW FULL TABLES FROM bup_db1;
+--query_vertical SHOW FULL TABLES FROM bup_db2;
+--query_vertical SHOW CREATE VIEW bup_db1.v1;
+--query_vertical SHOW CREATE VIEW bup_db1.vcomb;
+--query_vertical SHOW CREATE VIEW bup_db2.v3;
+
+--echo ****check for view contents after Restore*****
+
+#Excercise the objects of bup_db1
+
+SELECT * FROM bup_db1.t1 ORDER BY id;
+SELECT * FROM bup_db1.t3 ORDER BY scode;
+SELECT * FROM bup_db1.t5 ORDER BY Gender;
+SELECT * FROM bup_db1.v1;
+SELECT * FROM bup_db1.vcomb ORDER BY name;
+SELECT * FROM bup_db1.v5 ORDER BY age;
+SELECT * FROM bup_db1.v6 ORDER BY education, gender;
+
+--echo excercise objects of bup_db2
+
+SELECT * FROM bup_db2.t2 ORDER BY age;
+SELECT * FROM bup_db2.v2 ORDER BY age;
+SELECT * FROM bup_db2.v3 ORDER BY age;
+SELECT * FROM bup_db2.vv;
+SELECT * FROM bup_db2.student_details;
+
+#Alter table t1 and take BACKUP to see if view is not affected.
+
+ALTER TABLE bup_db1.t1 CHANGE name name VARCHAR(10);
+DESCRIBE bup_db1.t1;
+SELECT * FROM bup_db1.t1 ORDER BY id;
+SELECT * FROM bup_db1.v1;
+SELECT * FROM bup_db2.v3 ORDER BY age;
+
+replace_column 1 #;
+BACKUP DATABASE bup_db1, bup_db2 TO 'bup_objectview3.bak';
+
+DROP TABLE bup_db1.t3;
+DROP TABLE bup_db1.t5;
+DROP TABLE bup_db2.t2;
+DROP DATABASE bup_db1;
+DROP DATABASE bup_db2;
+
+replace_column 1 #;
+RESTORE FROM 'bup_objectview3.bak';
+
+SELECT * FROM bup_db2.v3 ORDER BY age;
+SELECT * FROM bup_db1.t1 ORDER BY id;
+
+--echo
+--echo *** ENTER Backup of database with missing view dependency
+--echo *** should fail but not crash server
+--echo *** Test for bug#34902 ***
+
+--echo initializing test
+
+# start with the backed up database
+DROP TABLE bup_db1.t3;
+DROP TABLE bup_db1.t5;
+DROP TABLE bup_db2.t2;
+DROP DATABASE bup_db1;
+DROP DATABASE bup_db2;
+
+replace_column 1 #;
+RESTORE FROM 'bup_objectview.bak';
+
+# check that table t1 and v1 are initially correct
+SELECT * FROM bup_db1.t1;
+SELECT * FROM bup_db1.v1;
+
+DROP TABLE bup_db1.t3;
+DROP TABLE bup_db1.t5;
+DROP TABLE bup_db2.t2;
+DROP TABLE bup_db1.t1;
+
+--echo
+--echo Testing backup with missing view dependency in same db
+--echo
+
+# v1 selects from t1, and select now reports error
+--error ER_VIEW_INVALID
+SELECT * FROM bup_db1.v1;
+
+# try to backup - v1 selects from t1 and backup should now fail
+--error ER_BACKUP_CATALOG_ADD_VIEW
+BACKUP DATABASE bup_db1 TO 'bup_shouldfail1.bak';
+
+--echo
+--echo Testing backup with missing view dependency in other db
+--echo
+
+USE bup_db2;
+--error ER_VIEW_INVALID
+SELECT * from bup_db2.v3;
+# try to backup - v3 selects from bup_db1.t1 and backup should now fail
+--error ER_BACKUP_CATALOG_ADD_VIEW
+BACKUP DATABASE bup_db2 TO 'bup_shouldfail2.bak';
+
+--echo
+--echo *** EXIT Backup of database with missing view dependency
+--echo
+
+--echo
+--echo *** ENTER Backup of database with altered view should report error, not crash server
+--echo Test for bug#34867
+
+--echo initializing test
+
+# start with the backed up database
+DROP DATABASE bup_db1;
+DROP DATABASE bup_db2;
+
+replace_column 1 #;
+RESTORE FROM 'bup_objectview.bak';
+
+USE bup_db1;
+CREATE VIEW alter1 AS SELECT 5;
+CREATE VIEW alter2 AS SELECT * FROM alter1;
+ALTER VIEW alter1 AS SELECT 6;
+
+--echo
+--echo Testing view selecting from altered view
+--echo
+
+--error ER_VIEW_INVALID
+SELECT * FROM alter2;
+
+#fails
+--error ER_VIEW_INVALID
+BACKUP DATABASE bup_db1 TO 'bup_alterview.bak';
+
+--echo
+--echo *** EXIT Backup of database with altered view
+--echo
+
+
+# Test cleanup section
+
+--echo
+--echo *** DROP bup_db1, bup_db2 DATABASE ****
+--echo
+
+
+DROP TABLE bup_db1.t3;
+DROP TABLE bup_db1.t5;
+DROP TABLE bup_db2.t2;
+DROP DATABASE bup_db1;
+DROP DATABASE bup_db2;
+
+--remove_file $MYSQLTEST_VARDIR/master-data/bup_objectview.bak
+--remove_file $MYSQLTEST_VARDIR/master-data/bup_objectview1.bak
+--remove_file $MYSQLTEST_VARDIR/master-data/bup_objectview2.bak
+--remove_file $MYSQLTEST_VARDIR/master-data/bup_objectview3.bak
+--error 0,1
+--remove_file $MYSQLTEST_VARDIR/master-data/bup_shouldfail1.bak
+--error 0,1
+--remove_file $MYSQLTEST_VARDIR/master-data/bup_shouldfail2.bak
+--error 0,1
+--remove_file $MYSQLTEST_VARDIR/master-data/bup_alterview.bak
+
=== added file 'mysql-test/suite/backup/t/disabled.def'
--- a/mysql-test/suite/backup/t/disabled.def 1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/backup/t/disabled.def 2008-09-26 22:16:02 +0000
@@ -0,0 +1,14 @@
+##############################################################################
+#
+# List the test cases that are to be disabled temporarily.
+#
+# Separate the test case name and the comment with ':'.
+#
+# <testcasename> : BUG#<xxxx> <date disabled> <disabler> <comment>
+#
+# Do not use any TAB characters for whitespace.
+#
+##############################################################################
+backup_no_engine : Bug#36021 2008-04-13 rsomla server crashes when openning table with unknown storage engine
+backup_triggers_and_events : Bug#37762 2008-07-01 rafal Test fails on remove_file for unknown reasons
+backup_no_be : Bug#38023 2008-07-16 rafal Test triggers valgrind warnings described in the bug
=== removed file 'mysql-test/t/backup_timeout.test'
--- a/mysql-test/t/backup_timeout.test 2008-08-19 15:35:29 +0000
+++ b/mysql-test/t/backup_timeout.test 1970-01-01 00:00:00 +0000
@@ -1,162 +0,0 @@
-#
-# This test is for the DDL blocker timeout feature.
-#
-
---source include/have_innodb.inc
---source include/have_debug.inc
---source include/not_embedded.inc
---source include/have_debug_sync.inc
-
-SET DEBUG_SYNC= 'reset';
-
-#
-# Remove backup files (if they exist)
-#
-
---error 0,1
---remove_file $MYSQLTEST_VARDIR/master-data/bup_ddl_blocker.bak;
-
-#
-# Connections used in this test
-#
-# con1 used to create data, load data, and run the backup
-# con2-con4 used for DDL statements: 2 before backup and 2 during backup
-# con5 used for setting and releasing breakpoints
-#
-
-connect (con1,localhost,root,,);
-connect (con2,localhost,root,,);
-connect (con3,localhost,root,,);
-connect (con4,localhost,root,,);
-connect (con5,localhost,root,,);
-
-connection con1;
-
-# Create data for this test and tailor it to the test.
---disable_warnings
-DROP DATABASE IF EXISTS bup_ddl_blocker;
---enable_warnings
-
-CREATE DATABASE bup_ddl_blocker;
-
-# Create a table and load it with data.
---echo con1: Creating tables
-CREATE TABLE bup_ddl_blocker.t1 (col_a CHAR(40)) ENGINE=INNODB;
-
---echo con1: Loading data
-INSERT INTO bup_ddl_blocker.t1 VALUES ("01 Some data to test");
-INSERT INTO bup_ddl_blocker.t1 VALUES ("02 Some data to test");
-INSERT INTO bup_ddl_blocker.t1 VALUES ("03 Some data to test");
-
-SHOW VARIABLES LIKE 'backup_wait%';
-
-#
-# Part A - test timeout for one session
-#
---echo Part A
-
---error 0,1
---remove_file $MYSQLTEST_VARDIR/master-data/bup_ddl_blocker.bak
-
-connection con1;
-
---echo con1: Activate synchronization points for backup.
-SET DEBUG_SYNC= 'after_block_ddl SIGNAL bup_blocked WAIT_FOR timeout_done';
-
---echo con1: Get a backup going and stop after the DDL blocker is fired.
-send BACKUP DATABASE bup_ddl_blocker TO "bup_ddl_blocker.bak";
-
-connection con2;
-
-SET DEBUG_SYNC= 'now WAIT_FOR bup_blocked';
-
---echo Set ddl timeout to 1 second
-SET backup_wait_timeout = 1;
-SHOW VARIABLES LIKE 'backup_wait%';
-
---echo con2: Try a ddl operation and watch it expire
---error ER_DDL_TIMEOUT
-CREATE TABLE bup_ddl_blocker.t2 (col_a CHAR(40)) ENGINE=MEMORY;
-
-connection con5;
---echo release the lock.
---echo con5: Resume all.
-SET DEBUG_SYNC= 'now SIGNAL timeout_done';
-
-# Reconnect to con1 and let backup finish.
-
-connection con1;
---replace_column 1 #
-reap;
-
-#
-# Part B - test timeout for a session with a timeout,
-# and a session with no timeout (backup_wait_timeout = 0)
-#
---echo Part B
-
---error 0,1
---remove_file $MYSQLTEST_VARDIR/master-data/bup_ddl_blocker.bak
-
-connection con1;
-
---echo con1: Activate synchronization points for backup.
-SET DEBUG_SYNC= 'after_block_ddl SIGNAL bup_blocked WAIT_FOR timeout_done';
-
---echo con1: Get a backup going and stop after the DDL blocker is fired.
-send BACKUP DATABASE bup_ddl_blocker TO "bup_ddl_blocker.bak";
-
-connection con2;
-
-SET DEBUG_SYNC= 'now WAIT_FOR bup_blocked';
-
---echo Set ddl timeout to 0 seconds
-SET backup_wait_timeout = 0;
-SHOW VARIABLES LIKE 'backup_wait%';
-
---echo con2: Try a ddl operation and it should expire
---error ER_DDL_TIMEOUT
-CREATE TABLE bup_ddl_blocker.t3 (col_a CHAR(40)) ENGINE=MEMORY;
-
-connection con3;
-
-SET backup_wait_timeout = 100;
-SHOW VARIABLES LIKE 'backup_wait%';
-
---echo con3: Try a ddl operation and it should not expire
-send CREATE TABLE bup_ddl_blocker.t3 (col_a CHAR(40)) ENGINE=MEMORY;
-
-connection con5;
---echo release the lock.
---echo con5: Resume all.
-SET DEBUG_SYNC= 'now SIGNAL timeout_done';
-
-# Reconnect to con1 and let backup finish.
-
-connection con1;
---replace_column 1 #
-reap;
-
-connection con3;
-reap;
-
-USE bup_ddl_blocker;
-SHOW FULL TABLES;
-
-#
-# Part C - test default behavior: set backup timeout = default
-#
---echo Part C
-
-connection con1;
-
---echo Show that the variable can be reset to its timeout value using
---echo SET backup_wait_timeout = DEFAULT;
-SET backup_wait_timeout = 1;
-SHOW VARIABLES LIKE 'backup_wait%';
-SET backup_wait_timeout = DEFAULT;
-SHOW VARIABLES LIKE 'backup_wait%';
-
-DROP DATABASE bup_ddl_blocker;
-
---remove_file $MYSQLTEST_VARDIR/master-data/bup_ddl_blocker.bak
=== removed file 'mysql-test/t/backup_triggers_and_events.test'
--- a/mysql-test/t/backup_triggers_and_events.test 2008-07-05 08:51:51 +0000
+++ b/mysql-test/t/backup_triggers_and_events.test 1970-01-01 00:00:00 +0000
@@ -1,214 +0,0 @@
---source include/have_debug_sync.inc
---source include/not_embedded.inc
-
-# This test checks that re-created events or triggers are not fired during
-# RESTORE operation.
-#
-# Author: Rafal Somla
-
---disable_warnings
---error 0,1
-remove_file $MYSQL_TEST_DIR/var/master-data/db.bak;
---enable_warnings
-
-SET GLOBAL event_scheduler=off;
-SET DEBUG_SYNC = 'RESET';
-
-# We need a separate connection to measure timing for RESTORE command. This is
-# because of BUG#35806: time stops in a thread executing RESTORE command.
-
-connect(con1, localhost, root,,);
-connect(con2, localhost, root,,);
-
---connection con1
-
-# Events and triggers will insert entries into a log table so that we can see
-# if they have fired.
-
---echo Creating log table.
-
---disable_warnings
-DROP TABLE IF EXISTS test.logt;
---enable_warnings
-
-CREATE TABLE test.logt(ts timestamp, db char(8), msg text);
-
---echo Creating database db and its objects.
-
---disable_warnings
-DROP DATABASE IF EXISTS db;
---enable_warnings
-
-CREATE DATABASE db;
-USE db;
-
-CREATE TABLE t1 (a int);
-INSERT INTO t1 VALUES (0),(1),(2),(3),(4),(5),(6);
-
-delimiter ||;
-
-CREATE EVENT ev ON SCHEDULE EVERY 1 second DO
-BEGIN
- INSERT INTO test.logt(db, msg) VALUES ('db','Db event fired!');
-END;
-||
-
-CREATE PROCEDURE trg_msg(a int)
-BEGIN
- INSERT INTO test.logt(db, msg) VALUES ('db','Db trigger fired!');
-END;
-||
-
-CREATE TRIGGER after_ins AFTER INSERT ON t1 FOR EACH ROW
-CALL trg_msg(NEW.a);
-||
-
-CREATE TRIGGER after_upd AFTER UPDATE ON t1 FOR EACH ROW
-CALL trg_msg(NEW.a);
-||
-
-CREATE TRIGGER after_del AFTER DELETE ON t1 FOR EACH ROW
-CALL trg_msg(OLD.a);
-||
-
-CREATE TRIGGER before_ins BEFORE INSERT ON t1 FOR EACH ROW
-CALL trg_msg(NEW.a);
-||
-
-CREATE TRIGGER before_upd BEFORE UPDATE ON t1 FOR EACH ROW
-CALL trg_msg(NEW.a);
-||
-
-CREATE TRIGGER before_del BEFORE DELETE ON t1 FOR EACH ROW
-CALL trg_msg(OLD.a);
-||
-
-# Create an event and trigger in test database to see that they are not
-# affected by RESTORE of another database.
-
-USE test||
-
---disable_warnings
-DROP EVENT IF EXISTS ev||
-DROP TABLE IF EXISTS t1||
-DROP TRIGGER IF EXISTS trg||
---enable_warnings
-
-CREATE EVENT ev ON SCHEDULE EVERY 1 second DO
-BEGIN
- INSERT INTO test.logt(db, msg) VALUES ('test','Test event fired!');
-END;
-||
-
-CREATE TABLE t1 (a int)||
-
-CREATE TRIGGER trg AFTER INSERT ON t1 FOR EACH ROW
-BEGIN
- INSERT INTO test.logt(db, msg) VALUES ('test','Test trigger fired');
-END;
-||
-
-delimiter ;||
-
---echo Backing-up database db and dropping it.
-
---replace_column 1 #
-BACKUP DATABASE db TO 'db.bak';
-DROP DATABASE db;
-
---echo Enabling event scheduler.
-SET GLOBAL event_scheduler=on;
-
---connection con1
-
---echo con1: clearing log table and starting RESTORE operation.
---echo con1: RESTORE will pause after restoring table data.
-
-# Synchronization point 'restore_table_data_before_end' is inside RESTORE code,
-# after restore drivers have finished their job but before they have been shoot
-# down.
-
-SET DEBUG_SYNC = 'restore_table_data_before_end SIGNAL waiting WAIT_FOR continue';
-DELETE FROM test.logt;
---send RESTORE FROM 'db.bak'
-
---connection con2
-
-# Record the time when RESTORE has started.
-SELECT now() INTO @start;
-
---echo con2: checking that there are no triggers and events at the end of RESTORE execution.
-
-# Wait until RESTORE reaches the moment when all table data is restored.
-SET DEBUG_SYNC = 'now WAIT_FOR waiting';
-# There should be no triggers and no events at this moment (they are created
-# after table data is restored)
---query_vertical SHOW TRIGGERS FROM db
---query_vertical SHOW EVENTS IN db
-
---echo con2: activating trigger in test database.
-INSERT INTO test.t1 VALUES (1);
-
---echo con2: ensuring that RESTORE takes at least 3 secs.
-
-# This is so that db.ev event has chance to fire if it is not correctly handled
-# (e.g. enabled during table data restore).
---sleep 3
-SET DEBUG_SYNC = 'now SIGNAL continue';
-
---connection con1
-
---echo con1: finishing RESTORE operation.
---replace_column 1 #
---reap
-SET GLOBAL event_scheduler=off;
-
---connection con2
-
--- echo con2: checking that RESTORE took more than 2 secs.
-
-SELECT timediff(now(),@start) > 2;
-
---echo Checking that objects have been restored.
-
-USE db;
-
-SHOW TABLES IN db;
-SELECT count(*) FROM db.t1;
---replace_column 9 #
---query_vertical SHOW TRIGGERS FROM db
---replace_column 9 #
---query_vertical SHOW EVENTS IN db
-
---echo Checking that no db event or trigger fired during RESTORE.
-
-# There should be no entries in the log table from the time when RESTORE
-# was running (but there could be entries inserted by event firing *after*
-# RESTORE has completed). We know that RESTORE took at least 3 sec and we
-# take 2 sec window form the beginning of the operation. This is enough
-# to see db.ev in case it fired during RESTORE operation (this event is sheduled
-# to fire every second).
-
-SELECT * FROM test.logt WHERE db = 'db' AND timediff(ts,@start) < 2;
-
---echo Checking that test event and trigger could fire.
-
-# Checking that the trigger has fired.
-SELECT count(*) > 0 FROM test.logt
-WHERE db = 'test'
-AND msg LIKE '%trigger fired%'
-AND timediff(ts,@start) < 2;
-
-# Checking that the event has fired.
-SELECT count(*) > 0 FROM test.logt
-WHERE db = 'test'
-AND msg LIKE '%event fired%'
-AND timediff(ts,@start) < 2;
-
---echo Cleaning up.
-DROP EVENT test.ev;
-DROP TRIGGER test.trg;
-DROP TABLE test.logt;
-DROP TABLE test.t1;
-DROP DATABASE db;
-remove_file $MYSQL_TEST_DIR/var/master-data/db.bak;
=== removed file 'mysql-test/t/backup_view_on_view.test'
--- a/mysql-test/t/backup_view_on_view.test 2008-06-25 13:39:04 +0000
+++ b/mysql-test/t/backup_view_on_view.test 1970-01-01 00:00:00 +0000
@@ -1,32 +0,0 @@
-# Test case for bug#34758
-
---source include/not_embedded.inc
---source include/have_debug.inc
---source include/have_innodb.inc
-
-# Setup the server to use the backup breakpoints
-SET GLOBAL debug="d,backup:d,backup_data";
-
---disable_warnings
-DROP DATABASE IF EXISTS db1;
---enable_warnings
-
-CREATE DATABASE db1;
-
-CREATE TABLE db1.t1(a int) ENGINE=INNODB;
-CREATE VIEW db1.v1 AS SELECT * FROM db1.t1;
-CREATE VIEW db1.v2 AS SELECT * FROM db1.v1;
-
-INSERT INTO db1.t1 VALUES (1),(2),(3),(5),(7),(11);
-
-replace_column 1 #;
-BACKUP DATABASE db1 TO 'test.bak';
-replace_column 1 #;
-RESTORE FROM 'test.bak';
-
-SELECT * FROM db1.v2;
-SELECT * FROM db1.v1;
-SELECT * FROM db1.t1;
-
-DROP DATABASE db1;
-
=== removed file 'mysql-test/t/backup_views.test'
--- a/mysql-test/t/backup_views.test 2008-08-20 13:23:10 +0000
+++ b/mysql-test/t/backup_views.test 1970-01-01 00:00:00 +0000
@@ -1,387 +0,0 @@
-###########################################################################
-# Author: Hema
-# Date: 2008-04-11
-# Purpose: To test the metadata consistency of views.
-###############################################################################
---source include/have_innodb.inc
---source include/not_embedded.inc
---source include/have_debug.inc
-
-connect (backup,localhost,root,,);
-connect (breakpoints,localhost,root,,);
-
-##############################################################
---echo
---echo starting the test for backup
---echo
-##############################################################
-
---error 0,1
---remove_file $MYSQLTEST_VARDIR/master-data/bup_objectview.bak
-
-#Create Database and object view for this test.
-
---disable_warnings
-DROP DATABASE IF EXISTS bup_db1;
-DROP DATABASE IF EXISTS bup_db2;
-
-#
-# We are creating 2 databases bup_db1 and bup_db2 to accomplish wide testing
-# of views in order to check their consistency after BACKUP AND RESTORE.
-# In bup_db1 DATABASE consists of tables :t1 t3 t5
-# and views v1(based on t1 alone), vcomb(based on t1 and t3),
-# v5( based on bup_db2.t2), v6(based on bup_db2.v2,bup_db1.t5)
-#
-# In bup_db2,it consists table t2
-# views v2(based on t2), v3( based on combination of bup_db1 and bup_db2),
-# v4( based on bup_db1.t3), vv( based on v3)
-#
-
---enable_warnings
-CREATE DATABASE bup_db1;
-USE bup_db1;
-
-#Create table and load with data.
-
---echo Creating Table t1
-CREATE TABLE bup_db1.t1(
-id INT NOT NULL PRIMARY KEY,
-name CHAR(10),
-city VARCHAR(10)
-)ENGINE=INNODB;
-
---echo loading data
-INSERT INTO bup_db1.t1 VALUES
-(1,'aa1','RR1'),(2,'aa2','RR2'),(3,'aa3','RR3'),(4,'aa4','RR4'),
-(5,'aa5','RR5'),(6,'aa6','RR6'),(7,'aa7','RR7'),(8,'aa8','RR8');
-
-SELECT * FROM bup_db1.t1 ORDER BY id;
-
---echo Creating Table t3
-
-CREATE TABLE bup_db1.t3(
-ccode INT,
-District CHAR(20) NOT NULL PRIMARY KEY,
-scode INT,
-FOREIGN KEY (scode) REFERENCES bup_db1.t1(id)
-)ENGINE=INNODB;
-
---echo Loading Data
-
-INSERT INTO t3 VALUES
-(234, 'zuloa',1),(321,'yyy',2),(765,'iug',3),
-(124,'LKJ',4),(235,'uth',6);
-
-SELECT * FROM bup_db1.t3 ORDER BY scode;
-
---echo *****Create view from the table bup_db1.t1*******
-
-CREATE VIEW bup_db1.v1 AS SELECT * FROM bup_db1.t1;
-
---echo ***Create views from 2 tables(t1 and t3) within same DB bup_db1****
-
-CREATE VIEW bup_db1.vcomb AS
-SELECT name, city, ccode FROM bup_db1.t1, bup_db1.t3 WHERE id=scode;
-
-CREATE DATABASE bup_db2;
-
-CREATE TABLE bup_db2.t2(
-idno INT,
-age INT PRIMARY KEY,
-education CHAR(20) ,
-FOREIGN KEY (idno) REFERENCES bup_db1.t1(id)
-)ENGINE=INNODB;
-
-INSERT INTO bup_db2.t2 VALUES
-(1,23,'BS'),(2,24,'BE'),(3,19,'School'),(4,28,'MS'),
-(5,43,'PHD'),(6,30,'Doctor'),(7,31,'Lawyer'),(8,27,'Undergrad');
-
-SELECT * FROM bup_db2.t2 ORDER BY age;
-
---echo ****Create view in bup_db2****
-
-CREATE VIEW bup_db2.v2 AS SELECT age, education FROM bup_db2.t2;
-
---echo ******Create views from combination of 2 databases*******
-
-CREATE VIEW bup_db2.v3 AS SELECT name, age, education
-FROM bup_db1.t1 , bup_db2.t2 WHERE id=idno;
-
---echo *********Create view from another view in bup_db2***********.
-
-# Bug#35347 Mysql Server crash while doing restore with views for default driver
-# BUG#34758 Server crashes if database with views backed up using CS driver
-#Creating view from another view is possible if bug#35347 and bug#34758is fixed.
-
-CREATE VIEW bup_db2.vv (N, A, E) AS SELECT * FROM bup_db2.v3;
-
---echo *****Create view from other Database********
-
-CREATE VIEW bup_db2.v4 AS SELECT * FROM bup_db1.t3;
-
---echo Rename the view name
-
-RENAME TABLE bup_db2.v4 to bup_db2.student_details;
-
---echo *******Create view from database bup_db2**********
-
-CREATE VIEW bup_db1.v5 AS SELECT * FROM bup_db2.t2;
-
---echo Creating Table t5
-
-CREATE TABLE bup_db1.t5(
-Gender CHAR(5),
-cand_age INT,
-FOREIGN KEY(cand_age) REFERENCES bup_db2.t2(age)
-)ENGINE=INNODB;
-
---echo Loading data into table t5
-
-INSERT INTO bup_db1.t5 VALUES
-('F',23),('F',24),('M',19),('F',28),
-('M',43),('F',30),('M',31),('M',27);
-
-SELECT * FROM bup_db1.t5 ORDER BY Gender;
-
-#Bug#36213 Restore fails for a database that has views created using
-#another database .
-
---echo ******Create view v6********
-CREATE VIEW bup_db1.v6 AS SELECT education,gender
-FROM bup_db2.v2, bup_db1.t5 WHERE cand_age=age;
-
-#Excercise the objects of bup_db1
-
-SELECT * FROM bup_db1.t1 ORDER BY id;
-SELECT * FROM bup_db1.t3 ORDER BY scode;
-SELECT * FROM bup_db1.t5 ORDER BY Gender;
-SELECT * FROM bup_db1.v1;
-SELECT * FROM bup_db1.vcomb ORDER BY name;
-SELECT * FROM bup_db1.v5 ORDER BY age;
-SELECT * FROM bup_db1.v6 ORDER BY education, gender;
-
---echo excercise objects of bup_db2
-
-SELECT * FROM bup_db2.t2 ORDER BY age;
-SELECT * FROM bup_db2.v2 ORDER BY age;
-SELECT * FROM bup_db2.v3 ORDER BY age;
-SELECT * FROM bup_db2.vv;
-SELECT * FROM bup_db2.student_details; #view v4 is renamed as student_details
-
-#Show the data and Create statements
-
---echo showing objects and create statements.
---query_vertical SHOW FULL TABLES FROM bup_db1;
---query_vertical SHOW FULL TABLES FROM bup_db2;
---query_vertical SHOW CREATE VIEW bup_db1.v1;
---query_vertical SHOW CREATE VIEW bup_db1.vcomb;
---query_vertical SHOW CREATE VIEW bup_db2.v3;
-
-#Backup and restore data.
---echo backup database
-
-replace_column 1 #;
-BACKUP DATABASE bup_db1, bup_db2 TO 'bup_objectview.bak';
-
-replace_column 1 #;
-BACKUP DATABASE bup_db1 TO 'bup_objectview1.bak';
-
-replace_column 1 #;
-BACKUP DATABASE bup_db2 TO 'bup_objectview2.bak';
-
---echo dropping database.
-DROP TABLE bup_db1.t3;
-DROP TABLE bup_db1.t5;
-DROP TABLE bup_db2.t2;
-DROP DATABASE bup_db1;
-DROP DATABASE bup_db2;
-
---echo Restore database.
-
-# Individual databases cannot be restored because of VIEW DEPENDENCY
-# For restoring we need base tables in the database, otherwise the
-# Restore will fail. Once this bug is fixed, we can remove the '#'
-# for the restore below.
-
---echo restore database with view dependency to other, non-existing db
-
---error ER_BACKUP_CANT_RESTORE_VIEW
-RESTORE FROM 'bup_objectview1.bak';
-
-# An incomplete bup_db1 was created by the failing restore operation.
-# Remove it before trying restore of bup_db2.
-DROP DATABASE bup_db1;
-
---error ER_BACKUP_CANT_RESTORE_VIEW
-RESTORE FROM 'bup_objectview2.bak';
-
-# An incomplete bup_db2 was created by the failing restore operation.
-# Remove it before reverting to the working backup image
-DROP DATABASE bup_db2;
-
-replace_column 1 #;
-RESTORE FROM 'bup_objectview.bak';
-
-#show data and create statements
---echo showing objects and create statements
---query_vertical SHOW CREATE DATABASE bup_db1;
---query_vertical SHOW FULL TABLES FROM bup_db1;
---query_vertical SHOW FULL TABLES FROM bup_db2;
---query_vertical SHOW CREATE VIEW bup_db1.v1;
---query_vertical SHOW CREATE VIEW bup_db1.vcomb;
---query_vertical SHOW CREATE VIEW bup_db2.v3;
-
---echo ****check for view contents after Restore*****
-
-#Excercise the objects of bup_db1
-
-SELECT * FROM bup_db1.t1 ORDER BY id;
-SELECT * FROM bup_db1.t3 ORDER BY scode;
-SELECT * FROM bup_db1.t5 ORDER BY Gender;
-SELECT * FROM bup_db1.v1;
-SELECT * FROM bup_db1.vcomb ORDER BY name;
-SELECT * FROM bup_db1.v5 ORDER BY age;
-SELECT * FROM bup_db1.v6 ORDER BY education, gender;
-
---echo excercise objects of bup_db2
-
-SELECT * FROM bup_db2.t2 ORDER BY age;
-SELECT * FROM bup_db2.v2 ORDER BY age;
-SELECT * FROM bup_db2.v3 ORDER BY age;
-SELECT * FROM bup_db2.vv;
-SELECT * FROM bup_db2.student_details;
-
-#Alter table t1 and take BACKUP to see if view is not affected.
-
-ALTER TABLE bup_db1.t1 CHANGE name name VARCHAR(10);
-DESCRIBE bup_db1.t1;
-SELECT * FROM bup_db1.t1 ORDER BY id;
-SELECT * FROM bup_db1.v1;
-SELECT * FROM bup_db2.v3 ORDER BY age;
-
-replace_column 1 #;
-BACKUP DATABASE bup_db1, bup_db2 TO 'bup_objectview3.bak';
-
-DROP TABLE bup_db1.t3;
-DROP TABLE bup_db1.t5;
-DROP TABLE bup_db2.t2;
-DROP DATABASE bup_db1;
-DROP DATABASE bup_db2;
-
-replace_column 1 #;
-RESTORE FROM 'bup_objectview3.bak';
-
-SELECT * FROM bup_db2.v3 ORDER BY age;
-SELECT * FROM bup_db1.t1 ORDER BY id;
-
---echo
---echo *** ENTER Backup of database with missing view dependency
---echo *** should fail but not crash server
---echo *** Test for bug#34902 ***
-
---echo initializing test
-
-# start with the backed up database
-DROP TABLE bup_db1.t3;
-DROP TABLE bup_db1.t5;
-DROP TABLE bup_db2.t2;
-DROP DATABASE bup_db1;
-DROP DATABASE bup_db2;
-
-replace_column 1 #;
-RESTORE FROM 'bup_objectview.bak';
-
-# check that table t1 and v1 are initially correct
-SELECT * FROM bup_db1.t1;
-SELECT * FROM bup_db1.v1;
-
-DROP TABLE bup_db1.t3;
-DROP TABLE bup_db1.t5;
-DROP TABLE bup_db2.t2;
-DROP TABLE bup_db1.t1;
-
---echo
---echo Testing backup with missing view dependency in same db
---echo
-
-# v1 selects from t1, and select now reports error
---error ER_VIEW_INVALID
-SELECT * FROM bup_db1.v1;
-
-# try to backup - v1 selects from t1 and backup should now fail
---error ER_BACKUP_CATALOG_ADD_VIEW
-BACKUP DATABASE bup_db1 TO 'bup_shouldfail1.bak';
-
---echo
---echo Testing backup with missing view dependency in other db
---echo
-
-USE bup_db2;
---error ER_VIEW_INVALID
-SELECT * from bup_db2.v3;
-# try to backup - v3 selects from bup_db1.t1 and backup should now fail
---error ER_BACKUP_CATALOG_ADD_VIEW
-BACKUP DATABASE bup_db2 TO 'bup_shouldfail2.bak';
-
---echo
---echo *** EXIT Backup of database with missing view dependency
---echo
-
---echo
---echo *** ENTER Backup of database with altered view should report error, not crash server
---echo Test for bug#34867
-
---echo initializing test
-
-# start with the backed up database
-DROP DATABASE bup_db1;
-DROP DATABASE bup_db2;
-
-replace_column 1 #;
-RESTORE FROM 'bup_objectview.bak';
-
-USE bup_db1;
-CREATE VIEW alter1 AS SELECT 5;
-CREATE VIEW alter2 AS SELECT * FROM alter1;
-ALTER VIEW alter1 AS SELECT 6;
-
---echo
---echo Testing view selecting from altered view
---echo
-
---error ER_VIEW_INVALID
-SELECT * FROM alter2;
-
-#fails
---error ER_VIEW_INVALID
-BACKUP DATABASE bup_db1 TO 'bup_alterview.bak';
-
---echo
---echo *** EXIT Backup of database with altered view
---echo
-
-
-# Test cleanup section
-
---echo
---echo *** DROP bup_db1, bup_db2 DATABASE ****
---echo
-
-
-DROP TABLE bup_db1.t3;
-DROP TABLE bup_db1.t5;
-DROP TABLE bup_db2.t2;
-DROP DATABASE bup_db1;
-DROP DATABASE bup_db2;
-
---remove_file $MYSQLTEST_VARDIR/master-data/bup_objectview.bak
---remove_file $MYSQLTEST_VARDIR/master-data/bup_objectview1.bak
---remove_file $MYSQLTEST_VARDIR/master-data/bup_objectview2.bak
---remove_file $MYSQLTEST_VARDIR/master-data/bup_objectview3.bak
---error 0,1
---remove_file $MYSQLTEST_VARDIR/master-data/bup_shouldfail1.bak
---error 0,1
---remove_file $MYSQLTEST_VARDIR/master-data/bup_shouldfail2.bak
---error 0,1
---remove_file $MYSQLTEST_VARDIR/master-data/bup_alterview.bak
-
| Thread |
|---|
| • bzr commit into mysql-6.0-backup branch (hema:2700) WL#4568 | Hema Sridharan | 27 Sep |