Below is the list of changes that have just been committed into a local
5.0 repository of serg. When serg 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-03-23 17:56:58+02:00, serg@stripped +4 -0
Merge sergbook.mysql.com:/usr/home/serg/Abk/mysql-5.0-build
into sergbook.mysql.com:/usr/home/serg/Abk/mysql-5.0
MERGE: 1.2392.104.3
client/mysqlbinlog.cc@stripped, 2007-03-23 17:38:54+02:00, serg@stripped +0 -0
Auto merged
MERGE: 1.135.1.1
mysql-test/r/view_grant.result@stripped, 2007-03-23 17:56:41+02:00, serg@stripped +0 -0
merged
MERGE: 1.22.1.1
mysql-test/t/view_grant.test@stripped, 2007-03-23 17:56:41+02:00, serg@stripped +31 -32
merged
MERGE: 1.21.1.1
sql/sql_view.cc@stripped, 2007-03-23 17:38:54+02:00, serg@stripped +0 -0
Auto merged
MERGE: 1.105.1.2
# 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: serg
# Host: sergbook.mysql.com
# Root: /usr/home/serg/Abk/mysql-5.0/RESYNC
--- 1.136/client/mysqlbinlog.cc 2007-03-23 17:57:32 +02:00
+++ 1.137/client/mysqlbinlog.cc 2007-03-23 17:57:32 +02:00
@@ -1042,7 +1042,7 @@
uint logname_len;
NET* net;
int error= 0;
- my_off_t old_off= start_position_mot;
+ my_off_t old_off= min(start_position_mot, BIN_LOG_HEADER_SIZE);
char fname[FN_REFLEN+1];
DBUG_ENTER("dump_remote_log_entries");
@@ -1194,10 +1194,17 @@
}
}
/*
- Let's adjust offset for remote log as for local log to produce
- similar text.
+ Let's adjust offset for remote log as for local log to produce
+ similar text and to have --stop-position to work identically.
+
+ Exception - the server sends Format_description_log_event
+ in the beginning of the dump, and only after it the event from
+ start_position. Let the old_off reflect it.
*/
- old_off+= len-1;
+ if (old_off < start_position_mot)
+ old_off= start_position_mot;
+ else
+ old_off+= len-1;
}
err:
--- 1.106/sql/sql_view.cc 2007-03-23 17:57:32 +02:00
+++ 1.107/sql/sql_view.cc 2007-03-23 17:57:32 +02:00
@@ -224,6 +224,9 @@
{
LEX *lex= thd->lex;
bool link_to_local;
+#ifndef NO_EMBEDDED_ACCESS_CHECKS
+ bool definer_check_is_needed= mode != VIEW_ALTER || lex->definer;
+#endif
/* first table in list is target VIEW name => cut off it */
TABLE_LIST *view= lex->unlink_first_table(&link_to_local);
TABLE_LIST *tables= lex->query_tables;
@@ -256,8 +259,9 @@
/*
DEFINER-clause is missing; we have to create default definer in
persistent arena to be PS/SP friendly.
+ If this is an ALTER VIEW then the current user should be set as
+ the definer.
*/
-
Query_arena original_arena;
Query_arena *ps_arena = thd->activate_stmt_arena_if_needed(&original_arena);
@@ -277,11 +281,11 @@
- same as current user
- current user has SUPER_ACL
*/
- if (strcmp(lex->definer->user.str,
- thd->security_ctx->priv_user) != 0 ||
- my_strcasecmp(system_charset_info,
- lex->definer->host.str,
- thd->security_ctx->priv_host) != 0)
+ if (definer_check_is_needed &&
+ (strcmp(lex->definer->user.str, thd->security_ctx->priv_user) != 0 ||
+ my_strcasecmp(system_charset_info,
+ lex->definer->host.str,
+ thd->security_ctx->priv_host) != 0))
{
if (!(thd->security_ctx->master_access & SUPER_ACL))
{
--- 1.23/mysql-test/r/view_grant.result 2007-03-23 17:57:32 +02:00
+++ 1.24/mysql-test/r/view_grant.result 2007-03-23 17:57:32 +02:00
@@ -764,6 +764,27 @@
DROP DATABASE mysqltest_db2;
DROP USER mysqltest_u1@localhost;
DROP USER mysqltest_u2@localhost;
+CREATE DATABASE db26813;
+USE db26813;
+CREATE TABLE t1(f1 INT, f2 INT);
+CREATE VIEW v1 AS SELECT f1 FROM t1;
+CREATE VIEW v2 AS SELECT f1 FROM t1;
+CREATE VIEW v3 AS SELECT f1 FROM t1;
+CREATE USER u26813@localhost;
+GRANT DROP ON db26813.v1 TO u26813@localhost;
+GRANT CREATE VIEW ON db26813.v2 TO u26813@localhost;
+GRANT DROP, CREATE VIEW ON db26813.v3 TO u26813@localhost;
+GRANT SELECT ON db26813.t1 TO u26813@localhost;
+ALTER VIEW v1 AS SELECT f2 FROM t1;
+ERROR 42000: CREATE VIEW command denied to user 'u26813'@'localhost' for table 'v1'
+ALTER VIEW v2 AS SELECT f2 FROM t1;
+ERROR 42000: DROP command denied to user 'u26813'@'localhost' for table 'v2'
+ALTER VIEW v3 AS SELECT f2 FROM t1;
+SHOW CREATE VIEW v3;
+View Create View
+v3 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v3` AS select `t1`.`f2` AS `f2` from `t1`
+DROP USER u26813@localhost;
+DROP DATABASE db26813;
DROP DATABASE IF EXISTS mysqltest1;
DROP DATABASE IF EXISTS mysqltest2;
CREATE DATABASE mysqltest1;
--- 1.22/mysql-test/t/view_grant.test 2007-03-23 17:57:32 +02:00
+++ 1.23/mysql-test/t/view_grant.test 2007-03-23 17:57:32 +02:00
@@ -1015,6 +1015,37 @@
DROP USER mysqltest_u1@localhost;
DROP USER mysqltest_u2@localhost;
+#
+# Bug#26813: The SUPER privilege is wrongly required to alter a view created
+# by another user.
+#
+connection root;
+CREATE DATABASE db26813;
+USE db26813;
+CREATE TABLE t1(f1 INT, f2 INT);
+CREATE VIEW v1 AS SELECT f1 FROM t1;
+CREATE VIEW v2 AS SELECT f1 FROM t1;
+CREATE VIEW v3 AS SELECT f1 FROM t1;
+CREATE USER u26813@localhost;
+GRANT DROP ON db26813.v1 TO u26813@localhost;
+GRANT CREATE VIEW ON db26813.v2 TO u26813@localhost;
+GRANT DROP, CREATE VIEW ON db26813.v3 TO u26813@localhost;
+GRANT SELECT ON db26813.t1 TO u26813@localhost;
+
+connect (u1,localhost,u26813,,db26813);
+connection u1;
+--error 1142
+ALTER VIEW v1 AS SELECT f2 FROM t1;
+--error 1142
+ALTER VIEW v2 AS SELECT f2 FROM t1;
+ALTER VIEW v3 AS SELECT f2 FROM t1;
+
+connection root;
+SHOW CREATE VIEW v3;
+
+DROP USER u26813@localhost;
+DROP DATABASE db26813;
+disconnect u1;
#
# BUG#24040: Create View don't succed with "all privileges" on a database.
@@ -1106,6 +1137,5 @@
DROP DATABASE mysqltest1;
DROP DATABASE mysqltest2;
DROP USER mysqltest_u1@localhost;
-
--echo End of 5.0 tests.
| Thread |
|---|
| • bk commit into 5.0 tree (serg:1.2418) | Sergei Golubchik | 23 Mar |