summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authordkatz@damien-katzs-computer.local <>2007-06-18 17:55:12 -0400
committerdkatz@damien-katzs-computer.local <>2007-06-18 17:55:12 -0400
commitb7a2b413742d8e890c114baceef646f01e44972a (patch)
tree6cb9457efdee46117caa7be00d856224f40cd7ae /mysql-test
parent46772d36e2e63bc34f8e32665761f1061075a281 (diff)
downloadmariadb-git-b7a2b413742d8e890c114baceef646f01e44972a.tar.gz
Bug #28921 Queries containing UDF functions are cached
Fixed runtime to no longer allow the caching of queries with UDF calls.
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/udf.result23
-rw-r--r--mysql-test/t/udf.test24
2 files changed, 47 insertions, 0 deletions
diff --git a/mysql-test/r/udf.result b/mysql-test/r/udf.result
index 7c52e7da496..2e9cf217ed6 100644
--- a/mysql-test/r/udf.result
+++ b/mysql-test/r/udf.result
@@ -273,4 +273,27 @@ drop function f3;
drop function metaphon;
drop function myfunc_double;
drop function myfunc_int;
+CREATE FUNCTION metaphon RETURNS STRING SONAME "UDF_EXAMPLE_LIB";
+create table t1 (a char);
+set GLOBAL query_cache_size=1355776;
+reset query cache;
+select metaphon('MySQL') from t1;
+metaphon('MySQL')
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 0
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 0
+select metaphon('MySQL') from t1;
+metaphon('MySQL')
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 0
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 0
+drop table t1;
+drop function metaphon;
+set GLOBAL query_cache_size=default;
End of 5.0 tests.
diff --git a/mysql-test/t/udf.test b/mysql-test/t/udf.test
index 0b582dc61b6..75af1f4be4b 100644
--- a/mysql-test/t/udf.test
+++ b/mysql-test/t/udf.test
@@ -288,4 +288,28 @@ drop function metaphon;
drop function myfunc_double;
drop function myfunc_int;
+#
+# Bug #28921: Queries containing UDF functions are cached
+#
+
+--replace_result $UDF_EXAMPLE_LIB UDF_EXAMPLE_LIB
+eval CREATE FUNCTION metaphon RETURNS STRING SONAME "$UDF_EXAMPLE_LIB";
+create table t1 (a char);
+
+set GLOBAL query_cache_size=1355776;
+reset query cache;
+
+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=default;
+
+
--echo End of 5.0 tests.