2692 oystein.grovlen@stripped 2008-09-29 [merge]
Merge from mysql-6.0 to mysql-6.0-backup-merge
modified:
configure.in
2691 oystein.grovlen@stripped 2008-09-28 [merge]
Merge from mysql-6.0-backup to mysql-6.0-backup-merge
added:
mysql-test/r/backup_commit_backup.result
mysql-test/t/backup_commit_backup.test
modified:
sql/backup/kernel.cc
sql/log.cc
2690 oystein.grovlen@stripped 2008-09-19 [merge]
Merge from main-6.0 into main-6.0-backup-merge
removed:
mysql-test/suite/falcon/r/falcon_select_excerpt.result
mysql-test/suite/falcon/t/falcon_select_excerpt.test
mysql-test/suite/falcon_team/r/falcon_bug_22166.result
mysql-test/suite/falcon_team/r/falcon_bug_22187.result
mysql-test/suite/falcon_team/r/falcon_bug_28006.result
mysql-test/suite/falcon_team/t/falcon_bug_22166.test
mysql-test/suite/falcon_team/t/falcon_bug_22187.test
mysql-test/suite/falcon_team/t/falcon_bug_28006.test
added:
mysql-test/suite/falcon/r/falcon_bug_22207-big.result
mysql-test/suite/falcon/r/falcon_bug_37668.result
mysql-test/suite/falcon/r/falcon_bug_38304.result
mysql-test/suite/falcon/r/falcon_index_datatypes.result
mysql-test/suite/falcon/r/falcon_online_index.result
mysql-test/suite/falcon/t/falcon_bug_22207-big.test
mysql-test/suite/falcon/t/falcon_bug_37668.test
mysql-test/suite/falcon/t/falcon_bug_38304.test
mysql-test/suite/falcon/t/falcon_index_datatypes.test
mysql-test/suite/falcon/t/falcon_online_index.test
storage/falcon/SyncHandler.cpp
storage/falcon/SyncHandler.h
renamed:
mysql-test/suite/falcon_team/r/falcon_bug_22189.result =>
mysql-test/suite/falcon/r/falcon_bug_22189.result
mysql-test/suite/falcon_team/r/falcon_bug_22207.result =>
mysql-test/suite/falcon/r/falcon_bug_22207.result
mysql-test/suite/falcon_team/r/falcon_bug_24024.result =>
mysql-test/suite/falcon/r/falcon_bug_24024.result
mysql-test/suite/falcon_team/t/falcon_bug_22189.test =>
mysql-test/suite/falcon/t/falcon_bug_22189.test
mysql-test/suite/falcon_team/t/falcon_bug_22207.test =>
mysql-test/suite/falcon/t/falcon_bug_22207.test
mysql-test/suite/falcon_team/t/falcon_bug_24024.test =>
mysql-test/suite/falcon/t/falcon_bug_24024.test
modified:
Makefile.am
client/mysqldump.c
extra/CMakeLists.txt
include/atomic/generic-msvc.h
mysql-test/r/backup_tablespace.result
mysql-test/r/information_schema.result
mysql-test/r/information_schema_db.result
mysql-test/r/mysqlshow.result
mysql-test/suite/falcon/r/falcon_bug_22972.result
mysql-test/suite/falcon/t/falcon_bug_22972.test
mysql-test/suite/falcon_team/r/falcon_bug_23945.result
mysql-test/suite/falcon_team/t/disabled.def
mysql-test/suite/falcon_team/t/falcon_bug_23945.test
mysql-test/suite/funcs_1/r/is_columns_is.result
mysql-test/suite/funcs_1/r/is_columns_is_falcon.result
mysql-test/suite/funcs_1/r/is_tables_is.result
mysql-test/suite/funcs_1/r/is_tables_is_falcon.result
mysql-test/suite/ndb/r/ndb_dd_dump.result
mysql-test/suite/ndb/t/ndb_dd_dump.test
mysys/stacktrace.c
sql/backup/kernel.cc
sql/handler.h
sql/mysql_priv.h
sql/si_objects.cc
sql/si_objects.h
sql/sql_show.cc
storage/falcon/BDB.cpp
storage/falcon/BDB.h
storage/falcon/CMakeLists.txt
storage/falcon/Cache.cpp
storage/falcon/Cache.h
storage/falcon/Configuration.cpp
storage/falcon/Database.cpp
storage/falcon/Database.h
storage/falcon/DeferredIndex.cpp
storage/falcon/DeferredIndexWalker.cpp
storage/falcon/Error.cpp
storage/falcon/IO.cpp
storage/falcon/IOx.h
storage/falcon/InfoTable.cpp
storage/falcon/InfoTable.h
storage/falcon/Makefile.am
storage/falcon/RecordVersion.cpp
storage/falcon/RecoveryObjects.cpp
storage/falcon/SQLException.h
storage/falcon/SRLUpdateRecords.cpp
storage/falcon/SerialLog.cpp
storage/falcon/SerialLog.h
storage/falcon/SerialLogFile.cpp
storage/falcon/SerialLogFile.h
storage/falcon/Statement.cpp
storage/falcon/StorageHandler.cpp
storage/falcon/StorageHandler.h
storage/falcon/StorageTable.cpp
storage/falcon/StorageTableShare.cpp
storage/falcon/StorageTableShare.h
storage/falcon/SyncObject.cpp
storage/falcon/SyncObject.h
storage/falcon/Table.cpp
storage/falcon/TableSpaceManager.cpp
storage/falcon/Transaction.cpp
storage/falcon/Transaction.h
storage/falcon/ha_falcon.cpp
storage/falcon/ha_falcon.h
storage/maria/CMakeLists.txt
mysql-test/suite/falcon/r/falcon_bug_22189.result
mysql-test/suite/falcon/r/falcon_bug_22207.result
mysql-test/suite/falcon/r/falcon_bug_24024.result
mysql-test/suite/falcon/t/falcon_bug_22189.test
mysql-test/suite/falcon/t/falcon_bug_22207.test
mysql-test/suite/falcon/t/falcon_bug_24024.test
=== modified file 'configure.in'
--- a/configure.in 2008-09-11 18:36:05 +0000
+++ b/configure.in 2008-09-23 10:37:16 +0000
@@ -1,12 +1,13 @@
dnl -*- ksh -*-
dnl Process this file with autoconf to produce a configure script.
-AC_PREREQ(2.52)dnl Minimum Autoconf version required.
+# Minimum Autoconf version required.
+AC_PREREQ(2.52)
AC_INIT(sql/mysqld.cc)
AC_CANONICAL_SYSTEM
# The Docs Makefile.am parses this line!
-# remember to also update version.c in ndb
+# remember to also update version.c in ndb.
# When changing major version number please also check switch statement
# in mysqlbinlog::check_master_version().
AM_INIT_AUTOMAKE(mysql, 6.0.8-alpha)
=== added file 'mysql-test/r/backup_commit_backup.result'
--- a/mysql-test/r/backup_commit_backup.result 1970-01-01 00:00:00 +0000
+++ b/mysql-test/r/backup_commit_backup.result 2008-09-12 17:19:02 +0000
@@ -0,0 +1,324 @@
+DROP DATABASE IF EXISTS db1;
+DROP DATABASE IF EXISTS db2;
+CREATE DATABASE db1;
+CREATE DATABASE db2;
+CREATE TABLE db1.t1 (s1 CHAR(3)) ENGINE=innodb;
+CREATE TABLE db1.t2 (s1 CHAR(3)) ENGINE=falcon;
+CREATE TABLE db1.t3 (s1 CHAR(3)) ENGINE=memory;
+CREATE TABLE db1.t4 (s1 CHAR(3)) ENGINE=myisam;
+CREATE TABLE db2.t1 (s1 CHAR(3)) ENGINE=innodb;
+CREATE TABLE db2.t2 (s1 CHAR(3)) ENGINE=falcon;
+CREATE TABLE db2.t3 (s1 CHAR(3)) ENGINE=myisam;
+connection B - starting transaction B
+SET autocommit=0;
+BEGIN;
+SELECT get_lock("sync",10);
+get_lock("sync",10)
+1
+INSERT INTO db1.t1 VALUES ('b1');
+INSERT INTO db1.t2 VALUES ('b1');
+INSERT INTO db1.t3 VALUES ('b1');
+INSERT INTO db1.t4 VALUES ('b1');
+INSERT INTO db2.t1 VALUES ('b1');
+INSERT INTO db2.t2 VALUES ('b1');
+INSERT INTO db2.t3 VALUES ('b1');
+SELECT release_lock("sync");
+release_lock("sync")
+1
+SELECT get_lock("sync",10);
+get_lock("sync",10)
+1
+SELECT * FROM db1.t1;
+s1
+SELECT * FROM db1.t2;
+s1
+SELECT * FROM db1.t3;
+s1
+b1
+SELECT * FROM db1.t4;
+s1
+b1
+SELECT * FROM db2.t1;
+s1
+SELECT * FROM db2.t2;
+s1
+SELECT * FROM db2.t3;
+s1
+b1
+SELECT release_lock("sync");
+release_lock("sync")
+1
+connection A - starting transaction A
+SET autocommit=0;
+BEGIN;
+SELECT get_lock("sync",10);
+get_lock("sync",10)
+1
+INSERT INTO db1.t1 VALUES ('a1');
+INSERT INTO db1.t2 VALUES ('a1');
+INSERT INTO db1.t3 VALUES ('a1');
+INSERT INTO db1.t4 VALUES ('a1');
+INSERT INTO db2.t1 VALUES ('a1');
+INSERT INTO db2.t2 VALUES ('a1');
+INSERT INTO db2.t3 VALUES ('a1');
+SELECT release_lock("sync");
+release_lock("sync")
+1
+SELECT get_lock("sync",10);
+get_lock("sync",10)
+1
+SELECT * FROM db1.t1;
+s1
+SELECT * FROM db1.t2;
+s1
+SELECT * FROM db1.t3;
+s1
+b1
+a1
+SELECT * FROM db1.t4;
+s1
+b1
+a1
+SELECT * FROM db2.t1;
+s1
+SELECT * FROM db2.t2;
+s1
+SELECT * FROM db2.t3;
+s1
+b1
+a1
+SELECT release_lock("sync");
+release_lock("sync")
+1
+connection B - performing BACKUP which commits transaction B
+SELECT get_lock("sync",10);
+get_lock("sync",10)
+1
+INSERT INTO db1.t1 VALUES ('b2');
+INSERT INTO db1.t2 VALUES ('b2');
+INSERT INTO db1.t3 VALUES ('b2');
+INSERT INTO db1.t4 VALUES ('b2');
+INSERT INTO db2.t1 VALUES ('b2');
+INSERT INTO db2.t2 VALUES ('b2');
+INSERT INTO db2.t3 VALUES ('b2');
+BACKUP DATABASE db1 TO 'db1.bak';
+backup_id
+#
+SELECT release_lock("sync");
+release_lock("sync")
+1
+SELECT get_lock("sync",10);
+get_lock("sync",10)
+1
+SELECT * FROM db1.t1;
+s1
+b1
+b2
+SELECT * FROM db1.t2;
+s1
+b1
+b2
+SELECT * FROM db1.t3;
+s1
+b1
+a1
+b2
+SELECT * FROM db1.t4;
+s1
+b1
+a1
+b2
+SELECT * FROM db2.t1;
+s1
+b1
+b2
+SELECT * FROM db2.t2;
+s1
+b1
+b2
+SELECT * FROM db2.t3;
+s1
+b1
+a1
+b2
+SELECT release_lock("sync");
+release_lock("sync")
+1
+connection B - doing ROLLBACK which should be a no-op after the implicit commit
+SELECT get_lock("sync",10);
+get_lock("sync",10)
+1
+ROLLBACK;
+SELECT release_lock("sync");
+release_lock("sync")
+1
+SELECT get_lock("sync",10);
+get_lock("sync",10)
+1
+SELECT * FROM db1.t1;
+s1
+b1
+b2
+SELECT * FROM db1.t2;
+s1
+b1
+b2
+SELECT * FROM db1.t3;
+s1
+b1
+a1
+b2
+SELECT * FROM db1.t4;
+s1
+b1
+a1
+b2
+SELECT * FROM db2.t1;
+s1
+b1
+b2
+SELECT * FROM db2.t2;
+s1
+b1
+b2
+SELECT * FROM db2.t3;
+s1
+b1
+a1
+b2
+SELECT release_lock("sync");
+release_lock("sync")
+1
+connection A - finishing transaction A
+SELECT get_lock("sync",10);
+get_lock("sync",10)
+1
+INSERT INTO db1.t1 VALUES ('a2');
+INSERT INTO db1.t2 VALUES ('a2');
+INSERT INTO db1.t3 VALUES ('a2');
+INSERT INTO db1.t4 VALUES ('a2');
+INSERT INTO db2.t1 VALUES ('a2');
+INSERT INTO db2.t2 VALUES ('a2');
+INSERT INTO db2.t3 VALUES ('a2');
+SELECT release_lock("sync");
+release_lock("sync")
+1
+SELECT get_lock("sync",10);
+get_lock("sync",10)
+1
+SELECT * FROM db1.t1;
+s1
+b1
+b2
+SELECT * FROM db1.t2;
+s1
+b1
+b2
+SELECT * FROM db1.t3;
+s1
+b1
+a1
+b2
+a2
+SELECT * FROM db1.t4;
+s1
+b1
+a1
+b2
+a2
+SELECT * FROM db2.t1;
+s1
+b1
+b2
+SELECT * FROM db2.t2;
+s1
+b1
+b2
+SELECT * FROM db2.t3;
+s1
+b1
+a1
+b2
+a2
+SELECT release_lock("sync");
+release_lock("sync")
+1
+SELECT get_lock("sync",10);
+get_lock("sync",10)
+1
+COMMIT;
+SELECT release_lock("sync");
+release_lock("sync")
+1
+SELECT get_lock("sync",10);
+get_lock("sync",10)
+1
+SELECT * FROM db1.t1;
+s1
+b1
+a1
+b2
+a2
+SELECT * FROM db1.t2;
+s1
+b1
+a1
+b2
+a2
+SELECT * FROM db1.t3;
+s1
+b1
+a1
+b2
+a2
+SELECT * FROM db1.t4;
+s1
+b1
+a1
+b2
+a2
+SELECT * FROM db2.t1;
+s1
+b1
+a1
+b2
+a2
+SELECT * FROM db2.t2;
+s1
+b1
+a1
+b2
+a2
+SELECT * FROM db2.t3;
+s1
+b1
+a1
+b2
+a2
+SELECT release_lock("sync");
+release_lock("sync")
+1
+Checking contents of the backup image
+RESTORE FROM 'db1.bak';
+backup_id
+#
+SELECT * FROM db1.t1;
+s1
+b1
+b2
+SELECT * FROM db1.t2;
+s1
+b1
+b2
+SELECT * FROM db1.t3;
+s1
+b1
+a1
+b2
+SELECT * FROM db1.t4;
+s1
+b1
+a1
+b2
+DROP DATABASE db1;
+DROP DATABASE db2;
=== added file 'mysql-test/t/backup_commit_backup.test'
--- a/mysql-test/t/backup_commit_backup.test 1970-01-01 00:00:00 +0000
+++ b/mysql-test/t/backup_commit_backup.test 2008-09-12 17:19:02 +0000
@@ -0,0 +1,230 @@
+#
+# This test tests interraction of BACKUP command with transactions in
+# the same and different connection (BUG#38261)
+#
+# BACKUP should commit ongoing transaction in the same connection but
+# should not interferre with transactions executing in other connections.
+#
+
+--source include/not_embedded.inc
+--source include/have_innodb.inc
+--source include/have_falcon.inc
+
+
+LET $BDIR=`select @@backupdir`;
+
+disable_warnings;
+DROP DATABASE IF EXISTS db1;
+DROP DATABASE IF EXISTS db2;
+error 0,1;
+remove_file $BDIR/db1.bak;
+enable_warnings;
+
+CREATE DATABASE db1;
+CREATE DATABASE db2;
+
+CREATE TABLE db1.t1 (s1 CHAR(3)) ENGINE=innodb; # CS driver
+CREATE TABLE db1.t2 (s1 CHAR(3)) ENGINE=falcon; # CS driver
+CREATE TABLE db1.t3 (s1 CHAR(3)) ENGINE=memory; # default driver
+CREATE TABLE db1.t4 (s1 CHAR(3)) ENGINE=myisam; # native driver
+
+CREATE TABLE db2.t1 (s1 CHAR(3)) ENGINE=innodb; # trx1
+CREATE TABLE db2.t2 (s1 CHAR(3)) ENGINE=falcon; # trx2
+CREATE TABLE db2.t3 (s1 CHAR(3)) ENGINE=myisam; # non-trx
+
+
+# Create test connections. The setup is as follows
+#
+# connA connB
+# ----- -----
+# BEGIN
+# insert data
+# BEGIN
+# insert data
+# insert data
+# BACKUP
+# ROLLBACK
+# insert data
+# COMMIT
+#
+# The default connection is used to check contents of the tables after each
+# operation.
+#
+# Note: we use "sync" lock to synchronize connections. Without it, data
+# inserted in one thread could be not always seen in another one, which would
+# made test non-deterministic.
+
+ connect(connA, localhost, root,,);
+ connect(connB, localhost, root,,);
+
+ connection connB;
+ echo connection B - starting transaction B;
+ #------------------
+ SET autocommit=0;
+ BEGIN;
+
+ SELECT get_lock("sync",10);
+ INSERT INTO db1.t1 VALUES ('b1');
+ INSERT INTO db1.t2 VALUES ('b1');
+ INSERT INTO db1.t3 VALUES ('b1');
+ INSERT INTO db1.t4 VALUES ('b1');
+
+ INSERT INTO db2.t1 VALUES ('b1');
+ INSERT INTO db2.t2 VALUES ('b1');
+ INSERT INTO db2.t3 VALUES ('b1');
+ SELECT release_lock("sync");
+
+connection default;
+#------------------
+SELECT get_lock("sync",10);
+SELECT * FROM db1.t1;
+SELECT * FROM db1.t2;
+SELECT * FROM db1.t3;
+SELECT * FROM db1.t4;
+
+SELECT * FROM db2.t1;
+SELECT * FROM db2.t2;
+SELECT * FROM db2.t3;
+SELECT release_lock("sync");
+
+ connection connA;
+ echo connection A - starting transaction A;
+ #------------------
+ SET autocommit=0;
+ BEGIN;
+
+ SELECT get_lock("sync",10);
+ INSERT INTO db1.t1 VALUES ('a1');
+ INSERT INTO db1.t2 VALUES ('a1');
+ INSERT INTO db1.t3 VALUES ('a1');
+ INSERT INTO db1.t4 VALUES ('a1');
+
+ INSERT INTO db2.t1 VALUES ('a1');
+ INSERT INTO db2.t2 VALUES ('a1');
+ INSERT INTO db2.t3 VALUES ('a1');
+ SELECT release_lock("sync");
+
+connection default;
+#------------------
+SELECT get_lock("sync",10);
+SELECT * FROM db1.t1;
+SELECT * FROM db1.t2;
+SELECT * FROM db1.t3;
+SELECT * FROM db1.t4;
+
+SELECT * FROM db2.t1;
+SELECT * FROM db2.t2;
+SELECT * FROM db2.t3;
+SELECT release_lock("sync");
+
+ connection connB;
+ echo connection B - performing BACKUP which commits transaction B;
+ #------------------
+ SELECT get_lock("sync",10);
+ INSERT INTO db1.t1 VALUES ('b2');
+ INSERT INTO db1.t2 VALUES ('b2');
+ INSERT INTO db1.t3 VALUES ('b2');
+ INSERT INTO db1.t4 VALUES ('b2');
+
+ INSERT INTO db2.t1 VALUES ('b2');
+ INSERT INTO db2.t2 VALUES ('b2');
+ INSERT INTO db2.t3 VALUES ('b2');
+
+ replace_column 1 #;
+ BACKUP DATABASE db1 TO 'db1.bak';
+ SELECT release_lock("sync");
+
+connection default;
+#------------------
+SELECT get_lock("sync",10);
+SELECT * FROM db1.t1;
+SELECT * FROM db1.t2;
+SELECT * FROM db1.t3;
+SELECT * FROM db1.t4;
+
+SELECT * FROM db2.t1;
+SELECT * FROM db2.t2;
+SELECT * FROM db2.t3;
+SELECT release_lock("sync");
+
+ connection connB;
+ echo connection B - doing ROLLBACK which should be a no-op after the implicit commit;
+ #------------------
+ SELECT get_lock("sync",10);
+ ROLLBACK;
+ SELECT release_lock("sync");
+
+connection default;
+#------------------
+SELECT get_lock("sync",10);
+SELECT * FROM db1.t1;
+SELECT * FROM db1.t2;
+SELECT * FROM db1.t3;
+SELECT * FROM db1.t4;
+
+SELECT * FROM db2.t1;
+SELECT * FROM db2.t2;
+SELECT * FROM db2.t3;
+SELECT release_lock("sync");
+
+ connection connA;
+ echo connection A - finishing transaction A;
+ #------------------
+ SELECT get_lock("sync",10);
+ INSERT INTO db1.t1 VALUES ('a2');
+ INSERT INTO db1.t2 VALUES ('a2');
+ INSERT INTO db1.t3 VALUES ('a2');
+ INSERT INTO db1.t4 VALUES ('a2');
+
+ INSERT INTO db2.t1 VALUES ('a2');
+ INSERT INTO db2.t2 VALUES ('a2');
+ INSERT INTO db2.t3 VALUES ('a2');
+ SELECT release_lock("sync");
+
+connection default;
+#------------------
+SELECT get_lock("sync",10);
+SELECT * FROM db1.t1;
+SELECT * FROM db1.t2;
+SELECT * FROM db1.t3;
+SELECT * FROM db1.t4;
+
+SELECT * FROM db2.t1;
+SELECT * FROM db2.t2;
+SELECT * FROM db2.t3;
+SELECT release_lock("sync");
+
+ connection connA;
+ #------------------
+ SELECT get_lock("sync",10);
+ COMMIT;
+ SELECT release_lock("sync");
+
+connection default;
+#------------------
+SELECT get_lock("sync",10);
+SELECT * FROM db1.t1;
+SELECT * FROM db1.t2;
+SELECT * FROM db1.t3;
+SELECT * FROM db1.t4;
+
+SELECT * FROM db2.t1;
+SELECT * FROM db2.t2;
+SELECT * FROM db2.t3;
+SELECT release_lock("sync");
+
+echo Checking contents of the backup image;
+
+replace_column 1 #;
+RESTORE FROM 'db1.bak';
+
+SELECT * FROM db1.t1;
+SELECT * FROM db1.t2;
+SELECT * FROM db1.t3;
+SELECT * FROM db1.t4;
+
+# Cleanup
+
+DROP DATABASE db1;
+DROP DATABASE db2;
+remove_file $BDIR/db1.bak;
=== modified file 'sql/backup/kernel.cc'
--- a/sql/backup/kernel.cc 2008-09-19 09:55:21 +0000
+++ b/sql/backup/kernel.cc 2008-09-26 15:47:35 +0000
@@ -126,6 +126,10 @@ static int send_reply(Backup_restore_ctx
@note This function sends response to the client (ok, result set or error).
+ @note Both BACKUP and RESTORE should perform implicit commit at the beginning
+ and at the end of execution. This is done by the parser after marking these
+ commands with appropriate flags in @c sql_command_flags[] in sql_parse.cc.
+
@returns 0 on success, error code otherwise.
*/
@@ -791,17 +795,6 @@ int Backup_restore_ctx::close()
time_t when= my_time(0);
- // If auto commit is turned off, be sure to commit the transaction
- /*
- Note: this code needs to be refactored (see BUG#38261). When refactoring
- make sure that errors are detected and reported.
- */
- if (m_thd->options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN))
- {
- trans_commit_stmt(m_thd);
- trans_commit_implicit(m_thd);
- }
-
// unlock tables if they are still locked
// FIXME: detect errors if reported.
=== modified file 'sql/log.cc'
--- a/sql/log.cc 2008-09-11 18:21:54 +0000
+++ b/sql/log.cc 2008-09-18 17:55:53 +0000
@@ -3338,6 +3338,8 @@ bool MYSQL_BACKUP_LOG::write(THD *thd, s
goto err;
if (write_str(user))
goto err;
+ if (write_str(history_data->backup_file))
+ goto err;
if (write_str(history_data->user_comment))
goto err;
if (write_str(history_data->command))
| Thread |
|---|
| • bzr push into mysql-6.0 branch (oystein.grovlen:2690 to 2692) | Oystein.Grovlen | 29 Sep |