mirror of
https://github.com/MariaDB/server.git
synced 2026-01-06 05:22:24 +03:00
Manual merge
This commit is contained in:
@@ -3382,15 +3382,6 @@ end_with_restore_list:
|
||||
&lex->value_list,
|
||||
lex->duplicates, lex->ignore)))
|
||||
{
|
||||
/*
|
||||
Skip first table, which is the table we are inserting in.
|
||||
Below we set context.table_list again because the call above to
|
||||
mysql_insert_select_prepare() calls resolve_in_table_list_only(),
|
||||
which in turn resets context.table_list and
|
||||
context.first_name_resolution_table.
|
||||
*/
|
||||
select_lex->context.table_list=
|
||||
select_lex->context.first_name_resolution_table= second_table;
|
||||
res= handle_select(thd, lex, result, OPTION_SETUP_TABLES_DONE);
|
||||
/*
|
||||
Invalidate the table in the query cache if something changed
|
||||
@@ -5249,11 +5240,10 @@ static bool execute_sqlcom_select(THD *thd, TABLE_LIST *all_tables)
|
||||
|
||||
|
||||
/*
|
||||
Check grants for commands which work only with one table and all other
|
||||
tables belonging to subselects or implicitly opened tables.
|
||||
Check grants for commands which work only with one table.
|
||||
|
||||
SYNOPSIS
|
||||
check_one_table_access()
|
||||
check_single_table_access()
|
||||
thd Thread handler
|
||||
privilege requested privilege
|
||||
all_tables global table list of query
|
||||
@@ -5263,7 +5253,8 @@ static bool execute_sqlcom_select(THD *thd, TABLE_LIST *all_tables)
|
||||
1 - access denied, error is sent to client
|
||||
*/
|
||||
|
||||
bool check_one_table_access(THD *thd, ulong privilege, TABLE_LIST *all_tables)
|
||||
bool check_single_table_access(THD *thd, ulong privilege,
|
||||
TABLE_LIST *all_tables)
|
||||
{
|
||||
Security_context * backup_ctx= thd->security_ctx;
|
||||
|
||||
@@ -5288,19 +5279,41 @@ bool check_one_table_access(THD *thd, ulong privilege, TABLE_LIST *all_tables)
|
||||
goto deny;
|
||||
|
||||
thd->security_ctx= backup_ctx;
|
||||
return 0;
|
||||
|
||||
deny:
|
||||
thd->security_ctx= backup_ctx;
|
||||
return 1;
|
||||
}
|
||||
|
||||
/*
|
||||
Check grants for commands which work only with one table and all other
|
||||
tables belonging to subselects or implicitly opened tables.
|
||||
|
||||
SYNOPSIS
|
||||
check_one_table_access()
|
||||
thd Thread handler
|
||||
privilege requested privilege
|
||||
all_tables global table list of query
|
||||
|
||||
RETURN
|
||||
0 - OK
|
||||
1 - access denied, error is sent to client
|
||||
*/
|
||||
|
||||
bool check_one_table_access(THD *thd, ulong privilege, TABLE_LIST *all_tables)
|
||||
{
|
||||
if (check_single_table_access (thd,privilege,all_tables))
|
||||
return 1;
|
||||
|
||||
/* Check rights on tables of subselects and implictly opened tables */
|
||||
TABLE_LIST *subselects_tables;
|
||||
if ((subselects_tables= all_tables->next_global))
|
||||
{
|
||||
if ((check_table_access(thd, SELECT_ACL, subselects_tables, 0)))
|
||||
goto deny;
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
|
||||
deny:
|
||||
thd->security_ctx= backup_ctx;
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user