summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorcmiller@zippy.(none) <>2006-06-08 13:25:28 -0400
committercmiller@zippy.(none) <>2006-06-08 13:25:28 -0400
commit4bb358924cce7f3e6c4bffbc228441cb16131cb1 (patch)
tree655da24031881eafeb600ef54597c989f70793b1 /mysql-test
parentf25fcf79a59d285162f2f9c11f1021f407312c06 (diff)
downloadmariadb-git-4bb358924cce7f3e6c4bffbc228441cb16131cb1.tar.gz
Bug#19904: UDF: not initialized *is_null per row
The is_null value was initialized once and thereafter only set to indicate NULL, and never unset to indicate not-NULL. Now set is_null to false, in addition to only setting it to true when the value in question is null.
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/udf.result18
-rw-r--r--mysql-test/t/udf.test12
2 files changed, 30 insertions, 0 deletions
diff --git a/mysql-test/r/udf.result b/mysql-test/r/udf.result
index be52fd7f87c..484c42c41bf 100644
--- a/mysql-test/r/udf.result
+++ b/mysql-test/r/udf.result
@@ -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;
diff --git a/mysql-test/t/udf.test b/mysql-test/t/udf.test
index e2556692612..f3be08c8537 100644
--- a/mysql-test/t/udf.test
+++ b/mysql-test/t/udf.test
@@ -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
@@ -114,3 +125,4 @@ DROP FUNCTION lookup;
DROP FUNCTION reverse_lookup;
DROP FUNCTION avgcost;
+