List:Commits« Previous MessageNext Message »
From:oystein.grovlen Date:May 28 2008 11:46am
Subject:bk commit into 6.0 tree (og136792:1.2622) BUG#34210
View as plain text  
Below is the list of changes that have just been committed into a local
6.0 repository of og136792.  When og136792 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, 2008-05-28 13:46:39+02:00, og136792@stripped +3 -0
  Bug#34210: Perform commit at end of restore.
  (Restore should be a transaction by itself.)

  mysql-test/r/backup_commit_restore.result@stripped, 2008-05-28 13:46:30+02:00, og136792@stripped +22 -0
    New BitKeeper file ``mysql-test/r/backup_commit_restore.result''

  mysql-test/r/backup_commit_restore.result@stripped, 2008-05-28 13:46:30+02:00, og136792@stripped +0 -0

  mysql-test/t/backup_commit_restore.test@stripped, 2008-05-28 13:46:31+02:00, og136792@stripped +47 -0
    Test that restore is automatically committed (i.e., that it is not rolled
    back.  Tests added for both InnoDB and Falcon, but Falcon test is commented
    out because of bug 34205.

  mysql-test/t/backup_commit_restore.test@stripped, 2008-05-28 13:46:31+02:00, og136792@stripped +0 -0

  sql/backup/be_default.cc@stripped, 2008-05-28 13:46:30+02:00, og136792@stripped +2 -0
    Perform commit at end of restore.
    (Restore should be a transaction by itself.)

diff -Nrup a/mysql-test/r/backup_commit_restore.result b/mysql-test/r/backup_commit_restore.result
--- /dev/null	Wed Dec 31 16:00:00 196900
+++ b/mysql-test/r/backup_commit_restore.result	2008-05-28 13:46:30 +02:00
@@ -0,0 +1,22 @@
+CREATE DATABASE commit_test;
+USE commit_test;
+SET @@autocommit=0;
+CREATE TABLE t (s1 CHAR(1)) ENGINE=innodb;
+INSERT INTO t VALUES ('a');
+COMMIT;
+BACKUP DATABASE commit_test TO '82';
+backup_id
+#
+RESTORE FROM '82';
+backup_id
+#
+SELECT * FROM t;
+s1
+a
+ROLLBACK;
+SELECT * FROM t;
+s1
+a
+COMMIT;
+DROP DATABASE commit_test;
+COMMIT;
diff -Nrup a/mysql-test/t/backup_commit_restore.test b/mysql-test/t/backup_commit_restore.test
--- /dev/null	Wed Dec 31 16:00:00 196900
+++ b/mysql-test/t/backup_commit_restore.test	2008-05-28 13:46:31 +02:00
@@ -0,0 +1,47 @@
+--source include/have_innodb.inc
+--source include/not_embedded.inc
+
+# Test that it is not possible to rollback restore.  That is, that an
+# automatic commit is performed as part of restore.
+# This test the behavior reported in BUG#34210
+
+CREATE DATABASE commit_test;
+
+# Test for InnoDB
+USE commit_test;
+SET @@autocommit=0;
+CREATE TABLE t (s1 CHAR(1)) ENGINE=innodb;
+INSERT INTO t VALUES ('a');
+COMMIT;
+
+replace_column 1 #;
+BACKUP DATABASE commit_test TO '82';
+
+replace_column 1 #;
+RESTORE FROM '82';
+
+SELECT * FROM t;
+ROLLBACK;
+SELECT * FROM t;
+COMMIT;
+
+# Test for Falcon disabled because clean-up will fail due to BUG#34205
+
+#CREATE TABLE t1 (s1 CHAR(1)) ENGINE=falcon;
+#INSERT INTO t1 VALUES ('a');
+#COMMIT;
+#
+#replace_column 1 #;
+#BACKUP DATABASE commit_test to '83';
+#
+#replace_column 1 #;
+#RESTORE FROM '83';
+#
+#SELECT * FROM t1;
+#ROLLBACK;
+#SELECT * FROM t1;
+#COMMIT;
+
+# Clean-up
+DROP DATABASE commit_test;
+COMMIT;
diff -Nrup a/sql/backup/be_default.cc b/sql/backup/be_default.cc
--- a/sql/backup/be_default.cc	2008-05-14 18:28:30 +02:00
+++ b/sql/backup/be_default.cc	2008-05-28 13:46:30 +02:00
@@ -622,6 +622,8 @@ result_t Restore::truncate_table(TABLE *
 result_t Restore::end()
 {
   DBUG_ENTER("Restore::end");
+  ha_autocommit_or_rollback(m_thd, 0);
+  end_active_trans(m_thd);
   close_thread_tables(m_thd);
   DBUG_RETURN(OK);
 }
Thread
bk commit into 6.0 tree (og136792:1.2622) BUG#34210oystein.grovlen28 May
  • RE: bk commit into 6.0 tree (og136792:1.2622) BUG#34210Chuck Bell28 May
    • Re: bk commit into 6.0 tree (og136792:1.2622) BUG#34210Øystein Grøvlen29 May
      • RE: bk commit into 6.0 tree (og136792:1.2622) BUG#34210Chuck Bell29 May
        • Re: bk commit into 6.0 tree (og136792:1.2622) BUG#34210Øystein Grøvlen30 May