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.
This commit is contained in:
parent
044060fe16
commit
3c02e6ec2e
@ -1,4 +1,4 @@
|
||||
/* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
/* Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@ -3029,8 +3029,12 @@ bool udf_handler::get_arguments()
|
||||
{
|
||||
f_args.args[i]= (char*) res->ptr();
|
||||
f_args.lengths[i]= res->length();
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
f_args.lengths[i]= 0;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case INT_RESULT:
|
||||
*((longlong*) to) = args[i]->val_int();
|
||||
|
Loading…
x
Reference in New Issue
Block a user