List:Commits« Previous MessageNext Message »
From:Chuck Bell Date:November 17 2009 3:35pm
Subject:bzr commit into mysql-6.0-backup branch (charles.bell:2891) Bug#48353
View as plain text  
#At file:///Users/cbell/source/bzr/mysql-6.0-bug-48353/ based on revid:charles.bell@stripped

 2891 Chuck Bell	2009-11-17 [merge]
      local merge before push for BUG#48353

    modified:
      mysql-test/collections/default.experimental
      mysql-test/suite/backup/include/backup_ext.inc
      mysql-test/suite/backup/t/backup_external_non_win.test
      mysql-test/suite/backup/t/backup_external_non_win_not_falcon.test
      sql/backup/stream_v1_transport.c
      sql/log.cc
      sql/si_logs.h
      unittest/backup/bstr_callback_errors-t.c
      unittest/backup/bstr_eos-t.c
      unittest/backup/bstr_io_errors-t.c
      unittest/backup/bstr_random_chunks-t.c
=== modified file 'mysql-test/collections/default.experimental'
--- a/mysql-test/collections/default.experimental	2009-11-10 17:24:18 +0000
+++ b/mysql-test/collections/default.experimental	2009-11-13 12:10:39 +0000
@@ -3,7 +3,6 @@
 
 backup.backup_dbname_lctn2  @windows  @darwin   # Bug#46933 2009-08-26 alik backup_*_lctn2 tests fail on windows
 backup.backup_events                     # Bug#47211 2009-09-25 alik backup_events.test fails randomly
-backup.backup_external_non_win*          # BUG#45877
 backup.backup_xpfm_compat_backup_lctn2 @windows # Bug#46933 2009-08-26 alik backup_*_lctn2 tests fail on windows
 
 binlog.binlog_multi_engine               # joro : NDB tests marked as experimental as agreed with bochklin

=== modified file 'mysql-test/suite/backup/include/backup_ext.inc'
--- a/mysql-test/suite/backup/include/backup_ext.inc	2009-03-25 22:17:35 +0000
+++ b/mysql-test/suite/backup/include/backup_ext.inc	2009-11-13 12:10:39 +0000
@@ -28,3 +28,6 @@ my $F = IO::File->new("$vardir/tmp/mctf.
 print $F "let \$MYSQL_CONVERT_TABLE_FORMAT = $location;";
 
 EOF
+
+--source $MYSQLTEST_VARDIR/tmp/mctf.inc
+

=== modified file 'mysql-test/suite/backup/t/backup_external_non_win.test'
--- a/mysql-test/suite/backup/t/backup_external_non_win.test	2009-06-13 10:12:02 +0000
+++ b/mysql-test/suite/backup/t/backup_external_non_win.test	2009-11-13 12:10:39 +0000
@@ -12,6 +12,11 @@
 --source suite/backup/include/backup_ext.inc
 --source suite/backup/include/have_dbi.inc
 
+if(`select "$MYSQL_CONVERT_TABLE_FORMAT" NOT LIKE '%convert_table_format%'`)
+{
+--skip Could not find mysql_convert_table_format utility.
+}
+
 let $MYSQLD_BACKUPDIR = `select @@backupdir`;
 let $MYSQLD_DATADIR= `select @@datadir`;
 
@@ -75,7 +80,6 @@ INSERT INTO db2.t1(b,c) VALUES
 # Changing the storage engine for db1
 SHOW CREATE TABLE db1.t1;
 
-source $MYSQLTEST_VARDIR/tmp/mctf.inc;
 --exec perl $MYSQL_CONVERT_TABLE_FORMAT --user=root -S $MASTER_MYSOCK --port=$MASTER_MYPORT  --type=innodb db1
 
 --echo
@@ -96,7 +100,6 @@ RESTORE FROM 'db1.bak';
 SHOW CREATE TABLE db1.t1;
 
 --echo # Changing the storage engine back to myisam
-source $MYSQLTEST_VARDIR/tmp/mctf.inc;
 --exec perl $MYSQL_CONVERT_TABLE_FORMAT -u root -S $MASTER_MYSOCK --port=$MASTER_MYPORT  db1
 
 SHOW CREATE TABLE db1.t1;
@@ -156,7 +159,6 @@ BACKUP DATABASE db1 TO 'db1.bak';
 --echo # tables in db1
 
 --disable_warnings
-source $MYSQLTEST_VARDIR/tmp/mctf.inc;
 --exec perl $MYSQL_CONVERT_TABLE_FORMAT -u root -S $MASTER_MYSOCK --port=$MASTER_MYPORT  --type=myisam db1
 --enable_warnings
 
@@ -191,7 +193,6 @@ RESTORE FROM 'db1.bak' OVERWRITE;
 --echo # Verify that tablespace is restored from db1.t2
 SHOW CREATE TABLE db1.t2;
 
-source $MYSQLTEST_VARDIR/tmp/mctf.inc;
 --exec perl $MYSQL_CONVERT_TABLE_FORMAT -u root -S $MASTER_MYSOCK --port=$MASTER_MYPORT  --type=falcon db1
 
 SHOW CREATE TABLE db1.tpl;
@@ -224,7 +225,6 @@ DROP VIEW db2.v1;
 --remove_file $MYSQLD_BACKUPDIR/db1.bak
 
 --echo # Changing the storage engine back to myisam after restore
-source $MYSQLTEST_VARDIR/tmp/mctf.inc;
 --exec perl $MYSQL_CONVERT_TABLE_FORMAT -u root -S $MASTER_MYSOCK --port=$MASTER_MYPORT db1
 
 SHOW CREATE TABLE db1.t1;

=== modified file 'mysql-test/suite/backup/t/backup_external_non_win_not_falcon.test'
--- a/mysql-test/suite/backup/t/backup_external_non_win_not_falcon.test	2009-06-30 07:51:04 +0000
+++ b/mysql-test/suite/backup/t/backup_external_non_win_not_falcon.test	2009-11-13 12:10:39 +0000
@@ -9,6 +9,11 @@
 --source suite/backup/include/backup_ext.inc
 --source suite/backup/include/have_dbi.inc
 
+if(`select "$MYSQL_CONVERT_TABLE_FORMAT" NOT LIKE '%convert_table_format%'`)
+{
+--skip Could not find mysql_convert_table_format utility.
+}
+
 let $MYSQLD_BACKUPDIR = `select @@backupdir`;
 let $MYSQLD_DATADIR= `select @@datadir`;
 
@@ -69,7 +74,6 @@ INSERT INTO db2.t1(b,c) VALUES
 # Changing the storage engine for db1
 SHOW CREATE TABLE db1.t1;
 
-source $MYSQLTEST_VARDIR/tmp/mctf.inc;
 --exec $MYSQL_CONVERT_TABLE_FORMAT --user=root -S $MASTER_MYSOCK --port=$MASTER_MYPORT  --type=innodb db1
 
 --echo
@@ -90,7 +94,6 @@ RESTORE FROM 'db1.bak';
 SHOW CREATE TABLE db1.t1;
 
 --echo # Changing the storage engine back to myisam
-source $MYSQLTEST_VARDIR/tmp/mctf.inc;
 --exec $MYSQL_CONVERT_TABLE_FORMAT -u root -S $MASTER_MYSOCK --port=$MASTER_MYPORT  db1
 
 SHOW CREATE TABLE db1.t1;
@@ -149,7 +152,6 @@ BACKUP DATABASE db1 TO 'db1.bak';
 --echo # tables in db1
 
 --disable_warnings
-source $MYSQLTEST_VARDIR/tmp/mctf.inc;
 --exec $MYSQL_CONVERT_TABLE_FORMAT -u root -S $MASTER_MYSOCK --port=$MASTER_MYPORT  --type=myisam db1
 --enable_warnings
 
@@ -182,7 +184,6 @@ RESTORE FROM 'db1.bak' OVERWRITE;
 
 SHOW CREATE TABLE db1.t2;
 
-source $MYSQLTEST_VARDIR/tmp/mctf.inc;
 --exec $MYSQL_CONVERT_TABLE_FORMAT -u root -S $MASTER_MYSOCK --port=$MASTER_MYPORT  --type=innodb db1
 
 SHOW CREATE TABLE db1.tpl;
@@ -215,7 +216,6 @@ DROP VIEW db2.v1;
 --remove_file $MYSQLD_BACKUPDIR/db1.bak
 
 --echo # Changing the storage engine back to myisam after restore
-source $MYSQLTEST_VARDIR/tmp/mctf.inc;
 --exec $MYSQL_CONVERT_TABLE_FORMAT -u root -S $MASTER_MYSOCK --port=$MASTER_MYPORT db1
 
 SHOW CREATE TABLE db1.t1;

=== modified file 'sql/backup/stream_v1_transport.c'
--- a/sql/backup/stream_v1_transport.c	2009-10-22 08:08:43 +0000
+++ b/sql/backup/stream_v1_transport.c	2009-11-16 07:36:42 +0000
@@ -2022,7 +2022,7 @@ int bstream_next_chunk(backup_stream *s)
         empty the buffer so that the next fragment will be loaded into it when
         the buffer is re-filled below.
       */
-      if (s->buf.header < s->buf.pos)
+      if (s->buf.header <= s->buf.pos)
         s->buf.begin= s->buf.header;
       else
       {

=== modified file 'sql/log.cc'
--- a/sql/log.cc	2009-10-26 14:02:26 +0000
+++ b/sql/log.cc	2009-11-16 18:37:18 +0000
@@ -3936,10 +3936,73 @@ bool MYSQL_BACKUP_LOG::write(THD *thd, s
       goto err;
     if (write_str(history_data->binlog_file))
       goto err;
-    if (write_int(history_data->state))
+
+    /*
+      Print the enumerated values to match the columns in the
+      table.
+    */
+    switch (history_data->state) {
+    case BUP_COMPLETE:
+      {
+        if (write_str("complete"))
+          goto err;
+        break;
+      }
+    case BUP_STARTING:
+      {
+        if (write_str("starting"))
+          goto err;
+        break;
+      }
+    case BUP_VALIDITY_POINT:
+      {
+        if (write_str("validity point"))
+          goto err;
+        break;
+      }
+    case BUP_RUNNING:
+      {
+        if (write_str("running"))
+          goto err;
+        break;
+      }
+    case BUP_ERRORS:
+      {
+        if (write_str("error"))
+          goto err;
+        break;
+      }
+    case BUP_CANCEL:
+      {
+        if (write_str("cancel"))
+          goto err;
+        break;
+      }
+    default:   // Should be no other values.
       goto err;
-    if (write_int(history_data->operation))
+    }
+      
+    /*
+      Print the enumerated values to match the columns in the
+      table.
+    */
+    switch (history_data->operation) {
+    case OP_BACKUP:
+      {
+        if (write_str("backup"))
+          goto err;
+        break;
+      }
+    case OP_RESTORE:
+      {
+        if (write_str("restore"))
+          goto err;
+        break;
+      }
+    default:   // Should be no other values.
       goto err;
+    }
+    
     if (write_int(history_data->error_num))
       goto err;
     if (write_int(history_data->num_objects))

=== modified file 'sql/si_logs.h'
--- a/sql/si_logs.h	2009-05-21 13:17:37 +0000
+++ b/sql/si_logs.h	2009-11-16 18:37:18 +0000
@@ -10,27 +10,30 @@
 
 /**
   List of operations for backup history log.
+  
+  @note These must match the definition for the column 'operation'
+  in the backup_history and backup_progress tables.
 */
 enum enum_backup_operation
 {
   OP_BACKUP = 1,
-  OP_RESTORE,
-  OP_SHOW,
-  OP_OTHER
+  OP_RESTORE = 2
 };
 
 /**
   List of states for backup logs.
+  
+  @note These must match the definition for the column 'backup_state'
+  in the backup_history table.
 */
 enum enum_backup_state
 {
-  BUP_UNKNOWN = 0,
-  BUP_COMPLETE,
-  BUP_STARTING,
-  BUP_VALIDITY_POINT,
-  BUP_RUNNING,
-  BUP_ERRORS,
-  BUP_CANCEL
+  BUP_COMPLETE = 1,
+  BUP_STARTING = 2,
+  BUP_VALIDITY_POINT = 3,
+  BUP_RUNNING = 4,
+  BUP_ERRORS = 5,
+  BUP_CANCEL = 6
 };
 
 /**

=== modified file 'unittest/backup/bstr_callback_errors-t.c'
--- a/unittest/backup/bstr_callback_errors-t.c	2009-10-23 06:24:37 +0000
+++ b/unittest/backup/bstr_callback_errors-t.c	2009-11-16 07:36:42 +0000
@@ -30,14 +30,21 @@ void run_test()
 {
   uint i;
   uint planned;
+  uint read_planned, write_planned;
+  
+  write_planned= 1 + global_count + 4 + db_count
+                   + 1 + global_count + perdb_count;
+ 
+  read_planned= 3 + global_count + perdb_count + 2;
+
+  planned = read_planned+write_planned;
+
+  plan(planned);
 
   init_catalog(&img_header);
 
   diag("Testing callback failures during writing of backup image");
 
-  planned= 1 + global_count + 4 + db_count
-           + 1 + global_count + perdb_count + 1;
-
   /*
     Do a clean write of backup image to fill callback_counts structure holding
     counters for callback functions.
@@ -89,7 +96,6 @@ void run_test()
 
   diag("Testing callback failures during reading of backup image");
 
-  planned+= 3 + global_count + perdb_count + 2;
 
   /* Do a clean read of the backup image to set the callback counters. */
   reset_counts();
@@ -124,8 +130,6 @@ void run_test()
   /* test errors in memory allocation */
   ok(fail_alloc(RD), "Errors in memory allocation");
 
-  /* Plan (1..n) must be at the beginning or end of the TAP output. */
-  plan(planned);
 }
 
 

=== modified file 'unittest/backup/bstr_eos-t.c'
--- a/unittest/backup/bstr_eos-t.c	2009-10-12 09:08:34 +0000
+++ b/unittest/backup/bstr_eos-t.c	2009-11-16 07:36:42 +0000
@@ -60,6 +60,10 @@ void run_test()
   image_header  hdr;
   int  i;
   byte header;
+ /*
+   Number of tests to be planned are not known at this point.
+ */
+  plan(NO_PLAN);
 
   init_catalog(&hdr);
 
@@ -135,8 +139,6 @@ void run_test()
     *chunk[i]= header;
   }
 
-  /* Plan (1..n) must be at the beginning or end of the TAP output. */
-  plan(1 + 2*chunk_count + 3*(chunk_count-3));
 }
 
 

