mirror of
https://github.com/MariaDB/server.git
synced 2026-05-07 23:54:31 +02:00
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. mysql-test/r/udf.result: Add result. mysql-test/t/udf.test: Add test. sql/sql_udf.h: Initialize is_null to false before trying to use it, so that historical NULLs don't affect our operation.
This commit is contained in:
parent
6f42227f31
commit
e2495206b2
3 changed files with 32 additions and 0 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue