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
a22ae736
Commit
a22ae736
authored
Apr 30, 2007
by
tnurnberg@maint1.mysql.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge tnurnberg@bk-internal.mysql.com:/home/bk/mysql-5.0-maint
into maint1.mysql.com:/data/localhome/tnurnberg/50-27293
parents
3bed4639
ce1074f6
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
72 additions
and
3 deletions
+72
-3
client/mysqldump.c
client/mysqldump.c
+10
-3
mysql-test/r/mysqldump.result
mysql-test/r/mysqldump.result
+27
-0
mysql-test/t/mysqldump.test
mysql-test/t/mysqldump.test
+35
-0
No files found.
client/mysqldump.c
View file @
a22ae736
...
...
@@ -1489,8 +1489,15 @@ static uint dump_routines_for_db(char *db)
routine body of other routines that are not the creator of!
*/
DBUG_PRINT
(
"info"
,(
"length of body for %s row[2] '%s' is %d"
,
routine_name
,
row
[
2
],
(
int
)
strlen
(
row
[
2
])));
if
(
strlen
(
row
[
2
]))
routine_name
,
row
[
2
]
?
row
[
2
]
:
"(null)"
,
row
[
2
]
?
(
int
)
strlen
(
row
[
2
])
:
0
));
if
(
row
[
2
]
==
NULL
)
{
fprintf
(
sql_file
,
"
\n
-- insufficient privileges to %s
\n
"
,
query_buff
);
fprintf
(
sql_file
,
"-- does %s have permissions on mysql.proc?
\n\n
"
,
current_user
);
maybe_die
(
EX_MYSQLERR
,
"%s has insufficent privileges to %s!"
,
current_user
,
query_buff
);
}
else
if
(
strlen
(
row
[
2
]))
{
char
*
query_str
=
NULL
;
char
*
definer_begin
;
...
...
@@ -1540,7 +1547,7 @@ static uint dump_routines_for_db(char *db)
/*
we need to change sql_mode only for the CREATE
PROCEDURE/FUNCTION otherwise we may need to re-quote routine_name
*/
;
*/
fprintf
(
sql_file
,
"/*!50003 SET SESSION SQL_MODE=
\"
%s
\"
*/;;
\n
"
,
row
[
1
]
/* sql_mode */
);
fprintf
(
sql_file
,
"/*!50003 %s */;;
\n
"
,
...
...
mysql-test/r/mysqldump.result
View file @
a22ae736
...
...
@@ -3282,6 +3282,33 @@ v3 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VI
drop database bug23491_original;
drop database bug23491_restore;
use test;
#
# Bug 27293: mysqldump crashes when dumping routines
# defined by a different user
#
# Bug #22761: mysqldump reports no errors when using
# --routines without mysql.proc privileges
#
create database mysqldump_test_db;
grant all privileges on mysqldump_test_db.* to user1;
grant all privileges on mysqldump_test_db.* to user2;
create procedure mysqldump_test_db.sp1() select 'hello';
DELIMITER ;;
-- insufficient privileges to SHOW CREATE PROCEDURE `sp1`
-- does user2 have permissions on mysql.proc?
DELIMITER ;
DELIMITER ;;
/*!50003 SET SESSION SQL_MODE=""*/;;
/*!50003 CREATE*/ /*!50020 DEFINER=`user1`@`%`*/ /*!50003 PROCEDURE `sp1`()
select 'hello' */;;
/*!50003 SET SESSION SQL_MODE=@OLD_SQL_MODE*/;;
DELIMITER ;
drop procedure sp1;
drop user user1;
drop user user2;
drop database mysqldump_test_db;
#
# End of 5.0 tests
#
mysql-test/t/mysqldump.test
View file @
a22ae736
...
...
@@ -1495,6 +1495,41 @@ drop database bug23491_original;
drop
database
bug23491_restore
;
use
test
;
--
echo
#
--
echo
# Bug 27293: mysqldump crashes when dumping routines
--
echo
# defined by a different user
--
echo
#
--
echo
# Bug #22761: mysqldump reports no errors when using
--
echo
# --routines without mysql.proc privileges
--
echo
#
create
database
mysqldump_test_db
;
grant
all
privileges
on
mysqldump_test_db
.*
to
user1
;
grant
all
privileges
on
mysqldump_test_db
.*
to
user2
;
connect
(
user27293
,
localhost
,
user1
,,
mysqldump_test_db
,
$MASTER_MYPORT
,
$MASTER_MYSOCK
);
connection
user27293
;
create
procedure
mysqldump_test_db
.
sp1
()
select
'hello'
;
--
error
2
--
exec
$MYSQL_DUMP
-
f
--
compact
--
user
=
user2
--
password
=
-
h
127.0
.
0.1
-
P
$MASTER_MYPORT
--
routines
mysqldump_test_db
--
exec
$MYSQL_DUMP
-
f
--
compact
--
user
=
user1
--
password
=
-
h
127.0
.
0.1
-
P
$MASTER_MYPORT
--
routines
mysqldump_test_db
drop
procedure
sp1
;
connection
default
;
drop
user
user1
;
drop
user
user2
;
drop
database
mysqldump_test_db
;
--
echo
#
--
echo
# End of 5.0 tests
--
echo
#
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