diff options
author | Sergei Golubchik <sergii@pisem.net> | 2013-10-18 12:17:49 -0700 |
---|---|---|
committer | Sergei Golubchik <sergii@pisem.net> | 2013-10-18 12:17:49 -0700 |
commit | b2f16628cf4500111d59a8e52cc44851742ddfcc (patch) | |
tree | a09b5dcacded4cf82fc40707874e39feb8a72e7a /sql/structs.h | |
parent | b0547006192730d6281ca96f2151802ee7fe2ba0 (diff) | |
download | mariadb-git-b2f16628cf4500111d59a8e52cc44851742ddfcc.tar.gz |
support DEFINER=role and DEFINER=current_role
Diffstat (limited to 'sql/structs.h')
-rw-r--r-- | sql/structs.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/sql/structs.h b/sql/structs.h index a3a54c524e6..f4b85433e3a 100644 --- a/sql/structs.h +++ b/sql/structs.h @@ -190,6 +190,14 @@ typedef int *(*update_var)(THD *, struct st_mysql_show_var *); typedef struct st_lex_user { LEX_STRING user, host, password, plugin, auth; + bool is_role() { return user.str[0] && !host.str[0]; } + void set_lex_string(LEX_STRING *l, char *buf) + { + if (is_role()) + *l= user; + else + l->length= strxmov(l->str= buf, user.str, "@", host.str, NullS) - buf; + } } LEX_USER; /* |