Loading mysql-test/r/udf.result +18 −0 Original line number Diff line number Diff line Loading @@ -76,6 +76,24 @@ call XXX2(); metaphon(testval) HL drop procedure xxx2; CREATE TABLE bug19904(n INT, v varchar(10)); INSERT INTO bug19904 VALUES (1,'one'),(2,'two'),(NULL,NULL),(3,'three'),(4,'four'); SELECT myfunc_double(n) AS f FROM bug19904; f 49.00 50.00 NULL 51.00 52.00 SELECT metaphon(v) AS f FROM bug19904; f ON TW NULL 0R FR DROP TABLE bug19904; End of 5.0 tests. DROP FUNCTION metaphon; DROP FUNCTION myfunc_double; DROP FUNCTION myfunc_nonexist; Loading mysql-test/t/udf.test +12 −0 Original line number Diff line number Diff line Loading @@ -99,6 +99,17 @@ delimiter ;// call XXX2(); drop procedure xxx2; # # Bug#19904: UDF: not initialized *is_null per row # CREATE TABLE bug19904(n INT, v varchar(10)); INSERT INTO bug19904 VALUES (1,'one'),(2,'two'),(NULL,NULL),(3,'three'),(4,'four'); SELECT myfunc_double(n) AS f FROM bug19904; SELECT metaphon(v) AS f FROM bug19904; DROP TABLE bug19904; --echo End of 5.0 tests. # # Drop the example functions from udf_example Loading @@ -114,3 +125,4 @@ DROP FUNCTION lookup; DROP FUNCTION reverse_lookup; DROP FUNCTION avgcost; sql/sql_udf.h +2 −0 Original line number Diff line number Diff line Loading @@ -70,6 +70,7 @@ class udf_handler :public Sql_alloc void cleanup(); double val(my_bool *null_value) { is_null= 0; if (get_arguments()) { *null_value=1; Loading @@ -88,6 +89,7 @@ class udf_handler :public Sql_alloc } longlong val_int(my_bool *null_value) { is_null= 0; if (get_arguments()) { *null_value=1; Loading Loading
mysql-test/r/udf.result +18 −0 Original line number Diff line number Diff line Loading @@ -76,6 +76,24 @@ call XXX2(); metaphon(testval) HL drop procedure xxx2; CREATE TABLE bug19904(n INT, v varchar(10)); INSERT INTO bug19904 VALUES (1,'one'),(2,'two'),(NULL,NULL),(3,'three'),(4,'four'); SELECT myfunc_double(n) AS f FROM bug19904; f 49.00 50.00 NULL 51.00 52.00 SELECT metaphon(v) AS f FROM bug19904; f ON TW NULL 0R FR DROP TABLE bug19904; End of 5.0 tests. DROP FUNCTION metaphon; DROP FUNCTION myfunc_double; DROP FUNCTION myfunc_nonexist; Loading
mysql-test/t/udf.test +12 −0 Original line number Diff line number Diff line Loading @@ -99,6 +99,17 @@ delimiter ;// call XXX2(); drop procedure xxx2; # # Bug#19904: UDF: not initialized *is_null per row # CREATE TABLE bug19904(n INT, v varchar(10)); INSERT INTO bug19904 VALUES (1,'one'),(2,'two'),(NULL,NULL),(3,'three'),(4,'four'); SELECT myfunc_double(n) AS f FROM bug19904; SELECT metaphon(v) AS f FROM bug19904; DROP TABLE bug19904; --echo End of 5.0 tests. # # Drop the example functions from udf_example Loading @@ -114,3 +125,4 @@ DROP FUNCTION lookup; DROP FUNCTION reverse_lookup; DROP FUNCTION avgcost;
sql/sql_udf.h +2 −0 Original line number Diff line number Diff line Loading @@ -70,6 +70,7 @@ class udf_handler :public Sql_alloc void cleanup(); double val(my_bool *null_value) { is_null= 0; if (get_arguments()) { *null_value=1; Loading @@ -88,6 +89,7 @@ class udf_handler :public Sql_alloc } longlong val_int(my_bool *null_value) { is_null= 0; if (get_arguments()) { *null_value=1; Loading