mirror of
https://github.com/MariaDB/server.git
synced 2025-12-24 11:21:21 +03:00
Bug#21215 mysqldump creating incomplete backups without warning
- Add call to 'safe_exit' function when db query fails. client/mysqldump.c: Add a call to 'safe_exit' to remember the error code and exit unless --force was give.n mysql-test/r/mysqldump.result: Add test result mysql-test/t/mysqldump.test: Add test case
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user