Below is the list of changes that have just been committed into a local
5.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-04-30 09:40:22+02:00, tnurnberg@stripped +3 -0
Merge mysql.com:/home/tnurnberg/27293/50-27293
into mysql.com:/home/tnurnberg/27293/51-27293
MERGE: 1.1810.2372.145
client/mysqldump.c@stripped, 2007-04-30 09:40:17+02:00, tnurnberg@stripped +1 -0
manual merge
MERGE: 1.214.1.44
mysql-test/r/mysqldump.result@stripped, 2007-04-30 09:40:17+02:00,
tnurnberg@stripped +5 -29
manual merge
MERGE: 1.83.1.37
mysql-test/t/mysqldump.test@stripped, 2007-04-30 09:28:19+02:00,
tnurnberg@stripped +0 -0
Auto merged
MERGE: 1.76.1.35
# 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: tnurnberg
# Host: blasphemy.mysql.com
# Root: /home/tnurnberg/27293/51-27293/RESYNC
--- 1.268/client/mysqldump.c 2007-02-23 12:23:36 +01:00
+++ 1.269/client/mysqldump.c 2007-04-30 09:40:17 +02:00
@@ -1569,9 +1569,16 @@ static uint dump_routines_for_db(char *d
if the user has EXECUTE privilege he see routine names, but NOT the
routine body of other routines that are not the creator of!
*/
- DBUG_PRINT("info",("length of body for %s row[2] '%s' is %ld",
- routine_name, row[2], (long) strlen(row[2])));
- if (strlen(row[2]))
+ DBUG_PRINT("info",("length of body for %s row[2] '%s' is %d",
+ 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);
+ safe_exit(EX_MYSQLERR);
+ }
+ else if (strlen(row[2]))
{
char *query_str= NULL;
char *definer_begin;
@@ -1621,7 +1628,7 @@ static uint dump_routines_for_db(char *d
/*
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",
--- 1.137/mysql-test/r/mysqldump.result 2006-12-08 23:52:14 +01:00
+++ 1.138/mysql-test/r/mysqldump.result 2007-04-30 09:40:17 +02:00
@@ -3216,9 +3216,12 @@ INSERT INTO t1 VALUES(1,0xff00fef0);
</database>
</mysqldump>
DROP TABLE t1;
+#
+# Bug 27293: mysqldump crashes when dumping routines
+# defined by a different user
#
-# End of 5.0 tests
-#
+# Bug #22761: mysqldump reports no errors when using
+# --routines without mysql.proc privileges
drop table if exists t1;
CREATE TABLE t1(a int, b int);
INSERT INTO t1 VALUES (1,1);
--- 1.130/mysql-test/t/mysqldump.test 2007-02-19 20:30:58 +01:00
+++ 1.131/mysql-test/t/mysqldump.test 2007-04-30 09:28:19 +02:00
@@ -1431,6 +1431,42 @@ INSERT INTO t1 VALUES(1,0xff00fef0);
DROP TABLE t1;
+
+
+
+--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 #
| Thread |
|---|
| • bk commit into 5.1 tree (tnurnberg:1.2458) | Tatjana A Nuernberg | 30 Apr |