summaryrefslogtreecommitdiff
path: root/sql/sql_class.h
diff options
context:
space:
mode:
author <Li-Bing.Song@sun.com>2010-07-04 12:36:09 +0800
committer <Li-Bing.Song@sun.com>2010-07-04 12:36:09 +0800
commitfe6ab9a06bbd46e4a53c76baacb934d1e4b94768 (patch)
tree4c324a2eff6dec16929d5e86816393b3080c54ca /sql/sql_class.h
parent1c712120deff47984c114272ddab5c48970331b6 (diff)
parent42eecc539a5ba7ffd639192d63273c2d2dc1fc9a (diff)
downloadmariadb-git-fe6ab9a06bbd46e4a53c76baacb934d1e4b94768.tar.gz
Manul merge
Diffstat (limited to 'sql/sql_class.h')
-rw-r--r--sql/sql_class.h31
1 files changed, 31 insertions, 0 deletions
diff --git a/sql/sql_class.h b/sql/sql_class.h
index 7c865d6cae1..269c2418ec8 100644
--- a/sql/sql_class.h
+++ b/sql/sql_class.h
@@ -2716,6 +2716,18 @@ public:
}
void leave_locked_tables_mode();
int decide_logging_format(TABLE_LIST *tables);
+ void set_current_user_used() { current_user_used= TRUE; }
+ bool is_current_user_used() { return current_user_used; }
+ void clean_current_user_used() { current_user_used= FALSE; }
+ void get_definer(LEX_USER *definer);
+ void set_invoker(const LEX_STRING *user, const LEX_STRING *host)
+ {
+ invoker_user= *user;
+ invoker_host= *host;
+ }
+ LEX_STRING get_invoker_user() { return invoker_user; }
+ LEX_STRING get_invoker_host() { return invoker_host; }
+ bool has_invoker() { return invoker_user.length > 0; }
private:
/** The current internal error handler for this thread, or NULL. */
@@ -2738,6 +2750,25 @@ private:
MEM_ROOT main_mem_root;
Warning_info main_warning_info;
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.
+
+ Current user will be binlogged into Query_log_event if current_user_used
+ is TRUE; It will be stored into invoker_host and invoker_user by SQL thread.
+ */
+ bool current_user_used;
+
+ /**
+ It points to the invoker in the Query_log_event.
+ SQL thread use it as the default definer in CREATE/ALTER SP, SF, Event,
+ TRIGGER or VIEW statements or current user in account management
+ statements if it is not NULL.
+ */
+ LEX_STRING invoker_user;
+ LEX_STRING invoker_host;
};