Commit ea8a26c6 authored by unknown's avatar unknown

build fixes


sql/event.cc:
  - make this not unsigned. gcc complains
sql/event_timed.cc:
  acl_getroot_no_password() is not there in libmysqld, disable it's usage
  in this case.
sql/set_var.cc:
  fix for the broken build of Serg. gcc seems to be pretty happy without
  the return and returns the value of the last statement
parent 4e2b90b1
...@@ -1239,7 +1239,7 @@ int db_drop_event(THD *thd, event_timed *et, bool drop_if_exists, ...@@ -1239,7 +1239,7 @@ int db_drop_event(THD *thd, event_timed *et, bool drop_if_exists,
{ {
TABLE *table; TABLE *table;
Open_tables_state backup; Open_tables_state backup;
uint ret; int ret;
DBUG_ENTER("db_drop_event"); DBUG_ENTER("db_drop_event");
ret= EVEX_OPEN_TABLE_FAILED; ret= EVEX_OPEN_TABLE_FAILED;
......
...@@ -1093,6 +1093,7 @@ event_timed::execute(THD *thd, MEM_ROOT *mem_root) ...@@ -1093,6 +1093,7 @@ event_timed::execute(THD *thd, MEM_ROOT *mem_root)
DBUG_PRINT("info", ("master_access=%d db_access=%d", DBUG_PRINT("info", ("master_access=%d db_access=%d",
thd->security_ctx->master_access, thd->security_ctx->db_access)); thd->security_ctx->master_access, thd->security_ctx->db_access));
change_security_context(thd, &save_ctx); change_security_context(thd, &save_ctx);
DBUG_PRINT("info", ("master_access=%d db_access=%d", DBUG_PRINT("info", ("master_access=%d db_access=%d",
thd->security_ctx->master_access, thd->security_ctx->db_access)); thd->security_ctx->master_access, thd->security_ctx->db_access));
if (mysql_change_db(thd, dbname.str, 0)) if (mysql_change_db(thd, dbname.str, 0))
...@@ -1108,6 +1109,7 @@ event_timed::execute(THD *thd, MEM_ROOT *mem_root) ...@@ -1108,6 +1109,7 @@ event_timed::execute(THD *thd, MEM_ROOT *mem_root)
ret= -99; ret= -99;
} }
restore_security_context(thd, save_ctx); restore_security_context(thd, save_ctx);
DBUG_PRINT("info", ("master_access=%d db_access=%d", DBUG_PRINT("info", ("master_access=%d db_access=%d",
thd->security_ctx->master_access, thd->security_ctx->db_access)); thd->security_ctx->master_access, thd->security_ctx->db_access));
...@@ -1145,6 +1147,7 @@ event_timed::change_security_context(THD *thd, Security_context **backup) ...@@ -1145,6 +1147,7 @@ event_timed::change_security_context(THD *thd, Security_context **backup)
{ {
DBUG_ENTER("event_timed::change_security_context"); DBUG_ENTER("event_timed::change_security_context");
DBUG_PRINT("info",("%s@%s@%s",definer_user.str,definer_host.str, dbname.str)); DBUG_PRINT("info",("%s@%s@%s",definer_user.str,definer_host.str, dbname.str));
#ifndef NO_EMBEDDED_ACCESS_CHECKS
*backup= 0; *backup= 0;
if (acl_getroot_no_password(&sphead->m_security_ctx, definer_user.str, if (acl_getroot_no_password(&sphead->m_security_ctx, definer_user.str,
definer_host.str, definer_host.str, dbname.str)) definer_host.str, definer_host.str, dbname.str))
...@@ -1154,7 +1157,7 @@ event_timed::change_security_context(THD *thd, Security_context **backup) ...@@ -1154,7 +1157,7 @@ event_timed::change_security_context(THD *thd, Security_context **backup)
} }
*backup= thd->security_ctx; *backup= thd->security_ctx;
thd->security_ctx= &sphead->m_security_ctx; thd->security_ctx= &sphead->m_security_ctx;
#endif
DBUG_RETURN(FALSE); DBUG_RETURN(FALSE);
} }
...@@ -1171,8 +1174,10 @@ void ...@@ -1171,8 +1174,10 @@ void
event_timed::restore_security_context(THD *thd, Security_context *backup) event_timed::restore_security_context(THD *thd, Security_context *backup)
{ {
DBUG_ENTER("event_timed::change_security_context"); DBUG_ENTER("event_timed::change_security_context");
#ifndef NO_EMBEDDED_ACCESS_CHECKS
if (backup) if (backup)
thd->security_ctx= backup; thd->security_ctx= backup;
#endif
DBUG_VOID_RETURN; DBUG_VOID_RETURN;
} }
......
...@@ -3488,7 +3488,7 @@ byte *sys_var_thd_dbug::value_ptr(THD *thd, enum_var_type type, LEX_STRING *b) ...@@ -3488,7 +3488,7 @@ byte *sys_var_thd_dbug::value_ptr(THD *thd, enum_var_type type, LEX_STRING *b)
DBUG_EXPLAIN_INITIAL(buf, sizeof(buf)); DBUG_EXPLAIN_INITIAL(buf, sizeof(buf));
else else
DBUG_EXPLAIN(buf, sizeof(buf)); DBUG_EXPLAIN(buf, sizeof(buf));
(byte*) thd->strdup(buf); return (byte*) thd->strdup(buf);
} }
/**************************************************************************** /****************************************************************************
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment