Skip to content

Commit

Permalink
More test for MDEV-10134 Add full support for DEFAULT
Browse files Browse the repository at this point in the history
UDF
  • Loading branch information
Alexander Barkov authored and vuvova committed Jun 30, 2016
1 parent 582ee39 commit 778a1a4
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
14 changes: 14 additions & 0 deletions mysql-test/r/udf.result
Original file line number Diff line number Diff line change
Expand Up @@ -445,3 +445,17 @@ DROP FUNCTION myfunc_double;
DROP TABLE t1;
#
End of 5.1 tests.
#
# MDEV-10134 Add full support for DEFAULT
#
CREATE FUNCTION metaphon RETURNS STRING SONAME "UDF_EXAMPLE_LIB";
SELECT METAPHON('Hello');
METAPHON('Hello')
HL
CREATE TABLE t1 (a VARCHAR(10), b VARCHAR(10) DEFAULT METAPHON(a));
INSERT INTO t1 (a) VALUES ('Hello');
SELECT * FROM t1;
a b
Hello HL
DROP FUNCTION METAPHON;
DROP TABLE t1;
15 changes: 15 additions & 0 deletions mysql-test/t/udf.test
Original file line number Diff line number Diff line change
Expand Up @@ -512,3 +512,18 @@ DROP TABLE t1;
--echo #
--echo End of 5.1 tests.

--echo #
--echo # MDEV-10134 Add full support for DEFAULT
--echo #

--replace_result $UDF_EXAMPLE_SO UDF_EXAMPLE_LIB
eval CREATE FUNCTION metaphon RETURNS STRING SONAME "$UDF_EXAMPLE_SO";
SELECT METAPHON('Hello');
CREATE TABLE t1 (a VARCHAR(10), b VARCHAR(10) DEFAULT METAPHON(a));
INSERT INTO t1 (a) VALUES ('Hello');
SELECT * FROM t1;
DROP FUNCTION METAPHON;
# QQ: this should return an error
#INSERT INTO t1 (a) VALUES ('Hello');
#SELECT * FROM t1;
DROP TABLE t1;

0 comments on commit 778a1a4

Please sign in to comment.