Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
41af8b9e
Commit
41af8b9e
authored
Jun 22, 2006
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge bk-internal.mysql.com:/home/bk/mysql-5.0-maint
into zippy.(none):/home/cmiller/work/mysql/mysql-5.0__bug19904
parents
88547195
e2495206
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
0 deletions
+32
-0
mysql-test/r/udf.result
mysql-test/r/udf.result
+18
-0
mysql-test/t/udf.test
mysql-test/t/udf.test
+12
-0
sql/sql_udf.h
sql/sql_udf.h
+2
-0
No files found.
mysql-test/r/udf.result
View file @
41af8b9e
...
@@ -76,6 +76,24 @@ call XXX2();
...
@@ -76,6 +76,24 @@ call XXX2();
metaphon(testval)
metaphon(testval)
HL
HL
drop procedure xxx2;
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 metaphon;
DROP FUNCTION myfunc_double;
DROP FUNCTION myfunc_double;
DROP FUNCTION myfunc_nonexist;
DROP FUNCTION myfunc_nonexist;
...
...
mysql-test/t/udf.test
View file @
41af8b9e
...
@@ -99,6 +99,17 @@ delimiter ;//
...
@@ -99,6 +99,17 @@ delimiter ;//
call
XXX2
();
call
XXX2
();
drop
procedure
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
# Drop the example functions from udf_example
...
@@ -114,3 +125,4 @@ DROP FUNCTION lookup;
...
@@ -114,3 +125,4 @@ DROP FUNCTION lookup;
DROP
FUNCTION
reverse_lookup
;
DROP
FUNCTION
reverse_lookup
;
DROP
FUNCTION
avgcost
;
DROP
FUNCTION
avgcost
;
sql/sql_udf.h
View file @
41af8b9e
...
@@ -70,6 +70,7 @@ class udf_handler :public Sql_alloc
...
@@ -70,6 +70,7 @@ class udf_handler :public Sql_alloc
void
cleanup
();
void
cleanup
();
double
val
(
my_bool
*
null_value
)
double
val
(
my_bool
*
null_value
)
{
{
is_null
=
0
;
if
(
get_arguments
())
if
(
get_arguments
())
{
{
*
null_value
=
1
;
*
null_value
=
1
;
...
@@ -88,6 +89,7 @@ class udf_handler :public Sql_alloc
...
@@ -88,6 +89,7 @@ class udf_handler :public Sql_alloc
}
}
longlong
val_int
(
my_bool
*
null_value
)
longlong
val_int
(
my_bool
*
null_value
)
{
{
is_null
=
0
;
if
(
get_arguments
())
if
(
get_arguments
())
{
{
*
null_value
=
1
;
*
null_value
=
1
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment