1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

support DEFINER=role and DEFINER=current_role

This commit is contained in:
Sergei Golubchik
2013-10-18 12:17:49 -07:00
parent b054700619
commit b2f16628cf
24 changed files with 1467 additions and 387 deletions

View File

@ -3153,9 +3153,11 @@ public:
}
void leave_locked_tables_mode();
int decide_logging_format(TABLE_LIST *tables);
void binlog_invoker() { m_binlog_invoker= TRUE; }
bool need_binlog_invoker() { return m_binlog_invoker; }
void get_definer(LEX_USER *definer);
enum need_invoker { INVOKER_NONE=0, INVOKER_USER, INVOKER_ROLE};
void binlog_invoker(bool role) { m_binlog_invoker= role ? INVOKER_ROLE : INVOKER_USER; }
enum need_invoker need_binlog_invoker() { return m_binlog_invoker; }
void get_definer(LEX_USER *definer, bool role);
void set_invoker(const LEX_STRING *user, const LEX_STRING *host)
{
invoker_user= *user;
@ -3230,14 +3232,15 @@ private:
Diagnostics_area main_da;
/**
It will be set TURE if CURRENT_USER() is called in account management
statements or default definer is set in CREATE/ALTER SP, SF, Event,
TRIGGER or VIEW statements.
It will be set if CURRENT_USER() or CURRENT_ROLE() is called in account
management statements or default definer is set in CREATE/ALTER SP, SF,
Event, TRIGGER or VIEW statements.
Current user will be binlogged into Query_log_event if m_binlog_invoker
is TRUE; It will be stored into invoker_host and invoker_user by SQL thread.
Current user or role will be binlogged into Query_log_event if
m_binlog_invoker is not NONE; It will be stored into invoker_host and
invoker_user by SQL thread.
*/
bool m_binlog_invoker;
enum need_invoker m_binlog_invoker;
/**
It points to the invoker in the Query_log_event.