List:Commits« Previous MessageNext Message »
From:Jorgen Loland Date:June 9 2008 3:54pm
Subject:bzr commit into mysql-6.0 branch (jorgen.loland:2632) Bug#36265
View as plain text  
#At file:///localhome/jl208045/mysql/bzrroot/mysql-6.0-backup/

 2632 Jorgen Loland	2008-06-09
      bug#36265 - "Views not backed up if they are dependent on tables from different Database"
      
      Test case for backup of two databases with a view selecting from other db. 
      Test author: Hema Sridharan
added:
  mysql-test/r/backup_views.result
  mysql-test/t/backup_views.test

per-file comments:
  mysql-test/r/backup_views.result
    Expected result for backup test case with view selecting from other db
  mysql-test/t/backup_views.test
    Test case for backup of view selecting from other db
=== added file 'mysql-test/r/backup_views.result'
--- a/mysql-test/r/backup_views.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/r/backup_views.result	2008-06-09 13:54:06 +0000
@@ -0,0 +1,453 @@
+
+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 t1(id int not null primary key, name char(10),city varchar(10));
+loading data
+INSERT INTO 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 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
+Creating Table t3
+CREATE TABLE t3(ccode int, District char(20) not null primary key, scode int, foreign key (scode) references t1(id));
+Loading Data
+INSERT INTO t3 VALUES
+(234, 'zuloa',1),(321,'yyy',2),(765,'iug',3),(124,'LKJ',4),(235,'uth',6);
+SELECT * FROM t3;
+ccode	District	scode
+234	zuloa	1
+321	yyy	2
+765	iug	3
+124	LKJ	4
+235	uth	6
+Creating Table t5
+CREATE TABLE t5(Gender char(5), cand_age int,foreign key(cand_age) references 
+bup_db2.t2(age));
+Loading data into table t5
+INSERT INTO t5 VALUES
+('F',23),('F',24),('M',19),('F',28),('M',43),('F',30),('M',31),('M',27);
+SELECT * FROM t5;
+Gender	cand_age
+F	23
+F	24
+M	19
+F	28
+M	43
+F	30
+M	31
+M	27
+*****Create views from the table t1 of bup_db1*******
+CREATE VIEW v1  AS SELECT * FROM t1;
+*****Creating views from 2 tables(t1 and t3) within same database******
+CREATE VIEW vcomb AS SELECT name, city, ccode FROM t1, t3 WHERE id=scode;
+CREATE DATABASE bup_db2;
+USE bup_db2;
+CREATE TABLE t2(idno int, age int primary key, education char(20) ,foreign key (idno) references bup_db1.t1(id));
+INSERT INTO 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 t2;
+idno	age	education
+1	23	BS
+2	24	BE
+3	19	school
+4	28	MS
+5	43	PHD
+6	30	Doctor
+7	31	Lawyer
+8	27	undergrad
+****Creating View****
+CREATE VIEW v2 AS SELECT age, education FROM t2;
+******Creating Views from combination of 2 databases*******
+CREATE VIEW v3 AS SELECT name, age, education FROM bup_db1.t1 , bup_db2.t2 WHERE id=idno;
+*********Creating View from another view ***********.
+*****Creating View from other Database********
+CREATE VIEW v4 AS SELECT * FROM bup_db1.t3;
+Rename the view name
+RENAME TABLE v4 to student_details;
+USE bup_db1;
+*******Creating View from database bup_db2**********
+CREATE VIEW v5 AS SELECT * FROM bup_db2.t2;
+******Creating View v6********
+USE bup_db1;
+SELECT * FROM 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 t3;
+ccode	District	scode
+234	zuloa	1
+321	yyy	2
+765	iug	3
+124	LKJ	4
+235	uth	6
+SELECT * FROM t5;
+Gender	cand_age
+F	23
+F	24
+M	19
+F	28
+M	43
+F	30
+M	31
+M	27
+SELECT * FROM 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 vcomb;
+name	city	ccode
+aa1	RR1	234
+aa2	RR2	321
+aa3	RR3	765
+aa4	RR4	124
+aa6	RR6	235
+SELECT * FROM v5;
+idno	age	education
+1	23	BS
+2	24	BE
+3	19	school
+4	28	MS
+5	43	PHD
+6	30	Doctor
+7	31	Lawyer
+8	27	undergrad
+excercise objects of bup_db2
+USE bup_db2;
+SELECT * FROM t2;
+idno	age	education
+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 v2;
+age	education
+23	BS
+24	BE
+19	school
+28	MS
+43	PHD
+30	Doctor
+31	Lawyer
+27	undergrad
+SELECT * FROM v3;
+name	age	education
+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 student_details;
+ccode	District	scode
+234	zuloa	1
+321	yyy	2
+765	iug	3
+124	LKJ	4
+235	uth	6
+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	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
+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
+backup data
+BACKUP DATABASE bup_db1, bup_db2 TO 'bup_objectview.bak';
+backup_id
+1
+BACKUP DATABASE bup_db1 TO 'bup_objectview1.bak';
+backup_id
+2
+BACKUP DATABASE bup_db2 TO 'bup_objectview2.bak';
+backup_id
+3
+dropping  database.
+DROP DATABASE bup_db1;
+DROP DATABASE bup_db2;
+RESTORE FROM 'bup_objectview.bak';
+backup_id
+4
+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	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
+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*****
+USE bup_db1;
+SELECT * FROM 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 t3;
+ccode	District	scode
+234	zuloa	1
+321	yyy	2
+765	iug	3
+124	LKJ	4
+235	uth	6
+SELECT * FROM t5;
+Gender	cand_age
+F	23
+F	24
+M	19
+F	28
+M	43
+F	30
+M	31
+M	27
+SELECT * FROM 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 vcomb;
+name	city	ccode
+aa1	RR1	234
+aa2	RR2	321
+aa3	RR3	765
+aa4	RR4	124
+aa6	RR6	235
+SELECT * FROM v5;
+idno	age	education
+1	23	BS
+2	24	BE
+3	19	school
+4	28	MS
+5	43	PHD
+6	30	Doctor
+7	31	Lawyer
+8	27	undergrad
+excercise objects of bup_db2
+use bup_db2;
+SELECT * FROM t2;
+idno	age	education
+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 v2;
+age	education
+23	BS
+24	BE
+19	school
+28	MS
+43	PHD
+30	Doctor
+31	Lawyer
+27	undergrad
+SELECT * FROM v3;
+name	age	education
+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 student_details;
+ccode	District	scode
+234	zuloa	1
+321	yyy	2
+765	iug	3
+124	LKJ	4
+235	uth	6
+DROP DATABASE bup_db1;
+DROP DATABASE bup_db2;
+Restoring Database
+RESTORE FROM 'bup_objectview.bak';
+backup_id
+5
+USE bup_db1;
+ALTER TABLE t1 CHANGE id id tinyint not null;
+SHOW CREATE TABLE t1;;
+Table	t1
+Create Table	CREATE TABLE `t1` (
+  `id` tinyint(4) NOT NULL,
+  `name` char(10) DEFAULT NULL,
+  `city` varchar(10) DEFAULT NULL,
+  PRIMARY KEY (`id`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+SELECT * FROM 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
+DELETE FROM t1 WHERE id=7;
+SELECT * FROM t1;
+id	name	city
+1	aa1	RR1
+2	aa2	RR2
+3	aa3	RR3
+4	aa4	RR4
+5	aa5	RR5
+6	aa6	RR6
+8	aa8	RR8
+SELECT * FROM v1;
+id	name	city
+1	aa1	RR1
+2	aa2	RR2
+3	aa3	RR3
+4	aa4	RR4
+5	aa5	RR5
+6	aa6	RR6
+8	aa8	RR8
+USE bup_db2;
+SELECT * FROM v3;
+name	age	education
+aa1	23	BS
+aa2	24	BE
+aa3	19	school
+aa4	28	MS
+aa5	43	PHD
+aa6	30	Doctor
+aa8	27	undergrad
+BACKUP DATABASE bup_db1, bup_db2 TO 'bup_objectview3.bak';
+backup_id
+6
+DROP DATABASE bup_db1;
+DROP DATABASE bup_db2;
+RESTORE FROM 'bup_objectview3.bak';
+backup_id
+7
+USE bup_db2;
+SELECT * FROM v3;
+name	age	education
+aa1	23	BS
+aa2	24	BE
+aa3	19	school
+aa4	28	MS
+aa5	43	PHD
+aa6	30	Doctor
+aa8	27	undergrad
+USE bup_db1;
+SELECT * FROM t1;
+id	name	city
+1	aa1	RR1
+2	aa2	RR2
+3	aa3	RR3
+4	aa4	RR4
+5	aa5	RR5
+6	aa6	RR6
+8	aa8	RR8
+
+***  DROP bup_db1, bup_db2 DATABASE ****
+
+DROP DATABASE bup_db1;
+DROP DATABASE bup_db2;

=== added file 'mysql-test/t/backup_views.test'
--- a/mysql-test/t/backup_views.test	1970-01-01 00:00:00 +0000
+++ b/mysql-test/t/backup_views.test	2008-06-09 13:54:06 +0000
@@ -0,0 +1,295 @@
+###########################################################################
+# 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 t1(id int not null primary key, name char(10),city varchar(10));
+
+--echo loading data
+INSERT INTO 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 t1;
+
+--echo Creating Table t3
+
+CREATE TABLE t3(ccode int, District char(20) not null primary key, scode int, foreign key (scode) references t1(id));
+
+--echo Loading Data
+
+INSERT INTO t3 VALUES
+(234, 'zuloa',1),(321,'yyy',2),(765,'iug',3),(124,'LKJ',4),(235,'uth',6);
+
+SELECT * FROM t3;
+
+--echo Creating Table t5
+
+CREATE TABLE t5(Gender char(5), cand_age int,foreign key(cand_age) references 
+bup_db2.t2(age));
+
+--echo Loading data into table t5
+
+INSERT INTO t5 VALUES
+('F',23),('F',24),('M',19),('F',28),('M',43),('F',30),('M',31),('M',27);
+
+SELECT * FROM t5;
+
+--echo *****Create views from the table t1 of bup_db1*******
+
+CREATE VIEW v1  AS SELECT * FROM t1;
+
+--echo *****Creating views from 2 tables(t1 and t3) within same database******
+
+CREATE VIEW vcomb AS SELECT name, city, ccode FROM t1, t3 WHERE id=scode;
+
+
+CREATE DATABASE bup_db2;
+USE bup_db2;
+
+CREATE TABLE t2(idno int, age int primary key, education char(20) ,foreign key (idno) references bup_db1.t1(id));
+
+INSERT INTO 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 t2;
+
+--echo ****Creating View****
+
+CREATE VIEW v2 AS SELECT age, education FROM t2;
+
+--echo ******Creating Views from combination of 2 databases*******
+
+CREATE VIEW v3 AS SELECT name, age, education FROM bup_db1.t1 , bup_db2.t2 WHERE id=idno;
+
+--echo *********Creating View from another view ***********.
+
+#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
+#Creatig view from another view is possible if bug#35347 and bug#34758 is fixed.
+
+#CREATE VIEW vv (N, A, E) AS SELECT * FROM v3;
+
+--echo *****Creating View from other Database********
+
+CREATE VIEW v4 AS SELECT * FROM bup_db1.t3;
+
+--echo Rename the view name
+
+RENAME TABLE v4 to student_details;
+
+USE bup_db1;
+
+--echo *******Creating View from database bup_db2**********
+
+CREATE VIEW v5 AS SELECT * FROM bup_db2.t2;
+
+--echo ******Creating View v6********
+
+#Bug#36213 Restore fails for a database that has views created using another database .
+
+#CREATE VIEW v6 AS SELECT education,gender FROM bup_db2.v2, t5  WHERE cand_age=age;
+
+#Excercise the objects of bup_db1
+
+USE bup_db1;
+
+SELECT * FROM t1;
+
+SELECT * FROM t3;
+
+SELECT * FROM t5;
+
+SELECT * FROM v1;
+
+SELECT * FROM vcomb;
+
+SELECT * FROM v5;
+
+#SELECT * FROM v6;
+
+--echo excercise objects of bup_db2
+
+USE bup_db2;
+
+SELECT * FROM t2;
+
+SELECT * FROM v2;
+
+SELECT * FROM v3;
+
+#SELECT * FROM vv;
+
+SELECT * FROM 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 data
+
+BACKUP DATABASE bup_db1, bup_db2 TO 'bup_objectview.bak';
+
+BACKUP DATABASE bup_db1 TO 'bup_objectview1.bak';
+
+BACKUP DATABASE bup_db2 TO 'bup_objectview2.bak';
+
+--echo dropping  database.
+DROP DATABASE bup_db1;
+
+DROP DATABASE bup_db2;
+
+#RESTORE FROM bup_objectview.bak;
+
+#Individual databases cannot be restored because of VIEW DEPENDENCY
+
+#--error 1146
+#RESTORE FROM 'bup_objectview1.bak';
+#--error 1146
+#RESTORE FROM 'bup_objectview2.bak';
+
+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
+USE bup_db1;
+SELECT * FROM t1;
+
+SELECT * FROM t3;
+
+SELECT * FROM t5;
+
+SELECT * FROM v1;
+
+SELECT * FROM vcomb;
+
+SELECT * FROM v5;
+
+#SELECT * FROM v6;
+--echo excercise objects of bup_db2
+use bup_db2;
+SELECT * FROM t2;
+
+SELECT * FROM v2;
+
+SELECT * FROM v3;
+
+#SELECT * FROM vv;
+
+SELECT * FROM student_details;
+
+DROP DATABASE bup_db1;
+DROP DATABASE bup_db2;
+
+--echo Restoring Database
+
+RESTORE FROM 'bup_objectview.bak';
+
+USE bup_db1;
+
+#Alter table t1 and take BACKUP to see if view is not affected.
+
+ALTER TABLE t1 CHANGE id id tinyint not null;
+--query_vertical SHOW CREATE TABLE t1;
+
+SELECT * FROM t1;
+
+DELETE FROM t1 WHERE id=7;
+SELECT * FROM t1;
+
+SELECT * FROM v1;
+
+USE bup_db2;
+SELECT * FROM v3;
+
+#BUG#35249 Mysql server crash for delete operation followed by backup for Default Drivers.
+
+#DELETE FROM t2 WHERE age=24;
+#SELECT * FROM t2;
+#SELECT * FROM v3;
+
+BACKUP DATABASE bup_db1, bup_db2 TO 'bup_objectview3.bak';
+
+DROP DATABASE bup_db1;
+DROP DATABASE bup_db2;
+
+RESTORE FROM 'bup_objectview3.bak';
+
+USE bup_db2;
+SELECT * FROM v3;
+
+USE bup_db1;
+SELECT * FROM t1;
+
+# Test cleanup section
+
+--echo
+--echo ***  DROP bup_db1, bup_db2 DATABASE ****
+--echo
+
+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
+#BUG#35249 Mysql server crash for delete operation followed by backup for Default Drivers.

Thread
bzr commit into mysql-6.0 branch (jorgen.loland:2632) Bug#36265Jorgen Loland9 Jun