Below is the list of changes that have just been committed into a local
5.1 repository of rafal. When rafal does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet@stripped, 2007-04-11 22:29:53+02:00, rafal@quant.(none) +2 -0
WL#3327: Update test to backup/restore more than one database.
mysql-test/r/backup.result@stripped, 2007-04-11 22:29:49+02:00, rafal@quant.(none) +60 -27
Result updates.
mysql-test/t/backup.test@stripped, 2007-04-11 22:29:50+02:00, rafal@quant.(none) +22 -17
Test multi-database backup/restore.
# This is a BitKeeper patch. What follows are the unified diffs for the
# set of deltas contained in the patch. The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: rafal
# Host: quant.(none)
# Root: /ext/mysql/bk/backup/prototype
--- 1.30/mysql-test/r/backup.result 2007-04-11 22:29:58 +02:00
+++ 1.31/mysql-test/r/backup.result 2007-04-11 22:29:58 +02:00
@@ -1,4 +1,12 @@
-use test;
+DROP DATABASE IF EXISTS db1;
+Warnings:
+Note 1008 Can't drop database 'db1'; database doesn't exist
+DROP DATABASE IF EXISTS db2;
+Warnings:
+Note 1008 Can't drop database 'db2'; database doesn't exist
+CREATE DATABASE db1;
+CREATE DATABASE db2;
+USE db1;
DROP TABLE IF EXISTS `building`;
Warnings:
Note 1051 Unknown table 'building'
@@ -20,6 +28,7 @@
LOCK TABLES `directorate` WRITE;
INSERT INTO `directorate` VALUES ('N41','Development','333445555'),('N01','Human Resources','123654321'),('M00','Management','333444444');
UNLOCK TABLES;
+USE db2;
DROP TABLE IF EXISTS `staff`;
Warnings:
Note 1051 Unknown table 'staff'
@@ -46,36 +55,57 @@
LOCK TABLES `tasking` WRITE;
INSERT INTO `tasking` VALUES ('333445555','405',23),('123763153','405',33.5),('921312388','601',44),('800122337','300',13),('820123637','300',9.5),('830132335','401',8.5),('333445555','300',11),('921312388','500',13),('800122337','300',44),('820123637','401',500.5),('830132335','400',12),('333445665','600',300.25),('123654321','607',444.75),('123456789','300',1000);
UNLOCK TABLES;
-SHOW TABLES;
-Tables_in_test
-building
-directorate
-staff
-tasking
-BACKUP TO 'test.ba';
+BACKUP DATABASE db1,db2 TO 'test.ba';
Backup Summary
-Backed-up 4 tables.
-Wrote 3182 bytes of backup archive.
- header = 87 bytes
- table defs = 819 bytes
+This archive contains 2 databases
+and a total of 4 tables.
+
+ header = 1028 bytes
data = 2276 bytes
-DROP DATABASE test;
-CREATE DATABASE test;
+ --------------
+ total 3304 bytes
+DROP DATABASE db1;
+DROP DATABASE db2;
+SHOW BACKUP 'test.ba';
+Database Table Metadata
+db1 building CREATE TABLE `db1`.`building` (
+ `dir_code` char(4) DEFAULT NULL,
+ `building` char(6) DEFAULT NULL
+) ENGINE=ARCHIVE DEFAULT CHARSET=latin1
+db1 directorate CREATE TABLE `db1`.`directorate` (
+ `dir_code` char(4) DEFAULT NULL,
+ `dir_name` char(30) DEFAULT NULL,
+ `dir_head_id` char(9) DEFAULT NULL
+) ENGINE=ARCHIVE DEFAULT CHARSET=latin1
+db2 staff CREATE TABLE `db2`.`staff` (
+ `id` char(9) DEFAULT NULL,
+ `first_name` char(20) DEFAULT NULL,
+ `mid_name` char(20) DEFAULT NULL,
+ `last_name` char(30) DEFAULT NULL,
+ `sex` char(1) DEFAULT NULL,
+ `salary` int(11) DEFAULT NULL,
+ `mgr_id` char(9) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+db2 tasking CREATE TABLE `db2`.`tasking` (
+ `id` char(9) DEFAULT NULL,
+ `project_number` char(9) DEFAULT NULL,
+ `hours_worked` double(10,2) DEFAULT NULL
+) ENGINE=BLACKHOLE DEFAULT CHARSET=latin1
USE mysql;
-RESTORE FROM 'test.ba';
+RESTORE DATABASE FROM 'test.ba';
Restore Summary
-Restored 4 tables.
-Read 3182 bytes of backup archive.
- header = 87 bytes
- table defs = 819 bytes
+This archive restored 2 databases
+and a total of 4 tables.
+
+ header = 1028 bytes
data = 2276 bytes
-USE test;
+ --------------
+ total 3304 bytes
+USE db1;
SHOW TABLES;
-Tables_in_test
+Tables_in_db1
building
directorate
-staff
-tasking
SELECT * FROM building;
dir_code building
N41 1300
@@ -88,6 +118,11 @@
N41 Development 333445555
N01 Human Resources 123654321
M00 Management 333444444
+USE db2;
+SHOW TABLES;
+Tables_in_db2
+staff
+tasking
SELECT * FROM staff;
id first_name mid_name last_name sex salary mgr_id
333445555 John Q Smith M 30000 333444444
@@ -107,7 +142,5 @@
`project_number` char(9) DEFAULT NULL,
`hours_worked` double(10,2) DEFAULT NULL
) ENGINE=BLACKHOLE DEFAULT CHARSET=latin1
-DROP TABLE IF EXISTS `building`;
-DROP TABLE IF EXISTS `directorate`;
-DROP TABLE IF EXISTS `staff`;
-DROP TABLE IF EXISTS `tasking`;
+DROP DATABASE IF EXISTS db1;
+DROP DATABASE IF EXISTS db2;
--- 1.31/mysql-test/t/backup.test 2007-04-11 22:29:58 +02:00
+++ 1.32/mysql-test/t/backup.test 2007-04-11 22:29:58 +02:00
@@ -3,7 +3,13 @@
connection backup;
-use test;
+DROP DATABASE IF EXISTS db1;
+DROP DATABASE IF EXISTS db2;
+
+CREATE DATABASE db1;
+CREATE DATABASE db2;
+
+USE db1;
# SHOW ENGINES;
@@ -43,6 +49,8 @@
INSERT INTO `directorate` VALUES ('N41','Development','333445555'),('N01','Human Resources','123654321'),('M00','Management','333444444');
UNLOCK TABLES;
+USE db2;
+
--
-- Table structure for table `staff`
--
@@ -86,18 +94,12 @@
UNLOCK TABLES;
+BACKUP DATABASE db1,db2 TO 'test.ba';
-SHOW TABLES;
-
-BACKUP DATABASE test TO 'test.ba';
-
-DROP DATABASE test;
-
-#DROP TABLE IF EXISTS `building`;
-#DROP TABLE IF EXISTS `directorate`;
-#DROP TABLE IF EXISTS `staff`;
-#DROP TABLE IF EXISTS `tasking`;
+DROP DATABASE db1;
+DROP DATABASE db2;
+SHOW BACKUP 'test.ba';
disconnect backup;
@@ -107,17 +109,20 @@
RESTORE DATABASE FROM 'test.ba';
-USE test;
-
+USE db1;
SHOW TABLES;
SELECT * FROM building;
SELECT * FROM directorate;
+
+
+USE db2;
+SHOW TABLES;
+
SELECT * FROM staff;
SHOW CREATE TABLE tasking;
-DROP TABLE IF EXISTS `building`;
-DROP TABLE IF EXISTS `directorate`;
-DROP TABLE IF EXISTS `staff`;
-DROP TABLE IF EXISTS `tasking`;
+DROP DATABASE IF EXISTS db1;
+DROP DATABASE IF EXISTS db2;
+
| Thread |
|---|
| • bk commit into 5.1 tree (rafal:1.2508) | rsomla | 11 Apr |