List:Commits« Previous MessageNext Message »
From:Oystein Grovlen Date:June 6 2008 1:56pm
Subject:bzr commit into mysql-6.0 branch (ogrovlen:2632) Bug#36586, Bug#36624
View as plain text  
#At file:///home/og136792/mysql/shared/mysql-6.0-backup-1/

 2632 Oystein Grovlen	2008-06-06
      BUG#36586 Online backup stream library can miss end of a stream.
      Make sure end-of-stream is detected.
added:
  mysql-test/r/backup_multi_blocks.result
  mysql-test/t/backup_multi_blocks.test
modified:
  sql/backup/stream_v1_transport.c

per-file messages:
  mysql-test/r/backup_multi_blocks.result
    Output for new test.
  mysql-test/t/backup_multi_blocks.test
    Test that a restore of a multi-block backup is succesful.
    Prior to this bug fix, test would hang.
    Until bug 36624 is fixed the restore in this test will fail,
    and currently the test is written to expect that.
    However, suite will anyway fail since something is written to master.err when a restore fails.
  sql/backup/stream_v1_transport.c
    Make sure unexpected end-of-stream is detected in load_buffer()
    Have verified that all calls to as_read() now checks for end-of-stream.
=== added file 'mysql-test/r/backup_multi_blocks.result'

=== added file 'mysql-test/r/backup_multi_blocks.result'
--- a/mysql-test/r/backup_multi_blocks.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/r/backup_multi_blocks.result	2008-06-06 13:56:25 +0000
@@ -0,0 +1,33 @@
+create database mysqltest;
+use mysqltest;
+CREATE TABLE t1 (a longtext) engine=myisam;
+use mysqltest;
+insert into t1 values ("text");
+update t1 set a=concat(a,a);
+update t1 set a=concat(a,a);
+update t1 set a=concat(a,a);
+update t1 set a=concat(a,a);
+update t1 set a=concat(a,a);
+update t1 set a=concat(a,a);
+update t1 set a=concat(a,a);
+update t1 set a=concat(a,a);
+update t1 set a=concat(a,a);
+update t1 set a=concat(a,a);
+update t1 set a=concat(a,a);
+update t1 set a=concat(a,a);
+update t1 set a=concat(a,a);
+select length(a) from t1;
+length(a)
+32768
+BACKUP DATABASE mysqltest TO 'test.ba';
+backup_id
+#;
+DROP DATABASE mysqltest;
+RESTORE FROM 'test.ba';
+ERROR HY000: Error when reading summary section of backup image
+select length(a) from t1;
+length(a)
+checksum table t1;
+Table	Checksum
+mysqltest.t1	0
+drop database mysqltest;

=== added file 'mysql-test/t/backup_multi_blocks.test'
--- a/mysql-test/t/backup_multi_blocks.test	1970-01-01 00:00:00 +0000
+++ b/mysql-test/t/backup_multi_blocks.test	2008-06-06 13:56:25 +0000
@@ -0,0 +1,26 @@
+create database mysqltest;
+use mysqltest;
+
+CREATE TABLE t1 (a longtext) engine=myisam;
+
+use mysqltest;
+insert into t1 values ("text");
+let $1=13;
+while ($1)
+{
+  update t1 set a=concat(a,a);
+  dec $1;
+}
+select length(a) from t1;
+
+--replace_column 1 #;
+BACKUP DATABASE mysqltest TO 'test.ba';
+
+DROP DATABASE mysqltest;
+
+--error 1698
+RESTORE FROM 'test.ba';
+
+select length(a) from t1;
+checksum table t1;
+drop database mysqltest;

=== modified file 'sql/backup/stream_v1_transport.c'
--- a/sql/backup/stream_v1_transport.c	2007-12-03 20:28:32 +0000
+++ b/sql/backup/stream_v1_transport.c	2008-06-06 13:56:25 +0000
@@ -1480,7 +1480,7 @@
     saved= *data;
     data->end= data->begin + howmuch;
 
-    as_read(&s->stream,data,buf);
+    if (as_read(&s->stream, data, buf) == BSTREAM_EOS) s->state= EOS;
 
     s->buf.begin += data->begin - saved.begin;
     s->buf.pos= s->buf.begin;

Thread
bzr commit into mysql-6.0 branch (ogrovlen:2632) Bug#36586, Bug#36624Oystein Grovlen6 Jun