summaryrefslogtreecommitdiff
path: root/sql/item_create.cc
diff options
context:
space:
mode:
authorunknown <kroki@mysql.com>2006-07-02 14:35:45 +0400
committerunknown <kroki@mysql.com>2006-07-02 14:35:45 +0400
commita2fc4843e38fcf12cacd526f1227cc0b30488bb5 (patch)
tree2c878e8f57af2a501208576c95d163f6b0d96de2 /sql/item_create.cc
parent9b871930a9189cce16b39dc5576f3592a34959ba (diff)
downloadmariadb-git-a2fc4843e38fcf12cacd526f1227cc0b30488bb5.tar.gz
Bug#20570: CURRENT_USER() in a VIEW with SQL SECURITY DEFINER returns
invoker name The bug was fixed similar to how context switch is handled in Item_func_sp::execute_impl(): we store pointer to current Name_resolution_context in Item_func_current_user class, and use its Security_context in Item_func_current_user::fix_fields(). mysql-test/r/view_grant.result: Add result for bug#20570. mysql-test/t/view_grant.test: Add test case for bug#20570. sql/item_create.cc: Remove create_func_current_user(), as it is not used for automatic function creation. sql/item_create.h: Remove prototype for create_func_current_user(). sql/item_strfunc.cc: Add implementations for Item_func_user::init(), Item_func_user::fix_fields() and Item_func_current_user::fix_fields() methods. The latter uses Security_context from current Name_resolution_context, if one is defined. sql/item_strfunc.h: Move implementation of CURRENT_USER() out of Item_func_user to to new Item_func_current_user class. For both classes calculate user name in fix_fields() method. For Item_func_current_user add context field to store Name_resolution_context in effect. sql/sql_yacc.yy: Pass current Name_resolution_context to Item_func_current_user.
Diffstat (limited to 'sql/item_create.cc')
-rw-r--r--sql/item_create.cc6
1 files changed, 0 insertions, 6 deletions
diff --git a/sql/item_create.cc b/sql/item_create.cc
index bfcb2101d60..7d57757432e 100644
--- a/sql/item_create.cc
+++ b/sql/item_create.cc
@@ -296,12 +296,6 @@ Item *create_func_pow(Item* a, Item *b)
return new Item_func_pow(a,b);
}
-Item *create_func_current_user()
-{
- current_thd->lex->safe_to_cache_query= 0;
- return new Item_func_user(TRUE);
-}
-
Item *create_func_radians(Item *a)
{
return new Item_func_units((char*) "radians",a,M_PI/180,0.0);