=== modified file 'unittest/backup/bstr_io_errors-t.c'
--- a/unittest/backup/bstr_io_errors-t.c	2009-10-12 09:08:34 +0000
+++ b/unittest/backup/bstr_io_errors-t.c	2009-11-16 07:36:42 +0000
@@ -16,7 +16,11 @@ void run_test()
 {
   int i;
   int  can_pass;
-  uint planned;
+  
+  /*
+    Number of tests to be planned are not known at this point.
+  */
+  plan(NO_PLAN);
 
   init_catalog(&img_header);
 
@@ -29,7 +33,6 @@ void run_test()
   diag("Made %lu write calls", io_counts.write);
   diag("Wrote %lu bytes", (long unsigned)io_counts.write_bytes);
 
-  planned= 1 + 2*io_counts.write;
 
   /*
     Errors during last 2 write calls (which happen during closing of a stream)
@@ -61,7 +64,6 @@ void run_test()
   diag("Made %lu read calls", io_counts.read);
   diag("Read %lu bytes", (long unsigned)io_counts.read_bytes);
 
-  planned+= 1 + io_counts.read;
 
   for(i= io_counts.read; i > 0 ; --i)
   {
@@ -71,7 +73,4 @@ void run_test()
        "Failing %d-th read call", i);
   }
 
-  /* Plan (1..n) must be at the beginning or end of the TAP output. */
-  plan(planned);
 }
