mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Merge
mysql-test/r/union.result: Auto merged mysql-test/t/union.test: Auto merged sql/item.cc: Auto merged sql/item.h: Auto merged sql/item_cmpfunc.cc: Auto merged sql/item_cmpfunc.h: Auto merged sql/item_subselect.cc: Auto merged sql/item_subselect.h: Auto merged sql/item_sum.cc: Auto merged sql/item_sum.h: Auto merged sql/mysql_priv.h: Auto merged sql/sql_base.cc: Auto merged sql/sql_class.cc: Auto merged sql/sql_class.h: Auto merged sql/sql_derived.cc: Auto merged sql/sql_union.cc: Auto merged sql/sql_yacc.yy: Auto merged mysql-test/r/subselect.result: SCCS merged mysql-test/t/subselect.test: SCCS merged
This commit is contained in:
@ -25,8 +25,6 @@
|
||||
#include "sql_select.h"
|
||||
#include "sql_acl.h"
|
||||
|
||||
extern const char *any_db; // Special symbol for check_access
|
||||
|
||||
/*
|
||||
Resolve derived tables in all queries
|
||||
|
||||
@ -91,13 +89,15 @@ int mysql_derived(THD *thd, LEX *lex, SELECT_LEX_UNIT *unit,
|
||||
We have to do access checks here as this code is executed before any
|
||||
sql command is started to execute.
|
||||
*/
|
||||
#ifndef NO_EMBEDDED_ACCESS_CHECKS
|
||||
if (tables)
|
||||
res= check_table_access(thd,SELECT_ACL, tables);
|
||||
res= check_table_access(thd,SELECT_ACL, tables,0);
|
||||
else
|
||||
res= check_access(thd, SELECT_ACL, any_db);
|
||||
res= check_access(thd, SELECT_ACL, any_db,0,0,0);
|
||||
if (res)
|
||||
DBUG_RETURN(-1);
|
||||
|
||||
DBUG_RETURN(1);
|
||||
#endif
|
||||
|
||||
if (!(res=open_and_lock_tables(thd,tables)))
|
||||
{
|
||||
if (is_union || is_subsel)
|
||||
@ -206,7 +206,9 @@ int mysql_derived(THD *thd, LEX *lex, SELECT_LEX_UNIT *unit,
|
||||
org_table_list->table=table;
|
||||
table->derived_select_number= select_cursor->select_number;
|
||||
table->tmp_table= TMP_TABLE;
|
||||
#ifndef NO_EMBEDDED_ACCESS_CHECKS
|
||||
org_table_list->grant.privilege= SELECT_ACL;
|
||||
#endif
|
||||
if (lex->describe)
|
||||
{
|
||||
// to fix a problem in EXPLAIN
|
||||
|
Reference in New Issue
Block a user