diff --git a/mysql-test/r/udf.result b/mysql-test/r/udf.result index bcfc9941db9..f6d8e946ecf 100644 --- a/mysql-test/r/udf.result +++ b/mysql-test/r/udf.result @@ -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; diff --git a/mysql-test/t/udf.test b/mysql-test/t/udf.test index 4ee412f80d8..bbf08981802 100644 --- a/mysql-test/t/udf.test +++ b/mysql-test/t/udf.test @@ -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;