Skip to content

Commit 3c02e6e

Browse files
author
Vamsikrishna Bhagi
committed
Bug# 20730103 BACKPORT 19688008 TO 5.1
Problem: UDF doesn't handle the arguments properly when they are of string type due to a misplaced break. The length of arguments is also not set properly when the argument is NULL. Solution: Fixed the code by putting the break at right place and setting the argument length to zero when the argument is NULL.
1 parent 044060f commit 3c02e6e

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

sql/item_func.cc

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
1+
/* Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
22
33
This program is free software; you can redistribute it and/or modify
44
it under the terms of the GNU General Public License as published by
@@ -3029,8 +3029,12 @@ bool udf_handler::get_arguments()
30293029
{
30303030
f_args.args[i]= (char*) res->ptr();
30313031
f_args.lengths[i]= res->length();
3032-
break;
30333032
}
3033+
else
3034+
{
3035+
f_args.lengths[i]= 0;
3036+
}
3037+
break;
30343038
}
30353039
case INT_RESULT:
30363040
*((longlong*) to) = args[i]->val_int();

0 commit comments

Comments
 (0)