diff --git a/mysql-test/r/sp.result b/mysql-test/r/sp.result
index fd7c4c6686a7cfcd3652174fe7ab1f2f365cb99b..448428d07f43de29c858319de0c45031696b30d3 100644
--- a/mysql-test/r/sp.result
+++ b/mysql-test/r/sp.result
@@ -6231,5 +6231,6 @@ id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
 1	SIMPLE	t1	index	NULL	c1	5	NULL	5	Using where; Using index
 DROP VIEW v1;
 DROP FUNCTION f1;
+DROP FUNCTION f2;
 DROP TABLE t1;
 End of 5.0 tests
diff --git a/mysql-test/t/sp.test b/mysql-test/t/sp.test
index 2bd499fd78a6dd2dd7371c698d4edf9907cd1d92..5aaf4f21ae02858b83a0c61b0ae8184bdddb98a2 100644
--- a/mysql-test/t/sp.test
+++ b/mysql-test/t/sp.test
@@ -7201,6 +7201,7 @@ EXPLAIN SELECT * FROM t1 WHERE c1=f2(rand());
 
 DROP VIEW v1;
 DROP FUNCTION f1;
+DROP FUNCTION f2;
 DROP TABLE t1;
 
 --echo End of 5.0 tests