-

=== modified file 'unittest/backup/bstr_random_chunks-t.c'
--- a/unittest/backup/bstr_random_chunks-t.c	2009-10-12 09:08:34 +0000
+++ b/unittest/backup/bstr_random_chunks-t.c	2009-11-16 07:36:42 +0000
@@ -44,9 +44,12 @@ void run_test()
   size_t byte_count;
   size_t csize;
   int    ret;
-  uint   planned;
 
   stream_block_size= BSIZE;
+ /*
+   Number of tests to be planned are not known at this point.
+  */
+  plan(NO_PLAN);
 
   diag("Writing");
 
@@ -79,7 +82,6 @@ void run_test()
 
   diag("Reading");
 
-  planned= 2*chunk_count + 2;
 
   ret= backup_stream_open_rd(&stream, "random.bst"); 
   if (ret)
@@ -111,8 +113,6 @@ void run_test()
   ok(BSTREAM_EOS == ret,"Moving to next chunk after EOS was hit");
 
  end:
-  /* Plan (1..n) must be at the beginning or end of the TAP output. */
-  plan(planned);
 
   backup_stream_close(&stream);
 }


Attachment: [text/bzr-bundle] bzr/charles.bell@sun.com-20091117153505-h6bemkg2kzl6z5kk.bundle
Thread
bzr commit into mysql-6.0-backup branch (charles.bell:2891) Bug#48353Chuck Bell17 Nov