List:Commits« Previous MessageNext Message »
From:Tatjana A Nuernberg Date:October 4 2007 8:27am
Subject:bk commit into 4.1 tree (tnurnberg:1.2675) BUG#30444
View as plain text  
Below is the list of changes that have just been committed into a local
4.1 repository of tnurnberg. When tnurnberg 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, 2007-10-04 08:27:03+02:00, tnurnberg@stripped +1 -0
  Bug #30444: 5.0 mysqldump silently allows wrong backup to be taken against a 4.0
database
  
  The combination of --single-transaction and --master-data requires
  START TRANSACTION WITH CONSISTENT SNAPSHOT which is available from
  mysqld 4.1 on. When trying this against an older server, print
  diagnostic, then, if --force is not given, abort.
  
  No test-case given since it would require a mysqld < 4.1.

  client/mysqldump.c@stripped, 2007-10-04 08:27:01+02:00, tnurnberg@stripped
+12 -0
    Bug #30444: 5.0 mysqldump silently allows wrong backup to be taken against a 4.0
database
    
    The combination of --single-transaction and --master-data requires
    START TRANSACTION WITH CONSISTENT SNAPSHOT which is available from
    mysqld 4.1 on. When trying this against an older server, print
    diagnostic, then, if --force is not given, abort.

diff -Nrup a/client/mysqldump.c b/client/mysqldump.c
--- a/client/mysqldump.c	2006-11-21 08:09:30 +01:00
+++ b/client/mysqldump.c	2007-10-04 08:27:01 +02:00
@@ -2428,6 +2428,18 @@ static int start_transaction(MYSQL *mysq
     need the REPEATABLE READ level (not anything lower, for example READ
     COMMITTED would give one new consistent read per dumped table).
   */
+  if ((mysql_get_server_version(mysql_con) < 40100) && opt_master_data)
+  {
+    fprintf(stderr, "-- %s: the combination of --single-transaction and "
+            "--master-data requires a MySQL server version of at least 4.1 "
+            "(current server's version is %s). %s\n",
+            ignore_errors ? "Warning" : "Error",
+            mysql_con->server_version ? mysql_con->server_version : "unknown",
+            ignore_errors ? "Continuing due to --force, backup may not be consistent
across all tables!" : "Aborting.");
+    if (!ignore_errors)
+      exit(EX_MYSQLERR);
+  }
+
   return (mysql_query_with_error_report(mysql_con, 0,
                                         "SET SESSION TRANSACTION ISOLATION "
                                         "LEVEL REPEATABLE READ") ||
Thread
bk commit into 4.1 tree (tnurnberg:1.2675) BUG#30444Tatjana A Nuernberg4 Oct