1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-27 18:02:13 +03:00

Merge station.:/mnt/raid/alik/MySQL/devel/5.1

into  station.:/mnt/raid/alik/MySQL/devel/5.1-rt


client/mysqltest.c:
  Auto merged
include/mysql_com.h:
  Auto merged
libmysqld/emb_qcache.cc:
  Auto merged
libmysqld/emb_qcache.h:
  Auto merged
libmysqld/lib_sql.cc:
  Auto merged
mysql-test/lib/mtr_report.pl:
  Auto merged
sql/ha_partition.cc:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/mysqld.cc:
  Auto merged
sql/opt_range.cc:
  Auto merged
sql/set_var.cc:
  Auto merged
sql/set_var.h:
  Auto merged
sql/slave.cc:
  Auto merged
sql/sql_class.cc:
  Auto merged
sql/sql_class.h:
  Auto merged
sql/sql_db.cc:
  Auto merged
sql/sql_insert.cc:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_partition.cc:
  Auto merged
sql/sql_select.cc:
  Auto merged
sql/sql_table.cc:
  Auto merged
sql/table.cc:
  Auto merged
storage/myisam/ha_myisam.cc:
  Auto merged
sql/protocol.cc:
  SCCS merged
This commit is contained in:
unknown
2007-12-14 16:30:22 +03:00
137 changed files with 2763 additions and 690 deletions

View File

@ -478,7 +478,7 @@ end:
(CREATE TABLE, ALTER TABLE ... UNION=(...)). Set TL_WRITE for
every child. Set 'db' for every child if not present.
*/
#ifndef NO_EMBEDDED_ACCESS_CHECKS
static bool check_merge_table_access(THD *thd, char *db,
TABLE_LIST *table_list)
{
@ -499,7 +499,7 @@ static bool check_merge_table_access(THD *thd, char *db,
}
return error;
}
#endif
/* This works because items are allocated with sql_alloc() */
@ -1952,10 +1952,6 @@ mysql_execute_command(THD *thd)
switch (lex->sql_command) {
case SQLCOM_SHOW_EVENTS:
if ((res= check_access(thd, EVENT_ACL, thd->lex->select_lex.db, 0, 0, 0,
is_schema_db(thd->lex->select_lex.db))))
break;
/* fall through */
case SQLCOM_SHOW_STATUS_PROC:
case SQLCOM_SHOW_STATUS_FUNC:
res= execute_sqlcom_select(thd, all_tables);
@ -4009,13 +4005,11 @@ create_sp_error:
thd->server_status|= SERVER_MORE_RESULTS_EXISTS;
}
#ifndef NO_EMBEDDED_ACCESS_CHECKS
if (check_routine_access(thd, EXECUTE_ACL,
sp->m_db.str, sp->m_name.str, TRUE, FALSE))
{
goto error;
}
#endif
select_limit= thd->variables.select_limit;
thd->variables.select_limit= HA_POS_ERROR;
@ -4697,6 +4691,7 @@ static bool execute_sqlcom_select(THD *thd, TABLE_LIST *all_tables)
}
#ifndef NO_EMBEDDED_ACCESS_CHECKS
/*
Check grants for commands which work only with one table.
@ -4814,7 +4809,6 @@ check_access(THD *thd, ulong want_access, const char *db, ulong *save_priv,
bool dont_check_global_grants, bool no_errors, bool schema_db)
{
Security_context *sctx= thd->security_ctx;
#ifndef NO_EMBEDDED_ACCESS_CHECKS
ulong db_access;
/*
GRANT command:
@ -4827,7 +4821,6 @@ check_access(THD *thd, ulong want_access, const char *db, ulong *save_priv,
*/
bool db_is_pattern= (test(want_access & GRANT_ACL) &&
dont_check_global_grants);
#endif
ulong dummy;
DBUG_ENTER("check_access");
DBUG_PRINT("enter",("db: %s want_access: %lu master_access: %lu",
@ -4866,9 +4859,6 @@ check_access(THD *thd, ulong want_access, const char *db, ulong *save_priv,
}
}
#ifdef NO_EMBEDDED_ACCESS_CHECKS
DBUG_RETURN(0);
#else
if ((sctx->master_access & want_access) == want_access)
{
/*
@ -4926,7 +4916,6 @@ check_access(THD *thd, ulong want_access, const char *db, ulong *save_priv,
thd->db :
"unknown"))); /* purecov: tested */
DBUG_RETURN(TRUE); /* purecov: tested */
#endif /* NO_EMBEDDED_ACCESS_CHECKS */
}
@ -4951,16 +4940,12 @@ check_access(THD *thd, ulong want_access, const char *db, ulong *save_priv,
bool check_global_access(THD *thd, ulong want_access)
{
#ifdef NO_EMBEDDED_ACCESS_CHECKS
return 0;
#else
char command[128];
if ((thd->security_ctx->master_access & want_access))
return 0;
get_privilege_desc(command, sizeof(command), want_access);
my_error(ER_SPECIFIC_ACCESS_DENIED_ERROR, MYF(0), command);
return 1;
#endif /* NO_EMBEDDED_ACCESS_CHECKS */
}
@ -5050,9 +5035,7 @@ bool
check_table_access(THD *thd, ulong want_access,TABLE_LIST *tables,
bool no_errors)
{
#ifndef NO_EMBEDDED_ACCESS_CHECKS
TABLE_LIST *org_tables= tables;
#endif
TABLE_LIST *first_not_own_table= thd->lex->first_not_own_table();
Security_context *sctx= thd->security_ctx, *backup_ctx= thd->security_ctx;
/*
@ -5139,11 +5122,7 @@ check_routine_access(THD *thd, ulong want_access,char *db, char *name,
0, no_errors, 0))
return TRUE;
#ifndef NO_EMBEDDED_ACCESS_CHECKS
return check_grant_routine(thd, want_access, tables, is_proc, no_errors);
#else
return FALSE;
#endif
}
@ -5213,6 +5192,7 @@ bool check_some_access(THD *thd, ulong want_access, TABLE_LIST *table)
DBUG_RETURN(1);
}
#endif /*NO_EMBEDDED_ACCESS_CHECKS*/
/****************************************************************************
Check stack size; Send error if there isn't enough stack to continue