diff options
author | unknown <bell@sanja.is.com.ua> | 2003-09-13 17:47:59 +0300 |
---|---|---|
committer | unknown <bell@sanja.is.com.ua> | 2003-09-13 17:47:59 +0300 |
commit | 07e372cd6b3a89d301fc44b5359fac01e285aa76 (patch) | |
tree | a3c9c07d2cdb16d8472b0fd27ea2edbe9f55cfe3 /tests | |
parent | 55e776d14565ea6ee9841612069c24f6b8a3023c (diff) | |
download | mariadb-git-07e372cd6b3a89d301fc44b5359fac01e285aa76.tar.gz |
new UDF arguments interface (WL#1017) (SCRUM)
include/mysql_com.h:
new UDF arguments interface
sql/item.cc:
added lenghth name foe item (to avoid strlen() call)
sql/item.h:
added lenghth name foe item (to avoid strlen() call)
sql/item_func.cc:
new UDF arguments
sql/sql_parse.cc:
fixed problem with UDF in 5.0
sql/sql_yacc.yy:
new syntax of UDF arguments
sql/udf_example.cc:
new UDF example (stupid function to test parameters)
tests/udf_test.res:
new UDF example (stupid function to test parameters)
tests/udf_test:
new UDF example (stupid function to test parameters)
Diffstat (limited to 'tests')
-rw-r--r-- | tests/udf_test | 3 | ||||
-rw-r--r-- | tests/udf_test.res | 24 |
2 files changed, 27 insertions, 0 deletions
diff --git a/tests/udf_test b/tests/udf_test index 4621a7b34a5..2bdacc34d13 100644 --- a/tests/udf_test +++ b/tests/udf_test @@ -9,6 +9,7 @@ CREATE FUNCTION myfunc_int RETURNS INTEGER SONAME "udf_example.so"; CREATE FUNCTION lookup RETURNS STRING SONAME "udf_example.so"; CREATE FUNCTION reverse_lookup RETURNS STRING SONAME "udf_example.so"; CREATE AGGREGATE FUNCTION avgcost RETURNS REAL SONAME "udf_example.so"; +CREATE FUNCTION myfunc_argument_name RETURNS STRING SONAME "udf_example.so"; select metaphon("hello"); select myfunc_double("hello","world"); @@ -20,6 +21,7 @@ create temporary table t1 (a int,b double); insert into t1 values (1,5),(1,4),(2,8),(3,9),(4,11); select avgcost(a,b) from t1; select avgcost(a,b) from t1 group by a; +select a, myfunc_argument_name(a) from t1; drop table t1; DROP FUNCTION metaphon; @@ -28,3 +30,4 @@ DROP FUNCTION myfunc_int; DROP FUNCTION lookup; DROP FUNCTION reverse_lookup; DROP FUNCTION avgcost; +DROP FUNCTION myfunc_argument_name; diff --git a/tests/udf_test.res b/tests/udf_test.res index 66634e13616..cd65d3794d8 100644 --- a/tests/udf_test.res +++ b/tests/udf_test.res @@ -35,6 +35,12 @@ CREATE AGGREGATE FUNCTION avgcost RETURNS REAL SONAME "udf_example.so" Query OK, 0 rows affected -------------- +CREATE FUNCTION myfunc_argument_name RETURNS STRING SONAME "udf_example.so" +-------------- + +Query OK, 0 rows affected + +-------------- select metaphon("hello") -------------- @@ -107,6 +113,18 @@ avgcost(a,b) 4 rows in set -------------- +select a, myfunc_argument_name(a) from t1; +-------------- + +a myfunc_argument_name(a) +1 a +1 a +2 a +3 a +4 a +5 rows in set + +-------------- drop table t1 -------------- @@ -148,4 +166,10 @@ DROP FUNCTION avgcost Query OK, 0 rows affected +-------------- +DROP FUNCTION myfunc_argument_name; +-------------- + +Query OK, 0 rows affected + Bye |