1--source include/have_udf.inc
2--source include/have_query_cache.inc
3#
4# To run this tests the "sql/udf_example.c" need to be compiled into
5# udf_example.so and LD_LIBRARY_PATH should be setup to point out where
6# the library are.
7#
8
9--disable_warnings
10drop table if exists t1;
11--enable_warnings
12
13#
14# Bug #28921: Queries containing UDF functions are cached
15#
16
17--replace_result $UDF_EXAMPLE_SO UDF_EXAMPLE_LIB
18eval CREATE FUNCTION metaphon RETURNS STRING SONAME "$UDF_EXAMPLE_SO";
19create table t1 (a char);
20
21set @save_query_cache_size=@@query_cache_size;
22set GLOBAL query_cache_size=1355776;
23reset query cache;
24flush status;
25
26select metaphon('MySQL') from t1;
27show status like "Qcache_hits";
28show status like "Qcache_queries_in_cache";
29
30select metaphon('MySQL') from t1;
31show status like "Qcache_hits";
32show status like "Qcache_queries_in_cache";
33
34drop table t1;
35drop function metaphon;
36set GLOBAL query_cache_size=@save_query_cache_size;
37
38
39