diff options
author | unknown <pem@mysql.com> | 2006-02-09 13:00:32 +0100 |
---|---|---|
committer | unknown <pem@mysql.com> | 2006-02-09 13:00:32 +0100 |
commit | 0fd784928c340968967a104dd0191837549ee8a3 (patch) | |
tree | f93894a80801e8bd4b71a67e4687a69be4eb237c /sql/udf_example.cc | |
parent | 5ffc2dc202e49607b91851f3e44f60f49f175294 (diff) | |
download | mariadb-git-0fd784928c340968967a104dd0191837549ee8a3.tar.gz |
Fixed BUG#16896: Stored function: unused AGGREGATE-clause in CREATE FUNCTION
Check if AGGREGATE was given with a stored (non-UDF) function, and return
error in that case.
Also made udf_example/udf_test work again, by adding a missing *_init()
function. (_init() functions required unless --allow_suspicious_udfs is
given to the server, since March 2005 - it seems udf_example wasn't updated
at the time.)
mysql-test/r/sp-error.result:
Updated results for BUG#16896.
mysql-test/t/sp-error.test:
Added test case for BUG#16896.
sql/share/errmsg.txt:
New error message: ER_SP_NO_AGGREGATE
sql/sql_yacc.yy:
Check if AGGREGATE was used when creating a stored function (i.e. not an UDF).
sql/udf_example.cc:
Added myfunc_int_init() function to make it work when the server is running without
--allow_suspicious_udfs.
Diffstat (limited to 'sql/udf_example.cc')
-rw-r--r-- | sql/udf_example.cc | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/sql/udf_example.cc b/sql/udf_example.cc index a186b4fbf6c..35833e63fab 100644 --- a/sql/udf_example.cc +++ b/sql/udf_example.cc @@ -144,6 +144,7 @@ char *metaphon(UDF_INIT *initid, UDF_ARGS *args, char *result, my_bool myfunc_double_init(UDF_INIT *, UDF_ARGS *args, char *message); double myfunc_double(UDF_INIT *initid, UDF_ARGS *args, char *is_null, char *error); +my_bool myfunc_int_init(UDF_INIT *initid, UDF_ARGS *args, char *message); longlong myfunc_int(UDF_INIT *initid, UDF_ARGS *args, char *is_null, char *error); my_bool sequence_init(UDF_INIT *initid, UDF_ARGS *args, char *message); @@ -597,6 +598,14 @@ longlong myfunc_int(UDF_INIT *initid, UDF_ARGS *args, char *is_null, return val; } +/* + At least one of _init/_deinit is needed unless the server is started + with --allow_suspicious_udfs. +*/ +my_bool myfunc_int_init(UDF_INIT *initid, UDF_ARGS *args, char *message) +{ + return 0; +} /* Simple example of how to get a sequences starting from the first argument |