Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
c84cdbf4
Commit
c84cdbf4
authored
Jul 24, 2006
by
msvensson@neptunus.(none)
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug#21215 mysqldump creating incomplete backups without warning
- Add call to 'safe_exit' function when db query fails.
parent
9f78d779
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
57 additions
and
0 deletions
+57
-0
client/mysqldump.c
client/mysqldump.c
+1
-0
mysql-test/r/mysqldump.result
mysql-test/r/mysqldump.result
+16
-0
mysql-test/t/mysqldump.test
mysql-test/t/mysqldump.test
+40
-0
No files found.
client/mysqldump.c
View file @
c84cdbf4
...
@@ -872,6 +872,7 @@ static int mysql_query_with_error_report(MYSQL *mysql_con, MYSQL_RES **res,
...
@@ -872,6 +872,7 @@ static int mysql_query_with_error_report(MYSQL *mysql_con, MYSQL_RES **res,
{
{
my_printf_error
(
0
,
"Couldn't execute '%s': %s (%d)"
,
MYF
(
0
),
my_printf_error
(
0
,
"Couldn't execute '%s': %s (%d)"
,
MYF
(
0
),
query
,
mysql_error
(
mysql_con
),
mysql_errno
(
mysql_con
));
query
,
mysql_error
(
mysql_con
),
mysql_errno
(
mysql_con
));
safe_exit
(
EX_MYSQLERR
);
return
1
;
return
1
;
}
}
return
0
;
return
0
;
...
...
mysql-test/r/mysqldump.result
View file @
c84cdbf4
...
@@ -2867,3 +2867,19 @@ drop view nasishnasifu;
...
@@ -2867,3 +2867,19 @@ drop view nasishnasifu;
drop database mysqldump_views;
drop database mysqldump_views;
drop table mysqldump_tables.basetable;
drop table mysqldump_tables.basetable;
drop database mysqldump_tables;
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;
mysql-test/t/mysqldump.test
View file @
c84cdbf4
...
@@ -1228,3 +1228,43 @@ drop view nasishnasifu;
...
@@ -1228,3 +1228,43 @@ drop view nasishnasifu;
drop
database
mysqldump_views
;
drop
database
mysqldump_views
;
drop
table
mysqldump_tables
.
basetable
;
drop
table
mysqldump_tables
.
basetable
;
drop
database
mysqldump_tables
;
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
;
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment