Below is the list of changes that have just been committed into a local
5.1 repository of lthalmann. When lthalmann 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
1.2161 06/03/10 10:21:41 lars@stripped +6 -0
Merge mysql.com:/users/lthalmann/bkroot/mysql-5.1-new
into mysql.com:/users/lthalmann/bk/mysql-5.1-new-wl3023-mats
mysql-test/t/rpl_ndb_blob.test
1.4 06/03/10 10:21:32 lars@stripped +0 -3
Merge
mysql-test/t/disabled.def
1.96 06/03/10 10:21:32 lars@stripped +0 -0
Merge
mysql-test/r/rpl_ndb_blob.result
1.6 06/03/10 10:21:32 lars@stripped +0 -0
Merge
sql/sql_parse.cc
1.526 06/03/10 09:01:51 lars@stripped +0 -0
Auto merged
sql/mysql_priv.h
1.384 06/03/10 09:01:50 lars@stripped +0 -0
Auto merged
configure.in
1.348 06/03/10 09:01:49 lars@stripped +0 -0
Auto merged
# 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: lars
# Host: dl145k.mysql.com
# Root: /users/lthalmann/bk/mysql-5.1-new-wl3023-mats/RESYNC
--- 1.347/configure.in 2006-03-07 09:59:57 +01:00
+++ 1.348/configure.in 2006-03-10 09:01:49 +01:00
@@ -214,7 +214,7 @@
test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
# Not critical since the generated file is distributed
-AC_PROG_YACC
+AC_CHECK_PROGS(YACC, ['bison -y -p MYSQL'])
AC_CHECK_PROG(PDFMANUAL, pdftex, manual.pdf)
AC_CHECK_PROG(DVIS, tex, manual.dvi)
--- 1.383/sql/mysql_priv.h 2006-03-07 09:59:58 +01:00
+++ 1.384/sql/mysql_priv.h 2006-03-10 09:01:50 +01:00
@@ -548,7 +548,8 @@
bool create_table_precheck(THD *thd, TABLE_LIST *tables,
TABLE_LIST *create_table);
-bool get_default_definer(THD *thd, LEX_USER *definer);
+void get_default_definer(THD *thd, LEX_USER *definer);
+LEX_USER *create_default_definer(THD *thd);
LEX_USER *create_definer(THD *thd, LEX_STRING *user_name, LEX_STRING *host_name);
enum enum_mysql_completiontype {
@@ -1223,7 +1224,7 @@
const char **errmsg);
/* mysqld.cc */
-extern void yyerror(const char*);
+extern void MYSQLerror(const char*);
/* item_func.cc */
extern bool check_reserved_words(LEX_STRING *name);
@@ -1634,7 +1635,7 @@
void free_list(I_List <i_string> *list);
/* sql_yacc.cc */
-extern int yyparse(void *thd);
+extern int MYSQLparse(void *thd);
/* frm_crypt.cc */
#ifdef HAVE_CRYPTED_FRM
--- 1.525/sql/sql_parse.cc 2006-03-03 09:51:27 +01:00
+++ 1.526/sql/sql_parse.cc 2006-03-10 09:01:51 +01:00
@@ -14,6 +14,7 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+#define MYSQL_LEX 1
#include "mysql_priv.h"
#include "sql_repl.h"
#include "rpl_filter.h"
@@ -4281,6 +4282,90 @@
#endif
/*
+ If the definer is not specified, this means that CREATE-statement missed
+ DEFINER-clause. DEFINER-clause can be missed in two cases:
+
+ - The user submitted a statement w/o the clause. This is a normal
+ case, we should assign CURRENT_USER as definer.
+
+ - Our slave received an updated from the master, that does not
+ replicate definer for stored rountines. We should also assign
+ CURRENT_USER as definer here, but also we should mark this routine
+ as NON-SUID. This is essential for the sake of backward
+ compatibility.
+
+ The problem is the slave thread is running under "special" user (@),
+ that actually does not exist. In the older versions we do not fail
+ execution of a stored routine if its definer does not exist and
+ continue the execution under the authorization of the invoker
+ (BUG#13198). And now if we try to switch to slave-current-user (@),
+ we will fail.
+
+ Actually, this leads to the inconsistent state of master and
+ slave (different definers, different SUID behaviour), but it seems,
+ this is the best we can do.
+ */
+
+ if (!lex->definer)
+ {
+ bool res= FALSE;
+ Query_arena original_arena;
+ Query_arena *ps_arena = thd->activate_stmt_arena_if_needed(&original_arena);
+
+ if (!(lex->definer= create_default_definer(thd)))
+ res= TRUE;
+
+ if (ps_arena)
+ thd->restore_active_arena(ps_arena, &original_arena);
+
+ if (res)
+ {
+ /* Error has been already reported. */
+ delete lex->sphead;
+ lex->sphead= 0;
+ goto error;
+ }
+
+ if (thd->slave_thread)
+ lex->sphead->m_chistics->suid= SP_IS_NOT_SUID;
+ }
+
+ /*
+ If the specified definer differs from the current user, we should check
+ that the current user has SUPER privilege (in order to create a stored
+ routine under another user one must have SUPER privilege).
+ */
+
+ else if (strcmp(lex->definer->user.str, thd->security_ctx->priv_user) ||
+ my_strcasecmp(system_charset_info,
+ lex->definer->host.str,
+ thd->security_ctx->priv_host))
+ {
+ if (check_global_access(thd, SUPER_ACL))
+ {
+ my_error(ER_SPECIFIC_ACCESS_DENIED_ERROR, MYF(0), "SUPER");
+ delete lex->sphead;
+ lex->sphead= 0;
+ goto error;
+ }
+ }
+
+ /* Check that the specified definer exists. Emit a warning if not. */
+
+#ifndef NO_EMBEDDED_ACCESS_CHECKS
+ if (!is_acl_user(lex->definer->host.str,
+ lex->definer->user.str))
+ {
+ push_warning_printf(thd,
+ MYSQL_ERROR::WARN_LEVEL_NOTE,
+ ER_NO_SUCH_USER,
+ ER(ER_NO_SUCH_USER),
+ lex->definer->user.str,
+ lex->definer->host.str);
+ }
+#endif /* NO_EMBEDDED_ACCESS_CHECKS */
+
+ /*
We need to copy name and db in order to use them for
check_routine_access which is called after lex->sphead has
been deleted.
@@ -4294,7 +4379,7 @@
/*
We must cleanup the unit and the lex here because
sp_grant_privileges calls (indirectly) db_find_routine,
- which in turn may call yyparse with THD::lex.
+ which in turn may call MYSQLparse with THD::lex.
TODO: fix db_find_routine to use a temporary lex.
*/
lex->unit.cleanup();
@@ -5733,7 +5818,7 @@
sp_cache_flush_obsolete(&thd->sp_proc_cache);
sp_cache_flush_obsolete(&thd->sp_func_cache);
- if (!yyparse((void *)thd) && ! thd->is_fatal_error)
+ if (!MYSQLparse((void *)thd) && ! thd->is_fatal_error)
{
#ifndef NO_EMBEDDED_ACCESS_CHECKS
if (mqh_used && thd->user_connect &&
@@ -5825,7 +5910,7 @@
DBUG_ENTER("mysql_test_parse_for_slave");
mysql_init_query(thd, (uchar*) inBuf, length);
- if (!yyparse((void*) thd) && ! thd->is_fatal_error &&
+ if (!MYSQLparse((void*) thd) && ! thd->is_fatal_error &&
all_tables_not_ok(thd,(TABLE_LIST*) lex->select_lex.table_list.first))
error= 1; /* Ignore question */
thd->end_statement();
@@ -7344,47 +7429,54 @@
/*
Set the specified definer to the default value, which is the current user in
- the thread. Also check that the current user satisfies to the definers
- requirements.
+ the thread.
SYNOPSIS
get_default_definer()
thd [in] thread handler
definer [out] definer
-
- RETURN
- error status, that is:
- - FALSE -- on success;
- - TRUE -- on error (current user can not be a definer).
*/
-bool get_default_definer(THD *thd, LEX_USER *definer)
+void get_default_definer(THD *thd, LEX_USER *definer)
{
- /* Check that current user has non-empty host name. */
-
const Security_context *sctx= thd->security_ctx;
- if (sctx->priv_host[0] == 0)
- {
- my_error(ER_MALFORMED_DEFINER, MYF(0));
- return TRUE;
- }
-
- /* Fill in. */
-
definer->user.str= (char *) sctx->priv_user;
definer->user.length= strlen(definer->user.str);
definer->host.str= (char *) sctx->priv_host;
definer->host.length= strlen(definer->host.str);
+}
- return FALSE;
+
+/*
+ Create default definer for the specified THD.
+
+ SYNOPSIS
+ create_default_definer()
+ thd [in] thread handler
+
+ RETURN
+ On success, return a valid pointer to the created and initialized
+ LEX_USER, which contains definer information.
+ On error, return 0.
+*/
+
+LEX_USER *create_default_definer(THD *thd)
+{
+ LEX_USER *definer;
+
+ if (! (definer= (LEX_USER*) thd->alloc(sizeof(LEX_USER))))
+ return 0;
+
+ get_default_definer(thd, definer);
+
+ return definer;
}
/*
- Create definer with the given user and host names. Also check that the user
- and host names satisfy definers requirements.
+ Create definer with the given user and host names.
SYNOPSIS
create_definer()
@@ -7394,21 +7486,13 @@
RETURN
On success, return a valid pointer to the created and initialized
- LEX_STRING, which contains definer information.
+ LEX_USER, which contains definer information.
On error, return 0.
*/
LEX_USER *create_definer(THD *thd, LEX_STRING *user_name, LEX_STRING *host_name)
{
LEX_USER *definer;
-
- /* Check that specified host name is valid. */
-
- if (host_name->length == 0)
- {
- my_error(ER_MALFORMED_DEFINER, MYF(0));
- return 0;
- }
/* Create and initialize. */
--- 1.95/mysql-test/t/disabled.def 2006-03-09 15:59:14 +01:00
+++ 1.96/mysql-test/t/disabled.def 2006-03-10 10:21:32 +01:00
@@ -9,10 +9,10 @@
# Do not use any TAB characters for whitespace.
#
##############################################################################
-#ndb_alter_table_row : sometimes wrong error 1015!=1046
events_bugs : test case unstable (race conditions). andrey will fix
events_stress : test case unstable. andrey will fix
events : test case unstable. andrey will fix
+#ndb_alter_table_row : sometimes wrong error 1015!=1046
ndb_autodiscover : Needs to be fixed w.r.t binlog
ndb_autodiscover2 : Needs to be fixed w.r.t binlog
ndb_binlog_basic : Results are not deterministic, Tomas will fix
@@ -35,11 +35,11 @@
rpl_ndb_myisam2ndb : Bugs#17400: delete & update of rows in table without pk fails
rpl_ndb_log : result not deterministic
rpl_ndb_relay_space : Bug#16993
+rpl_ndb_multi_update2 : BUG#17738 In progress
rpl_ndb_multi_update3 : Bug#17400: delete & update of rows in table without pk fails
rpl_ndb_sp007 : Bug #17290
rpl_row_inexist_tbl : Disabled since patch makes this test wait forever
rpl_sp : Bug#16456
rpl_until : Unstable test case, bug#15886
sp-goto : GOTO is currently is disabled - will be fixed in the future
-rpl_ndb_multi_update2 : BUG#17738 In progress
rpl_rbr_to_sbr : BUG#18108
--- 1.5/mysql-test/r/rpl_ndb_blob.result 2006-03-08 20:42:04 +01:00
+++ 1.6/mysql-test/r/rpl_ndb_blob.result 2006-03-10 10:21:32 +01:00
@@ -78,3 +78,58 @@
S 8 e139adcb7b2974ee7ff227fd405709e5cb7c896c 108 ba8073b0e1a281d4111bd2d82c7722b01574c00b NULL
S 9 1fc5168fe4be566b17b658d94e7813f0b5032cdb NULL NULL NULL
drop table t1;
+CREATE TABLE IF NOT EXISTS t1 (
+db VARBINARY(63) NOT NULL,
+name VARBINARY(63) NOT NULL,
+slock BINARY(32) NOT NULL,
+query BLOB NOT NULL,
+node_id INT UNSIGNED NOT NULL,
+epoch BIGINT UNSIGNED NOT NULL,
+id INT UNSIGNED NOT NULL,
+version INT UNSIGNED NOT NULL,
+type INT UNSIGNED NOT NULL,
+PRIMARY KEY USING HASH (db,name))
+ENGINE=NDB;
+insert into t1 values ('test','t1',
+'abc',repeat(@s0,10), 11,12,13,14,15);
+insert into t1 values ('test','t2',
+'def',repeat(@s1,100), 21,22,23,24,25);
+insert into t1 values ('test','t3',
+'ghi',repeat(@s2,1000),31,32,33,34,35);
+insert into t1 values ('testtttttttttt','t1',
+'abc',repeat(@s0,10), 11,12,13,14,15);
+insert into t1 values ('testttttttttttt','t1',
+'def',repeat(@s1,100), 21,22,23,24,25);
+insert into t1 values ('testtttttttttttt','t1',
+'ghi',repeat(@s2,1000),31,32,33,34,35);
+insert into t1 values ('t','t11111111111',
+'abc',repeat(@s0,10), 11,12,13,14,15);
+insert into t1 values ('t','t111111111111',
+'def',repeat(@s1,100), 21,22,23,24,25);
+insert into t1 values ('t','t1111111111111',
+'ghi',repeat(@s2,1000),31,32,33,34,35);
+select 'M', db, name, sha1(query), node_id, epoch, id, version, type
+from t1 order by db, name;
+M db name sha1(query) node_id epoch id version type
+M t t11111111111 8fc937d303ee7e4795c0b964d4066cedd6d74cfd 11 12 13 14 15
+M t t111111111111 a5229e9f8977bc99afc3b3627c56f083e97e01bd 21 22 23 24 25
+M t t1111111111111 0820e6ad3eeb06ea60e5e04d0bfe36f286b91098 31 32 33 34 35
+M test t1 8fc937d303ee7e4795c0b964d4066cedd6d74cfd 11 12 13 14 15
+M test t2 a5229e9f8977bc99afc3b3627c56f083e97e01bd 21 22 23 24 25
+M test t3 0820e6ad3eeb06ea60e5e04d0bfe36f286b91098 31 32 33 34 35
+M testtttttttttt t1 8fc937d303ee7e4795c0b964d4066cedd6d74cfd 11 12 13 14 15
+M testttttttttttt t1 a5229e9f8977bc99afc3b3627c56f083e97e01bd 21 22 23 24 25
+M testtttttttttttt t1 0820e6ad3eeb06ea60e5e04d0bfe36f286b91098 31 32 33 34 35
+select 'S', db, name, sha1(query), node_id, epoch, id, version, type
+from t1 order by db, name;
+S db name sha1(query) node_id epoch id version type
+S t t11111111111 8fc937d303ee7e4795c0b964d4066cedd6d74cfd 11 12 13 14 15
+S t t111111111111 a5229e9f8977bc99afc3b3627c56f083e97e01bd 21 22 23 24 25
+S t t1111111111111 0820e6ad3eeb06ea60e5e04d0bfe36f286b91098 31 32 33 34 35
+S test t1 8fc937d303ee7e4795c0b964d4066cedd6d74cfd 11 12 13 14 15
+S test t2 a5229e9f8977bc99afc3b3627c56f083e97e01bd 21 22 23 24 25
+S test t3 0820e6ad3eeb06ea60e5e04d0bfe36f286b91098 31 32 33 34 35
+S testtttttttttt t1 8fc937d303ee7e4795c0b964d4066cedd6d74cfd 11 12 13 14 15
+S testttttttttttt t1 a5229e9f8977bc99afc3b3627c56f083e97e01bd 21 22 23 24 25
+S testtttttttttttt t1 0820e6ad3eeb06ea60e5e04d0bfe36f286b91098 31 32 33 34 35
+drop table t1;
--- 1.3/mysql-test/t/rpl_ndb_blob.test 2006-03-08 20:42:04 +01:00
+++ 1.4/mysql-test/t/rpl_ndb_blob.test 2006-03-10 10:21:32 +01:00
@@ -83,12 +83,60 @@
drop table t1;
--sync_slave_with_master
+# table with varsize key (future cluster/schema)
+
+# sql/ha_ndbcluster_binlog.cc
+--connection master
+CREATE TABLE IF NOT EXISTS t1 (
+ db VARBINARY(63) NOT NULL,
+ name VARBINARY(63) NOT NULL,
+ slock BINARY(32) NOT NULL,
+ query BLOB NOT NULL,
+ node_id INT UNSIGNED NOT NULL,
+ epoch BIGINT UNSIGNED NOT NULL,
+ id INT UNSIGNED NOT NULL,
+ version INT UNSIGNED NOT NULL,
+ type INT UNSIGNED NOT NULL,
+ PRIMARY KEY USING HASH (db,name))
+ENGINE=NDB;
+
+insert into t1 values ('test','t1',
+ 'abc',repeat(@s0,10), 11,12,13,14,15);
+insert into t1 values ('test','t2',
+ 'def',repeat(@s1,100), 21,22,23,24,25);
+insert into t1 values ('test','t3',
+ 'ghi',repeat(@s2,1000),31,32,33,34,35);
+insert into t1 values ('testtttttttttt','t1',
+ 'abc',repeat(@s0,10), 11,12,13,14,15);
+insert into t1 values ('testttttttttttt','t1',
+ 'def',repeat(@s1,100), 21,22,23,24,25);
+insert into t1 values ('testtttttttttttt','t1',
+ 'ghi',repeat(@s2,1000),31,32,33,34,35);
+insert into t1 values ('t','t11111111111',
+ 'abc',repeat(@s0,10), 11,12,13,14,15);
+insert into t1 values ('t','t111111111111',
+ 'def',repeat(@s1,100), 21,22,23,24,25);
+insert into t1 values ('t','t1111111111111',
+ 'ghi',repeat(@s2,1000),31,32,33,34,35);
+
+select 'M', db, name, sha1(query), node_id, epoch, id, version, type
+from t1 order by db, name;
+
+--sync_slave_with_master
+--sleep 5
+--connection slave
+select 'S', db, name, sha1(query), node_id, epoch, id, version, type
+from t1 order by db, name;
+
+--connection master
+drop table t1;
+--sync_slave_with_master
+
#
-# view the binlog
+# view the binlog - not deterministic (mats)
#
---connection master
-let $VERSION=`select version()`;
+#--connection master
+#let $VERSION=`select version()`;
#--replace_result $VERSION VERSION
-#--replace_regex /table_id: [0-9]+/table_id: #/
#show binlog events;
| Thread |
|---|
| • bk commit into 5.1 tree (lars:1.2161) | Lars Thalmann | 10 Mar |