mirror of
https://github.com/MariaDB/server.git
synced 2026-05-15 03:17:20 +02:00
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)
This commit is contained in:
parent
55e776d145
commit
07e372cd6b
9 changed files with 134 additions and 14 deletions
|
|
@ -34,6 +34,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")
|
||||
--------------
|
||||
|
|
@ -106,6 +112,18 @@ avgcost(a,b)
|
|||
11.0000
|
||||
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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue