Commit 3c02e6ec authored by Vamsikrishna Bhagi's avatar Vamsikrishna Bhagi

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.
parent 044060fe
/* 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 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 it under the terms of the GNU General Public License as published by
...@@ -3029,8 +3029,12 @@ bool udf_handler::get_arguments() ...@@ -3029,8 +3029,12 @@ bool udf_handler::get_arguments()
{ {
f_args.args[i]= (char*) res->ptr(); f_args.args[i]= (char*) res->ptr();
f_args.lengths[i]= res->length(); f_args.lengths[i]= res->length();
break;
} }
else
{
f_args.lengths[i]= 0;
}
break;
} }
case INT_RESULT: case INT_RESULT:
*((longlong*) to) = args[i]->val_int(); *((longlong*) to) = args[i]->val_int();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment