Commit 77c6cfc2 authored by unknown's avatar unknown

SCRUM

WL#604 Privileges in embedded library
bugs fixed


sql/mysql_priv.h:
  reload_acl_and_cache interface unifdefed
sql/sql_parse.cc:
  ifdefs added/removed
parent 2796f519
...@@ -398,9 +398,9 @@ void table_cache_free(void); ...@@ -398,9 +398,9 @@ void table_cache_free(void);
uint cached_tables(void); uint cached_tables(void);
void kill_mysql(void); void kill_mysql(void);
void close_connection(THD *thd, uint errcode, bool lock); void close_connection(THD *thd, uint errcode, bool lock);
#ifndef NO_EMBEDDED_ACCESS_CHECKS
bool reload_acl_and_cache(THD *thd, ulong options, TABLE_LIST *tables, bool reload_acl_and_cache(THD *thd, ulong options, TABLE_LIST *tables,
bool *write_to_binlog); bool *write_to_binlog);
#ifndef NO_EMBEDDED_ACCESS_CHECKS
bool check_access(THD *thd, ulong access, const char *db, ulong *save_priv, bool check_access(THD *thd, ulong access, const char *db, ulong *save_priv,
bool no_grant, bool no_errors); bool no_grant, bool no_errors);
bool check_table_access(THD *thd, ulong want_access, TABLE_LIST *tables, bool check_table_access(THD *thd, ulong want_access, TABLE_LIST *tables,
......
...@@ -1430,7 +1430,6 @@ bool dispatch_command(enum enum_server_command command, THD *thd, ...@@ -1430,7 +1430,6 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
break; break;
} }
#endif #endif
#ifndef NO_EMBEDDED_ACCESS_CHECKS
case COM_REFRESH: case COM_REFRESH:
{ {
statistic_increment(com_stat[SQLCOM_FLUSH],&LOCK_status); statistic_increment(com_stat[SQLCOM_FLUSH],&LOCK_status);
...@@ -1444,7 +1443,6 @@ bool dispatch_command(enum enum_server_command command, THD *thd, ...@@ -1444,7 +1443,6 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
send_ok(thd); send_ok(thd);
break; break;
} }
#endif
#ifndef EMBEDDED_LIBRARY #ifndef EMBEDDED_LIBRARY
case COM_SHUTDOWN: case COM_SHUTDOWN:
statistic_increment(com_other,&LOCK_status); statistic_increment(com_other,&LOCK_status);
...@@ -1649,7 +1647,7 @@ mysql_execute_command(THD *thd) ...@@ -1649,7 +1647,7 @@ mysql_execute_command(THD *thd)
*/ */
thd->old_total_warn_count= thd->total_warn_count; thd->old_total_warn_count= thd->total_warn_count;
#ifdef HAVE_REPLICATON #ifdef HAVE_REPLICATION
if (thd->slave_thread) if (thd->slave_thread)
{ {
/* /*
...@@ -3111,6 +3109,7 @@ mysql_execute_command(THD *thd) ...@@ -3111,6 +3109,7 @@ mysql_execute_command(THD *thd)
} }
break; break;
} }
#endif /*!NO_EMBEDDED_ACCESS_CHECKS*/
case SQLCOM_RESET: case SQLCOM_RESET:
/* /*
RESET commands are never written to the binary log, so we have to RESET commands are never written to the binary log, so we have to
...@@ -3147,7 +3146,6 @@ mysql_execute_command(THD *thd) ...@@ -3147,7 +3146,6 @@ mysql_execute_command(THD *thd)
} }
break; break;
} }
#endif /*!NO_EMBEDDED_ACCESS_CHECKS*/
case SQLCOM_KILL: case SQLCOM_KILL:
kill_one_thread(thd,lex->thread_id); kill_one_thread(thd,lex->thread_id);
break; break;
...@@ -4352,7 +4350,6 @@ void add_join_natural(TABLE_LIST *a,TABLE_LIST *b) ...@@ -4352,7 +4350,6 @@ void add_join_natural(TABLE_LIST *a,TABLE_LIST *b)
b->natural_join=a; b->natural_join=a;
} }
#ifndef NO_EMBEDDED_ACCESS_CHECKS
/* /*
Reload/resets privileges and the different caches. Reload/resets privileges and the different caches.
...@@ -4379,6 +4376,7 @@ bool reload_acl_and_cache(THD *thd, ulong options, TABLE_LIST *tables, ...@@ -4379,6 +4376,7 @@ bool reload_acl_and_cache(THD *thd, ulong options, TABLE_LIST *tables,
bool result=0; bool result=0;
select_errors=0; /* Write if more errors */ select_errors=0; /* Write if more errors */
bool tmp_write_to_binlog= 1; bool tmp_write_to_binlog= 1;
#ifndef NO_EMBEDDED_ACCESS_CHECKS
if (options & REFRESH_GRANT) if (options & REFRESH_GRANT)
{ {
acl_reload(thd); acl_reload(thd);
...@@ -4386,6 +4384,7 @@ bool reload_acl_and_cache(THD *thd, ulong options, TABLE_LIST *tables, ...@@ -4386,6 +4384,7 @@ bool reload_acl_and_cache(THD *thd, ulong options, TABLE_LIST *tables,
if (mqh_used) if (mqh_used)
reset_mqh(thd,(LEX_USER *) NULL,true); reset_mqh(thd,(LEX_USER *) NULL,true);
} }
#endif
if (options & REFRESH_LOG) if (options & REFRESH_LOG)
{ {
/* /*
...@@ -4476,14 +4475,14 @@ bool reload_acl_and_cache(THD *thd, ulong options, TABLE_LIST *tables, ...@@ -4476,14 +4475,14 @@ bool reload_acl_and_cache(THD *thd, ulong options, TABLE_LIST *tables,
UNLOCK_ACTIVE_MI; UNLOCK_ACTIVE_MI;
} }
#endif #endif
#ifndef NO_EMBEDDED_ACCESS_CHECKS
if (options & REFRESH_USER_RESOURCES) if (options & REFRESH_USER_RESOURCES)
reset_mqh(thd,(LEX_USER *) NULL); reset_mqh(thd,(LEX_USER *) NULL);
#endif
if (write_to_binlog) if (write_to_binlog)
*write_to_binlog= tmp_write_to_binlog; *write_to_binlog= tmp_write_to_binlog;
return result; return result;
} }
#endif /*!NO_EMBEDDED_ACCESS_CHECKS*/
/* /*
kill on thread kill on thread
......
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