summaryrefslogtreecommitdiff
path: root/mysql-test/r
diff options
context:
space:
mode:
authorkostja@bodhi.(none) <>2007-11-01 00:31:57 +0300
committerkostja@bodhi.(none) <>2007-11-01 00:31:57 +0300
commit26326ed0b7a630fd2990d560b009895fa1ea818f (patch)
treebcaa91f1539817a06d3c4e08a7e7caf42e152c40 /mysql-test/r
parent21fffd89cf2c54b3862737240c3176219656e190 (diff)
downloadmariadb-git-26326ed0b7a630fd2990d560b009895fa1ea818f.tar.gz
A fix for Bug#32007 select udf_function() doesn't return an error if error
during udf initialization. The bug is spotted while working on Bug 12713. If a user-defined function was used in a SELECT statement, and an error would occur during UDF initialization, this error would not terminate execution of the SELECT, but rather would be converted to a warning. The fix is to use a stack buffer to store the message from udf_init instead of private my_error() buffer.
Diffstat (limited to 'mysql-test/r')
-rw-r--r--mysql-test/r/udf.result12
1 files changed, 6 insertions, 6 deletions
diff --git a/mysql-test/r/udf.result b/mysql-test/r/udf.result
index da27a71c1a1..cb5afcf5f17 100644
--- a/mysql-test/r/udf.result
+++ b/mysql-test/r/udf.result
@@ -11,7 +11,7 @@ RETURNS STRING SONAME "UDF_EXAMPLE_LIB";
CREATE AGGREGATE FUNCTION avgcost
RETURNS REAL SONAME "UDF_EXAMPLE_LIB";
select myfunc_double();
-ERROR HY000: myfunc_double must have at least one argument
+ERROR HY000: Can't initialize function 'myfunc_double'; myfunc_double must have at least one argument
select myfunc_double(1);
myfunc_double(1)
49.00
@@ -24,26 +24,26 @@ select myfunc_int();
myfunc_int()
0
select lookup();
-ERROR HY000: Wrong arguments to lookup; Use the source
+ERROR HY000: Can't initialize function 'lookup'; Wrong arguments to lookup; Use the source
select lookup("127.0.0.1");
lookup("127.0.0.1")
127.0.0.1
select lookup(127,0,0,1);
-ERROR HY000: Wrong arguments to lookup; Use the source
+ERROR HY000: Can't initialize function 'lookup'; Wrong arguments to lookup; Use the source
select lookup("localhost");
lookup("localhost")
127.0.0.1
select reverse_lookup();
-ERROR HY000: Wrong number of arguments to reverse_lookup; Use the source
+ERROR HY000: Can't initialize function 'reverse_lookup'; Wrong number of arguments to reverse_lookup; Use the source
select reverse_lookup("127.0.0.1");
select reverse_lookup(127,0,0,1);
select reverse_lookup("localhost");
reverse_lookup("localhost")
NULL
select avgcost();
-ERROR HY000: wrong number of arguments: AVGCOST() requires two arguments
+ERROR HY000: Can't initialize function 'avgcost'; wrong number of arguments: AVGCOST() requires two arguments
select avgcost(100,23.76);
-ERROR HY000: wrong argument type: AVGCOST() requires an INT and a REAL
+ERROR HY000: Can't initialize function 'avgcost'; wrong argument type: AVGCOST() requires an INT and a REAL
create table t1(sum int, price float(24));
insert into t1 values(100, 50.00), (100, 100.00);
select avgcost(sum, price) from t1;