WL#5030: Splitting mysql_priv.h
Adding my_global.h first in all files using NO_EMBEDDED_ACCESS_CHECKS. Correcting a merge problem resulting from a changed definition of check_some_access compared to the original patches.
This commit is contained in:
parent
e92b3c587c
commit
46bd78b9ee
@ -14,6 +14,7 @@
|
|||||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||||
|
|
||||||
#define MYSQL_LEX 1
|
#define MYSQL_LEX 1
|
||||||
|
#include "my_global.h" /* NO_EMBEDDED_ACCESS_CHECKS */
|
||||||
#include "sql_priv.h"
|
#include "sql_priv.h"
|
||||||
#include "unireg.h"
|
#include "unireg.h"
|
||||||
#include "sql_parse.h" // parse_sql
|
#include "sql_parse.h" // parse_sql
|
||||||
|
@ -17,6 +17,7 @@
|
|||||||
#ifdef USE_PRAGMA_IMPLEMENTATION
|
#ifdef USE_PRAGMA_IMPLEMENTATION
|
||||||
#pragma implementation // gcc: Class implementation
|
#pragma implementation // gcc: Class implementation
|
||||||
#endif
|
#endif
|
||||||
|
#include "my_global.h" /* NO_EMBEDDED_ACCESS_CHECKS */
|
||||||
#include "sql_priv.h"
|
#include "sql_priv.h"
|
||||||
#include "unireg.h" // REQUIRED: for other includes
|
#include "unireg.h" // REQUIRED: for other includes
|
||||||
#include <mysql.h>
|
#include <mysql.h>
|
||||||
|
@ -25,6 +25,7 @@
|
|||||||
#pragma implementation // gcc: Class implementation
|
#pragma implementation // gcc: Class implementation
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include "my_global.h" /* NO_EMBEDDED_ACCESS_CHECKS */
|
||||||
#include "sql_priv.h"
|
#include "sql_priv.h"
|
||||||
/*
|
/*
|
||||||
It is necessary to include set_var.h instead of item.h because there
|
It is necessary to include set_var.h instead of item.h because there
|
||||||
|
@ -24,6 +24,7 @@
|
|||||||
Abort logging when we get an error in reading or writing log files
|
Abort logging when we get an error in reading or writing log files
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "my_global.h" /* NO_EMBEDDED_ACCESS_CHECKS */
|
||||||
#include "sql_priv.h"
|
#include "sql_priv.h"
|
||||||
#include "log.h"
|
#include "log.h"
|
||||||
#include "sql_base.h" // close_thread_tables
|
#include "sql_base.h" // close_thread_tables
|
||||||
|
@ -13,9 +13,9 @@
|
|||||||
along with this program; if not, write to the Free Software
|
along with this program; if not, write to the Free Software
|
||||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||||
|
|
||||||
|
#include "my_global.h" /* NO_EMBEDDED_ACCESS_CHECKS */
|
||||||
#include "sql_priv.h"
|
#include "sql_priv.h"
|
||||||
#include "unireg.h"
|
#include "unireg.h"
|
||||||
#include "my_global.h"
|
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
#ifndef __WIN__
|
#ifndef __WIN__
|
||||||
#include <netdb.h> // getservbyname, servent
|
#include <netdb.h> // getservbyname, servent
|
||||||
|
@ -19,6 +19,7 @@
|
|||||||
|
|
||||||
/* variable declarations are in sys_vars.cc now !!! */
|
/* variable declarations are in sys_vars.cc now !!! */
|
||||||
|
|
||||||
|
#include "my_global.h" /* NO_EMBEDDED_ACCESS_CHECKS */
|
||||||
#include "sql_class.h" // set_var.h: session_var_ptr
|
#include "sql_class.h" // set_var.h: session_var_ptr
|
||||||
#include "set_var.h"
|
#include "set_var.h"
|
||||||
#include "sql_priv.h"
|
#include "sql_priv.h"
|
||||||
|
@ -13,6 +13,7 @@
|
|||||||
along with this program; if not, write to the Free Software
|
along with this program; if not, write to the Free Software
|
||||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||||
|
|
||||||
|
#include "my_global.h" /* NO_EMBEDDED_ACCESS_CHECKS */
|
||||||
#include "sql_priv.h"
|
#include "sql_priv.h"
|
||||||
#include "unireg.h"
|
#include "unireg.h"
|
||||||
#include "sql_prepare.h"
|
#include "sql_prepare.h"
|
||||||
|
@ -26,6 +26,7 @@
|
|||||||
are dependencies on include order for set_var.h and item.h. This
|
are dependencies on include order for set_var.h and item.h. This
|
||||||
will be resolved later.
|
will be resolved later.
|
||||||
*/
|
*/
|
||||||
|
#include "my_global.h" /* NO_EMBEDDED_ACCESS_CHECKS */
|
||||||
#include "sql_class.h" // THD, set_var.h: THD
|
#include "sql_class.h" // THD, set_var.h: THD
|
||||||
#include "set_var.h" // Item
|
#include "set_var.h" // Item
|
||||||
|
|
||||||
|
@ -24,6 +24,7 @@
|
|||||||
in the relevant fields. Empty strings comes last.
|
in the relevant fields. Empty strings comes last.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "my_global.h" /* NO_EMBEDDED_ACCESS_CHECKS */
|
||||||
#include "sql_priv.h"
|
#include "sql_priv.h"
|
||||||
#include "sql_acl.h" // MYSQL_DB_FIELD_COUNT, ACL_ACCESS
|
#include "sql_acl.h" // MYSQL_DB_FIELD_COUNT, ACL_ACCESS
|
||||||
#include "sql_base.h" // close_thread_tables
|
#include "sql_base.h" // close_thread_tables
|
||||||
|
@ -16,6 +16,7 @@
|
|||||||
along with this program; if not, write to the Free Software
|
along with this program; if not, write to the Free Software
|
||||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||||
|
|
||||||
|
#include "my_global.h" /* NO_EMBEDDED_ACCESS_CHECKS */
|
||||||
#include "violite.h" /* SSL_type */
|
#include "violite.h" /* SSL_type */
|
||||||
#include "sql_class.h" /* LEX_COLUMN */
|
#include "sql_class.h" /* LEX_COLUMN */
|
||||||
|
|
||||||
|
@ -16,6 +16,7 @@
|
|||||||
|
|
||||||
/* Basic functions needed by many modules */
|
/* Basic functions needed by many modules */
|
||||||
|
|
||||||
|
#include "my_global.h" /* NO_EMBEDDED_ACCESS_CHECKS */
|
||||||
#include "sql_priv.h"
|
#include "sql_priv.h"
|
||||||
#include "unireg.h"
|
#include "unireg.h"
|
||||||
#include "debug_sync.h"
|
#include "debug_sync.h"
|
||||||
|
@ -327,6 +327,7 @@ TODO list:
|
|||||||
(This could be done with almost no speed penalty)
|
(This could be done with almost no speed penalty)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "my_global.h" /* NO_EMBEDDED_ACCESS_CHECKS */
|
||||||
#include "sql_priv.h"
|
#include "sql_priv.h"
|
||||||
#include "sql_cache.h"
|
#include "sql_cache.h"
|
||||||
#include "sql_parse.h" // check_table_access
|
#include "sql_parse.h" // check_table_access
|
||||||
|
@ -25,6 +25,7 @@
|
|||||||
#pragma implementation // gcc: Class implementation
|
#pragma implementation // gcc: Class implementation
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include "my_global.h" /* NO_EMBEDDED_ACCESS_CHECKS */
|
||||||
#include "sql_priv.h"
|
#include "sql_priv.h"
|
||||||
#include "unireg.h" // REQUIRED: for other includes
|
#include "unireg.h" // REQUIRED: for other includes
|
||||||
#include "sql_class.h"
|
#include "sql_class.h"
|
||||||
|
@ -23,6 +23,7 @@
|
|||||||
#pragma interface /* gcc class implementation */
|
#pragma interface /* gcc class implementation */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include "my_global.h" /* NO_EMBEDDED_ACCESS_CHECKS */
|
||||||
#ifdef MYSQL_SERVER
|
#ifdef MYSQL_SERVER
|
||||||
#include "unireg.h" // REQUIRED: for other includes
|
#include "unireg.h" // REQUIRED: for other includes
|
||||||
#endif
|
#endif
|
||||||
|
@ -18,8 +18,8 @@
|
|||||||
Functions to autenticate and handle reqests for a connection
|
Functions to autenticate and handle reqests for a connection
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "sql_priv.h"
|
|
||||||
#include "my_global.h"
|
#include "my_global.h"
|
||||||
|
#include "sql_priv.h"
|
||||||
#ifndef __WIN__
|
#ifndef __WIN__
|
||||||
#include <netdb.h> // getservbyname, servent
|
#include <netdb.h> // getservbyname, servent
|
||||||
#endif
|
#endif
|
||||||
|
@ -16,6 +16,7 @@
|
|||||||
|
|
||||||
/* create and drop of databases */
|
/* create and drop of databases */
|
||||||
|
|
||||||
|
#include "my_global.h" /* NO_EMBEDDED_ACCESS_CHECKS */
|
||||||
#include "sql_priv.h"
|
#include "sql_priv.h"
|
||||||
#include "unireg.h"
|
#include "unireg.h"
|
||||||
#include "sql_db.h"
|
#include "sql_db.h"
|
||||||
|
@ -20,6 +20,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#include "my_global.h" /* NO_EMBEDDED_ACCESS_CHECKS */
|
||||||
#include "sql_priv.h"
|
#include "sql_priv.h"
|
||||||
#include "unireg.h"
|
#include "unireg.h"
|
||||||
#include "sql_derived.h"
|
#include "sql_derived.h"
|
||||||
|
@ -54,6 +54,7 @@
|
|||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "my_global.h" /* NO_EMBEDDED_ACCESS_CHECKS */
|
||||||
#include "sql_priv.h"
|
#include "sql_priv.h"
|
||||||
#include "unireg.h" // REQUIRED: for other includes
|
#include "unireg.h" // REQUIRED: for other includes
|
||||||
#include "sql_insert.h"
|
#include "sql_insert.h"
|
||||||
|
@ -14,6 +14,7 @@
|
|||||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||||
|
|
||||||
#define MYSQL_LEX 1
|
#define MYSQL_LEX 1
|
||||||
|
#include "my_global.h"
|
||||||
#include "sql_priv.h"
|
#include "sql_priv.h"
|
||||||
#include "unireg.h" // REQUIRED: for other includes
|
#include "unireg.h" // REQUIRED: for other includes
|
||||||
#include "sql_parse.h" // sql_kill, *_precheck, *_prepare
|
#include "sql_parse.h" // sql_kill, *_precheck, *_prepare
|
||||||
@ -94,6 +95,8 @@
|
|||||||
#include "probes_mysql.h"
|
#include "probes_mysql.h"
|
||||||
#include "set_var.h"
|
#include "set_var.h"
|
||||||
|
|
||||||
|
#define FLAGSTR(V,F) ((V)&(F)?#F" ":"")
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@defgroup Runtime_Environment Runtime Environment
|
@defgroup Runtime_Environment Runtime Environment
|
||||||
@{
|
@{
|
||||||
@ -2908,15 +2911,20 @@ end_with_restore_list:
|
|||||||
NOTE: SHOW_VIEW ACL is checked when the view is created.
|
NOTE: SHOW_VIEW ACL is checked when the view is created.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
DBUG_PRINT("debug", ("lex->only_view: %d, table: %s.%s",
|
||||||
|
lex->only_view,
|
||||||
|
first_table->db, first_table->table_name));
|
||||||
if (lex->only_view)
|
if (lex->only_view)
|
||||||
{
|
{
|
||||||
if (check_table_access(thd, SELECT_ACL, first_table, FALSE, 1, FALSE))
|
if (check_table_access(thd, SELECT_ACL, first_table, FALSE, 1, FALSE))
|
||||||
{
|
{
|
||||||
|
DBUG_PRINT("debug", ("check_table_access failed"));
|
||||||
my_error(ER_TABLEACCESS_DENIED_ERROR, MYF(0),
|
my_error(ER_TABLEACCESS_DENIED_ERROR, MYF(0),
|
||||||
"SHOW", thd->security_ctx->priv_user,
|
"SHOW", thd->security_ctx->priv_user,
|
||||||
thd->security_ctx->host_or_ip, first_table->alias);
|
thd->security_ctx->host_or_ip, first_table->alias);
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
DBUG_PRINT("debug", ("check_table_access succeeded"));
|
||||||
|
|
||||||
/* Ignore temporary tables if this is "SHOW CREATE VIEW" */
|
/* Ignore temporary tables if this is "SHOW CREATE VIEW" */
|
||||||
first_table->open_type= OT_BASE_ONLY;
|
first_table->open_type= OT_BASE_ONLY;
|
||||||
@ -2929,6 +2937,8 @@ end_with_restore_list:
|
|||||||
access is granted. We need to check if first_table->grant.privilege
|
access is granted. We need to check if first_table->grant.privilege
|
||||||
contains any table-specific privilege.
|
contains any table-specific privilege.
|
||||||
*/
|
*/
|
||||||
|
DBUG_PRINT("debug", ("first_table->grant.privilege: %x",
|
||||||
|
first_table->grant.privilege));
|
||||||
if (check_some_access(thd, SHOW_CREATE_TABLE_ACLS, first_table) ||
|
if (check_some_access(thd, SHOW_CREATE_TABLE_ACLS, first_table) ||
|
||||||
(first_table->grant.privilege & SHOW_CREATE_TABLE_ACLS) == 0)
|
(first_table->grant.privilege & SHOW_CREATE_TABLE_ACLS) == 0)
|
||||||
{
|
{
|
||||||
|
@ -16,6 +16,7 @@
|
|||||||
#ifndef SQL_PARSE_INCLUDED
|
#ifndef SQL_PARSE_INCLUDED
|
||||||
#define SQL_PARSE_INCLUDED
|
#define SQL_PARSE_INCLUDED
|
||||||
|
|
||||||
|
#include "my_global.h" /* NO_EMBEDDED_ACCESS_CHECKS */
|
||||||
#include "sql_acl.h" /* GLOBAL_ACLS */
|
#include "sql_acl.h" /* GLOBAL_ACLS */
|
||||||
|
|
||||||
class Comp_creator;
|
class Comp_creator;
|
||||||
@ -177,7 +178,10 @@ inline bool check_routine_access(THD *thd,ulong want_access,char *db,
|
|||||||
char *name, bool is_proc, bool no_errors)
|
char *name, bool is_proc, bool no_errors)
|
||||||
{ return false; }
|
{ return false; }
|
||||||
inline bool check_some_access(THD *thd, ulong want_access, TABLE_LIST *table)
|
inline bool check_some_access(THD *thd, ulong want_access, TABLE_LIST *table)
|
||||||
{ return false; }
|
{
|
||||||
|
table->grant.privilege= want_access;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
inline bool check_merge_table_access(THD *thd, char *db, TABLE_LIST *table_list)
|
inline bool check_merge_table_access(THD *thd, char *db, TABLE_LIST *table_list)
|
||||||
{ return false; }
|
{ return false; }
|
||||||
inline bool check_some_routine_access(THD *thd, const char *db,
|
inline bool check_some_routine_access(THD *thd, const char *db,
|
||||||
|
@ -83,6 +83,7 @@ When one supplies long data for a placeholder:
|
|||||||
at statement execute.
|
at statement execute.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "my_global.h" /* NO_EMBEDDED_ACCESS_CHECKS */
|
||||||
#include "sql_priv.h"
|
#include "sql_priv.h"
|
||||||
#include "unireg.h"
|
#include "unireg.h"
|
||||||
#include "sql_class.h" // set_var.h: THD
|
#include "sql_class.h" // set_var.h: THD
|
||||||
|
@ -16,6 +16,7 @@
|
|||||||
|
|
||||||
/* Function with list databases, tables or fields */
|
/* Function with list databases, tables or fields */
|
||||||
|
|
||||||
|
#include "my_global.h" /* NO_EMBEDDED_ACCESS_CHECKS */
|
||||||
#include "sql_priv.h"
|
#include "sql_priv.h"
|
||||||
#include "unireg.h"
|
#include "unireg.h"
|
||||||
#include "sql_acl.h" // fill_schema_*_privileges
|
#include "sql_acl.h" // fill_schema_*_privileges
|
||||||
|
@ -15,6 +15,7 @@
|
|||||||
|
|
||||||
|
|
||||||
#define MYSQL_LEX 1
|
#define MYSQL_LEX 1
|
||||||
|
#include "my_global.h" /* NO_EMBEDDED_ACCESS_CHECKS */
|
||||||
#include "sql_priv.h"
|
#include "sql_priv.h"
|
||||||
#include "unireg.h"
|
#include "unireg.h"
|
||||||
#include "sp_head.h"
|
#include "sp_head.h"
|
||||||
|
@ -19,6 +19,7 @@
|
|||||||
Multi-table updates were introduced by Sinisa & Monty
|
Multi-table updates were introduced by Sinisa & Monty
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "my_global.h" /* NO_EMBEDDED_ACCESS_CHECKS */
|
||||||
#include "sql_priv.h"
|
#include "sql_priv.h"
|
||||||
#include "unireg.h" // REQUIRED: for other includes
|
#include "unireg.h" // REQUIRED: for other includes
|
||||||
#include "sql_update.h"
|
#include "sql_update.h"
|
||||||
|
@ -15,6 +15,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#define MYSQL_LEX 1
|
#define MYSQL_LEX 1
|
||||||
|
#include "my_global.h" /* NO_EMBEDDED_ACCESS_CHECKS */
|
||||||
#include "sql_priv.h"
|
#include "sql_priv.h"
|
||||||
#include "unireg.h"
|
#include "unireg.h"
|
||||||
#include "sql_view.h"
|
#include "sql_view.h"
|
||||||
|
@ -27,6 +27,7 @@
|
|||||||
(for example in storage/myisam/ha_myisam.cc) !
|
(for example in storage/myisam/ha_myisam.cc) !
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "my_global.h" /* NO_EMBEDDED_ACCESS_CHECKS */
|
||||||
#include "sql_priv.h"
|
#include "sql_priv.h"
|
||||||
#include "sql_class.h" // set_var.h: THD
|
#include "sql_class.h" // set_var.h: THD
|
||||||
#include "sys_vars.h"
|
#include "sys_vars.h"
|
||||||
|
@ -16,6 +16,7 @@
|
|||||||
|
|
||||||
/* Some general useful functions */
|
/* Some general useful functions */
|
||||||
|
|
||||||
|
#include "my_global.h" /* NO_EMBEDDED_ACCESS_CHECKS */
|
||||||
#include "sql_priv.h"
|
#include "sql_priv.h"
|
||||||
#include "unireg.h" // REQUIRED: for other includes
|
#include "unireg.h" // REQUIRED: for other includes
|
||||||
#include "table.h"
|
#include "table.h"
|
||||||
|
@ -16,6 +16,7 @@
|
|||||||
along with this program; if not, write to the Free Software
|
along with this program; if not, write to the Free Software
|
||||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||||
|
|
||||||
|
#include "my_global.h" /* NO_EMBEDDED_ACCESS_CHECKS */
|
||||||
#include "sql_plist.h"
|
#include "sql_plist.h"
|
||||||
#include "sql_list.h" /* Sql_alloc */
|
#include "sql_list.h" /* Sql_alloc */
|
||||||
#include "mdl.h"
|
#include "mdl.h"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user