diff options
author | Sergei Golubchik <sergii@pisem.net> | 2013-10-18 06:55:26 -0700 |
---|---|---|
committer | Sergei Golubchik <sergii@pisem.net> | 2013-10-18 06:55:26 -0700 |
commit | 8122996a599fcb6dc600f27fddbed47a2579c6b8 (patch) | |
tree | d27476e2a6491b2b7ffa5247df617a14b6bfd4c0 /sql/item_strfunc.h | |
parent | 1ac0b920d572ec393a2b482b6fa0686a6708abdd (diff) | |
download | mariadb-git-8122996a599fcb6dc600f27fddbed47a2579c6b8.tar.gz |
CURRENT_ROLE() function
Diffstat (limited to 'sql/item_strfunc.h')
-rw-r--r-- | sql/item_strfunc.h | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/sql/item_strfunc.h b/sql/item_strfunc.h index e09dee18d4f..8d9bda4902e 100644 --- a/sql/item_strfunc.h +++ b/sql/item_strfunc.h @@ -580,6 +580,28 @@ public: }; +class Item_func_current_role :public Item_func_sysconst +{ + Name_resolution_context *context; + +public: + Item_func_current_role(Name_resolution_context *context_arg) + : context(context_arg) {} + bool fix_fields(THD *thd, Item **ref); + void fix_length_and_dec() + { max_length= username_char_length * SYSTEM_CHARSET_MBMAXLEN; } + int save_in_field(Field *field, bool no_conversions) + { return save_str_value_in_field(field, &str_value); } + const char *func_name() const { return "current_role"; } + const char *fully_qualified_func_name() const { return "current_role()"; } + String *val_str(String *) + { + DBUG_ASSERT(fixed == 1); + return (null_value ? 0 : &str_value); + } +}; + + class Item_func_soundex :public Item_str_func { String tmp_value; |