summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mysql-test/r/query_cache.result2
-rw-r--r--mysql-test/t/query_cache.test1
-rw-r--r--sql/item_create.cc1
3 files changed, 4 insertions, 0 deletions
diff --git a/mysql-test/r/query_cache.result b/mysql-test/r/query_cache.result
index 5fe00e70d3d..5385eec6da3 100644
--- a/mysql-test/r/query_cache.result
+++ b/mysql-test/r/query_cache.result
@@ -299,6 +299,8 @@ select UNIX_TIMESTAMP() from t1;
UNIX_TIMESTAMP()
select USER() from t1;
USER()
+select CURRENT_USER() from t1;
+CURRENT_USER()
select benchmark(1,1) from t1;
benchmark(1,1)
explain extended select benchmark(1,1) from t1;
diff --git a/mysql-test/t/query_cache.test b/mysql-test/t/query_cache.test
index b0148a689af..ad36d8b425a 100644
--- a/mysql-test/t/query_cache.test
+++ b/mysql-test/t/query_cache.test
@@ -184,6 +184,7 @@ select LAST_INSERT_ID() from t1;
select RAND() from t1;
select UNIX_TIMESTAMP() from t1;
select USER() from t1;
+select CURRENT_USER() from t1;
select benchmark(1,1) from t1;
explain extended select benchmark(1,1) from t1;
show status like "Qcache_queries_in_cache";
diff --git a/sql/item_create.cc b/sql/item_create.cc
index c0361c928be..4b313d49466 100644
--- a/sql/item_create.cc
+++ b/sql/item_create.cc
@@ -306,6 +306,7 @@ Item *create_func_current_user()
char buff[HOSTNAME_LENGTH+USERNAME_LENGTH+2];
uint length;
+ thd->safe_to_cache_query= 0;
length= (uint) (strxmov(buff, thd->priv_user, "@", thd->priv_host, NullS) -
buff);
return new Item_string(NullS, thd->memdup(buff, length), length,