summaryrefslogtreecommitdiff
path: root/sql/item_create.cc
diff options
context:
space:
mode:
authorunknown <bell@sanja.is.com.ua>2004-08-24 18:46:27 +0300
committerunknown <bell@sanja.is.com.ua>2004-08-24 18:46:27 +0300
commitc688b7b882e9eda4e19c8db0715184a802446756 (patch)
tree1ab4dfcca9834d0531f3f48f719fbae7ea8fc3b4 /sql/item_create.cc
parent46a0c8a7df4ef7cc53bbade3ffcbff4b4a046fd8 (diff)
downloadmariadb-git-c688b7b882e9eda4e19c8db0715184a802446756.tar.gz
items for functions which is converted to constants internally to support its correct printing added (BUG#4663)
mysql-test/r/view.result: test of functions in VIEW which is converted to constants internally mysql-test/t/view.test: test of functions in VIEW which is converted to constants internally sql/item.h: items for functions which is converted to constants internally to support its correct printing sql/item_create.cc: items for functions which is converted to constants internally to support its correct printing
Diffstat (limited to 'sql/item_create.cc')
-rw-r--r--sql/item_create.cc22
1 files changed, 12 insertions, 10 deletions
diff --git a/sql/item_create.cc b/sql/item_create.cc
index e2c85af49bc..02cface827b 100644
--- a/sql/item_create.cc
+++ b/sql/item_create.cc
@@ -73,12 +73,13 @@ Item *create_func_connection_id(void)
{
THD *thd=current_thd;
thd->lex->safe_to_cache_query= 0;
- return new Item_int(NullS,(longlong)
- ((thd->slave_thread) ?
- thd->variables.pseudo_thread_id :
- thd->thread_id),
- 10);
-}
+ return new Item_static_int_func("connection_id()",
+ (longlong)
+ ((thd->slave_thread) ?
+ thd->variables.pseudo_thread_id :
+ thd->thread_id),
+ 10);
+}
Item *create_func_conv(Item* a, Item *b, Item *c)
{
@@ -293,7 +294,7 @@ Item *create_func_period_diff(Item* a, Item *b)
Item *create_func_pi(void)
{
- return new Item_real("pi()",M_PI,6,8);
+ return new Item_static_real_func("pi()", M_PI, 6, 8);
}
Item *create_func_pow(Item* a, Item *b)
@@ -309,8 +310,9 @@ Item *create_func_current_user()
length= (uint) (strxmov(buff, thd->priv_user, "@", thd->priv_host, NullS) -
buff);
- return new Item_string(NullS, thd->memdup(buff, length), length,
- system_charset_info);
+ return new Item_static_string_func("current_user()",
+ thd->memdup(buff, length), length,
+ system_charset_info);
}
Item *create_func_radians(Item *a)
@@ -434,7 +436,7 @@ Item *create_func_uuid(void)
Item *create_func_version(void)
{
- return new Item_string(NullS,server_version,
+ return new Item_static_string_func("version()", server_version,
(uint) strlen(server_version),
system_charset_info, DERIVATION_IMPLICIT);
}