diff options
author | unknown <bell@sanja.is.com.ua> | 2005-07-16 00:01:44 +0300 |
---|---|---|
committer | unknown <bell@sanja.is.com.ua> | 2005-07-16 00:01:44 +0300 |
commit | e84229b010b279802efca085d689de105fdcf0ad (patch) | |
tree | de6fdc4eef81f0fdbebcb593058845bff65263d0 /sql/item_create.cc | |
parent | 5ae3967c878ac7cfb8475eeeb50c2ebd81f39cf6 (diff) | |
download | mariadb-git-e84229b010b279802efca085d689de105fdcf0ad.tar.gz |
stop evaluation constant functions in WHERE (BUG#4663)
correct value of CURRENT_USER() in SP with "security definer" (BUG#7291)
BitKeeper/etc/config:
switch off open logging
mysql-test/r/sp-security.result:
correct value from current_user() in function run from "security definer"
mysql-test/r/view.result:
evaluation constant functions in WHERE (BUG#4663)
mysql-test/t/sp-security.test:
correct value from current_user() in function run from "security definer"
mysql-test/t/view.test:
evaluation constant functions in WHERE (BUG#4663)
sql/item.cc:
Item_static_string_func creation if it is need
sql/item.h:
support of Item_static_string_func creation
sql/item_cmpfunc.cc:
do not evaluate items during view creation
sql/item_create.cc:
create Item_func_user
sql/item_strfunc.cc:
Item_func_sysconst in case of converting value still have to correctly print itself
=> use Item_static_string_func instead of Item_string
Item_func_user return USER() or CURRENT_USER()
sql/item_strfunc.h:
support of correct charset conversion procedure in Item_func_sysconst
sql/sql_class.h:
new method
sql/sql_yacc.yy:
Item_func_user now support both USER() and CURRENT_USER(), so we have to pass parametr what it is
Diffstat (limited to 'sql/item_create.cc')
-rw-r--r-- | sql/item_create.cc | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/sql/item_create.cc b/sql/item_create.cc index b9073a6c0b3..b7d8d50f9b3 100644 --- a/sql/item_create.cc +++ b/sql/item_create.cc @@ -299,16 +299,8 @@ Item *create_func_pow(Item* a, Item *b) Item *create_func_current_user() { - THD *thd=current_thd; - char buff[HOSTNAME_LENGTH+USERNAME_LENGTH+2]; - uint length; - - thd->lex->safe_to_cache_query= 0; - length= (uint) (strxmov(buff, thd->priv_user, "@", thd->priv_host, NullS) - - buff); - return new Item_static_string_func("current_user()", - thd->memdup(buff, length), length, - system_charset_info); + current_thd->lex->safe_to_cache_query= 0; + return new Item_func_user(TRUE); } Item *create_func_radians(Item *a) |