summaryrefslogtreecommitdiffstats
path: root/mysql-test/main/udf_query_cache.test
blob: 99cbffb1aaef0d2711de932d7e527ff7583ebe6f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
--source include/have_udf.inc
--source include/have_query_cache.inc
#
# To run this tests the "sql/udf_example.c" need to be compiled into
# udf_example.so and LD_LIBRARY_PATH should be setup to point out where
# the library are.
#

--disable_warnings
drop table if exists t1;
--enable_warnings

#
# Bug #28921: Queries containing UDF functions are cached
#

--replace_result $UDF_EXAMPLE_SO UDF_EXAMPLE_LIB
eval CREATE FUNCTION metaphon RETURNS STRING SONAME "$UDF_EXAMPLE_SO";
create table t1 (a char);

set @save_query_cache_size=@@query_cache_size;
set GLOBAL query_cache_size=1355776;
reset query cache;
flush status;

select metaphon('MySQL') from t1;
show status like "Qcache_hits";
show status like "Qcache_queries_in_cache";

select metaphon('MySQL') from t1;
show status like "Qcache_hits";
show status like "Qcache_queries_in_cache";

drop table t1;
drop function metaphon;
set GLOBAL query_cache_size=@save_query_cache_size;