List:Commits« Previous MessageNext Message »
From:msvensson Date:July 24 2006 11:10am
Subject:bk commit into 5.0 tree (msvensson:1.2239) BUG#21215
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of msvensson. When msvensson 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, 2006-07-24 13:10:24+02:00, msvensson@neptunus.(none) +3 -0
  Bug#21215  mysqldump creating incomplete backups without warning
   - Add call to 'safe_exit' function when db query fails.

  client/mysqldump.c@stripped, 2006-07-24 13:10:22+02:00, msvensson@neptunus.(none) +1 -0
    Add a call to 'safe_exit' to remember the error code and exit unless --force was give.n

  mysql-test/r/mysqldump.result@stripped, 2006-07-24 13:10:22+02:00, msvensson@neptunus.(none) +16 -0
    Add test result

  mysql-test/t/mysqldump.test@stripped, 2006-07-24 13:10:22+02:00, msvensson@neptunus.(none) +40 -0
    Add test case

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	msvensson
# Host:	neptunus.(none)
# Root:	/home/msvensson/mysql/my50-m-bug21215

--- 1.239/client/mysqldump.c	2006-07-24 13:10:29 +02:00
+++ 1.240/client/mysqldump.c	2006-07-24 13:10:29 +02:00
@@ -872,6 +872,7 @@ static int mysql_query_with_error_report
   {
     my_printf_error(0, "Couldn't execute '%s': %s (%d)", MYF(0),
                     query, mysql_error(mysql_con), mysql_errno(mysql_con));
+    safe_exit(EX_MYSQLERR);
     return 1;
   }
   return 0;

--- 1.103/mysql-test/r/mysqldump.result	2006-07-24 13:10:29 +02:00
+++ 1.104/mysql-test/r/mysqldump.result	2006-07-24 13:10:29 +02:00
@@ -2867,3 +2867,19 @@ drop view nasishnasifu;
 drop database mysqldump_views;
 drop table mysqldump_tables.basetable;
 drop database mysqldump_tables;
+use test;
+create user mysqltest_1;
+create table t1(a int, b varchar(34));
+mysqldump: Couldn't execute 'FLUSH TABLES': Access denied; you need the RELOAD privilege for this operation (1227)
+mysqldump: Couldn't execute 'FLUSH TABLES': Access denied; you need the RELOAD privilege for this operation (1227)
+grant RELOAD on *.* to mysqltest_1@localhost;
+mysqldump: Couldn't execute 'SHOW MASTER STATUS': Access denied; you need the SUPER,REPLICATION CLIENT privilege for this operation (1227)
+mysqldump: Couldn't execute 'SHOW MASTER STATUS': Access denied; you need the SUPER,REPLICATION CLIENT privilege for this operation (1227)
+grant REPLICATION CLIENT on *.* to mysqltest_1@localhost;
+CHANGE MASTER TO MASTER_LOG_FILE='master-bin.000003', MASTER_LOG_POS=3784;
+CREATE TABLE `t1` (
+  `a` int(11) default NULL,
+  `b` varchar(34) default NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1;
+drop table t1;
+drop user mysqltest_1;

--- 1.96/mysql-test/t/mysqldump.test	2006-07-24 13:10:29 +02:00
+++ 1.97/mysql-test/t/mysqldump.test	2006-07-24 13:10:29 +02:00
@@ -1228,3 +1228,43 @@ drop view nasishnasifu;
 drop database mysqldump_views;
 drop table mysqldump_tables.basetable;
 drop database mysqldump_tables;
+
+#
+# Bug#21215 mysqldump creating incomplete backups without warning
+#
+use test;
+
+# Create user without sufficient privs to perform the requested operation
+create user mysqltest_1;
+create table t1(a int, b varchar(34));
+
+# Execute mysqldump, will fail on FLUSH TABLES
+--error 2
+--exec $MYSQL_DUMP --compact --master-data -u mysqltest_1 test 2>&1
+
+# Execute mysqldump, will fail on FLUSH TABLES
+# use --force, should no affect behaviour
+--error 2
+--exec $MYSQL_DUMP --compact --force --master-data -u mysqltest_1 test 2>&1
+
+# Add RELOAD grants
+grant RELOAD on *.* to mysqltest_1@localhost;
+
+# Execute mysqldump, will fail on SHOW MASTER STATUS
+--error 2
+--exec $MYSQL_DUMP --compact --master-data -u mysqltest_1 test 2>&1
+
+# Execute mysqldump, will fail on SHOW MASTER STATUS.
+# use --force, should not alter behaviour
+--error 2
+--exec $MYSQL_DUMP --compact --force --master-data -u mysqltest_1 test 2>&1
+
+# Add REPLICATION CLIENT grants
+grant REPLICATION CLIENT on *.* to mysqltest_1@localhost;
+
+# Execute mysqldump, should now succeed
+--exec $MYSQL_DUMP --compact --master-data -u mysqltest_1 test 2>&1
+
+# Clean up
+drop table t1;
+drop user mysqltest_1;
Thread
bk commit into 5.0 tree (msvensson:1.2239) BUG#21215msvensson24 Jul