MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:Hema Sridharan Date:September 3 2009 4:24am
Subject:bzr commit into mysql-6.0-backup branch (hema:2867) Bug#47082
View as plain text  
#At file:///export/home/tmp/mysql-0828/mysql-6.0-backup/ based on revid:hema@stripped

 2867 Hema Sridharan	2009-09-03
      BUG#47082 ( Backup should be able to handle rows
      in table of size 1GB). The patch for this bug will 
      create new test case backup_row_size and is placed
      in backup suite.
      added:
        mysql-test/suite/backup/r/backup_row_size.result
        mysql-test/suite/backup/t/backup_row_size.test

per-file messages:
  mysql-test/suite/backup/r/backup_row_size.result
    Result file for backup_row_size.test
  mysql-test/suite/backup/t/backup_row_size.test
    New test backup_row_size willverify that backup and restore are successful when table has rows of size 1GB or more
=== added file 'mysql-test/suite/backup/r/backup_row_size.result'
--- a/mysql-test/suite/backup/r/backup_row_size.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/backup/r/backup_row_size.result	2009-09-03 04:24:10 +0000
@@ -0,0 +1,124 @@
+# Initial clean-up.
+DROP DATABASE IF EXISTS db1;
+# Create database and tables
+CREATE DATABASE db1;
+CREATE TABLE db1.t1(a longblob);
+# Test 1: Perform backup and restore of database that has table with
+# row size of 1GB
+SET GLOBAL MAX_ALLOWED_PACKET=1073741824;
+SELECT @@global.max_allowed_packet;
+@@global.max_allowed_packet
+1073741824
+# Insert data of size 1GB in t1
+FLUSH TABLES;
+SELECT COUNT(*) FROM db1.t1;
+COUNT(*)
+1024
+SELECT LENGTH(a) FROM db1.t1 LIMIT 5;
+LENGTH(a)
+1048576
+1048576
+1048576
+1048576
+1048576
+CHECK TABLE db1.t1;
+Table	Op	Msg_type	Msg_text
+db1.t1	check	status	OK
+# Perform backup and restore
+BACKUP DATABASE db1 TO 'db1.bak';
+backup_id
+#
+DROP DATABASE db1;
+RESTORE FROM 'db1.bak';
+backup_id
+#
+# Verify the data and size of table after restore
+SELECT LENGTH(a) FROM db1.t1 LIMIT 5;
+LENGTH(a)
+1048576
+1048576
+1048576
+1048576
+1048576
+SELECT COUNT(*) FROM db1.t1;
+COUNT(*)
+1024
+# Check for any errors
+CHECK TABLE db1.t1;
+Table	Op	Msg_type	Msg_text
+db1.t1	check	status	OK
+# Test 2: Change the storage engine of table and verify backup and 
+# restore are successful
+ALTER TABLE db1.t1 ENGINE=InnoDB;
+SHOW CREATE TABLE db1.t1;
+Table	Create Table
+t1	CREATE TABLE `t1` (
+  `a` longblob
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+BACKUP DATABASE db1 TO 'db1a.bak';
+backup_id
+#
+DROP DATABASE db1;
+RESTORE FROM 'db1a.bak';
+backup_id
+#
+# Verify the data and size of table after restore
+SELECT LENGTH(a) FROM db1.t1 LIMIT 5;
+LENGTH(a)
+1048576
+1048576
+1048576
+1048576
+1048576
+SELECT COUNT(*) FROM db1.t1;
+COUNT(*)
+1024
+# Check for any errors
+CHECK TABLE db1.t1;
+Table	Op	Msg_type	Msg_text
+db1.t1	check	status	OK
+# Test 3: Increase the size of data in table and perform backup and 
+# restore
+DROP TABLE db1.t1;
+CREATE TABLE db1.t1(a longblob);
+SET GLOBAL MAX_ALLOWED_PACKET=2147483648;
+# Insert data of size 2GB in t1
+FLUSH TABLES;
+SELECT COUNT(*) FROM db1.t1;
+COUNT(*)
+2048
+SELECT LENGTH(a) FROM db1.t1 LIMIT 5;
+LENGTH(a)
+1048576
+1048576
+1048576
+1048576
+1048576
+CHECK TABLE db1.t1;
+Table	Op	Msg_type	Msg_text
+db1.t1	check	status	OK
+# Perform backup and restore
+BACKUP DATABASE db1 TO 'db1.bak';
+backup_id
+#
+DROP DATABASE db1;
+RESTORE FROM 'db1.bak';
+backup_id
+#
+# Verify the data and size of table after restore
+SELECT LENGTH(a) FROM db1.t1 LIMIT 5;
+LENGTH(a)
+1048576
+1048576
+1048576
+1048576
+1048576
+SELECT COUNT(*) FROM db1.t1;
+COUNT(*)
+2048
+# Check for any errors
+CHECK TABLE db1.t1;
+Table	Op	Msg_type	Msg_text
+db1.t1	check	status	OK
+# Final clean-up.
+DROP DATABASE db1;

=== added file 'mysql-test/suite/backup/t/backup_row_size.test'
--- a/mysql-test/suite/backup/t/backup_row_size.test	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/backup/t/backup_row_size.test	2009-09-03 04:24:10 +0000
@@ -0,0 +1,148 @@
+# This test is created for BUG#47082
+# In this test we will verify that MySQL backup handles tables with row size 
+# of 1GB. Mysqldump always had issue to handle row sizes of 1GB or more
+
+--source include/have_innodb.inc
+--source include/not_embedded.inc
+
+let $bdir=`SELECT @@backupdir`;
+let $allowed_packet=`select @@max_allowed_packet`;
+--echo # Initial clean-up.
+
+--disable_warnings
+DROP DATABASE IF EXISTS db1;
+--error 0,1
+--remove_file $bdir/db1.bak
+--enable_warnings
+
+--echo # Create database and tables
+
+CREATE DATABASE db1;
+CREATE TABLE db1.t1(a longblob);
+
+--echo # Test 1: Perform backup and restore of database that has table with
+--echo # row size of 1GB
+
+# We choose longblob as it can handle row sizes upto 4GB in tables
+# The default size of maximum allowed packet is 1MB. Therefore, we change the
+# max allowed packet size to 1GB in order to create rows of size 1GB
+
+SET GLOBAL MAX_ALLOWED_PACKET=1073741824;
+SELECT @@global.max_allowed_packet;
+
+--echo # Insert data of size 1GB in t1
+FLUSH TABLES;
+
+--disable_query_log
+let $n=1024;
+while ($n)
+{
+eval INSERT INTO db1.t1 VALUES(repeat('z',1048576));
+dec $n;
+}
+--enable_query_log
+
+SELECT COUNT(*) FROM db1.t1;
+SELECT LENGTH(a) FROM db1.t1 LIMIT 5;
+CHECK TABLE db1.t1;
+
+--echo # Perform backup and restore
+
+--replace_column 1 #
+BACKUP DATABASE db1 TO 'db1.bak';
+	
+DROP DATABASE db1;
+
+--replace_column 1 #
+RESTORE FROM 'db1.bak';
+
+--echo # Verify the data and size of table after restore
+SELECT LENGTH(a) FROM db1.t1 LIMIT 5;
+SELECT COUNT(*) FROM db1.t1;
+
+--echo # Check for any errors
+CHECK TABLE db1.t1;
+--remove_file $bdir/db1.bak
+
+--echo # Test 2: Change the storage engine of table and verify backup and 
+--echo # restore are successful
+
+ALTER TABLE db1.t1 ENGINE=InnoDB;
+SHOW CREATE TABLE db1.t1;
+
+--replace_column 1 #
+BACKUP DATABASE db1 TO 'db1a.bak';
+
+DROP DATABASE db1;
+
+--replace_column 1 #
+RESTORE FROM 'db1a.bak';
+
+--echo # Verify the data and size of table after restore
+SELECT LENGTH(a) FROM db1.t1 LIMIT 5;
+SELECT COUNT(*) FROM db1.t1;
+
+--echo # Check for any errors
+CHECK TABLE db1.t1;
+--remove_file $bdir/db1a.bak
+
+--echo # Test 3: Increase the size of data in table and perform backup and 
+--echo # restore
+
+DROP TABLE db1.t1;
+CREATE TABLE db1.t1(a longblob);
+
+# Increase the size of max allowed packet 
+
+--disable_warnings
+SET GLOBAL MAX_ALLOWED_PACKET=2147483648;
+
+--echo # Insert data of size 2GB in t1
+FLUSH TABLES;
+
+--disable_query_log
+let $n=2048;
+while ($n)
+{
+eval INSERT INTO db1.t1 VALUES(repeat('z',1048576));
+dec $n;
+}
+--enable_query_log
+
+SELECT COUNT(*) FROM db1.t1;
+SELECT LENGTH(a) FROM db1.t1 LIMIT 5;
+CHECK TABLE db1.t1;
+ 
+--echo # Perform backup and restore
+
+--replace_column 1 #
+BACKUP DATABASE db1 TO 'db1.bak';
+
+DROP DATABASE db1;
+
+--replace_column 1 #
+RESTORE FROM 'db1.bak';
+
+--echo # Verify the data and size of table after restore
+SELECT LENGTH(a) FROM db1.t1 LIMIT 5;
+SELECT COUNT(*) FROM db1.t1;
+
+--echo # Check for any errors
+CHECK TABLE db1.t1;
+
+--echo # Final clean-up.
+
+--disable_query_log
+eval SET GLOBAL MAX_ALLOWED_PACKET=$allowed_packet;
+--enable_query_log
+
+DROP DATABASE db1;
+--remove_file $bdir/db1.bak
+
+
+
+
+
+
+
+

Thread
bzr commit into mysql-6.0-backup branch (hema:2867) Bug#47082Hema Sridharan3 Sep