Fixed BUG#13941: replace() string fuction behaves badly inside stored
procedure For some functions returning strings (like "replace" and "ifnull" - where val_str() is returning a pointer into one of the parameters) - we ended up with a dangling pointer after the new operator destroyed the reuse item in the eval function. A working, if not very elegant, solution is to simply copy the string in such cases. mysql-test/r/sp.result: New test case for BUG#13941. mysql-test/t/sp.test: New test case for BUG#13941. sql/sp_head.cc: Copy the string when evaluating some string functions (e.g. "replace" and "ifnull") to avoid using a dangling pointer.
Showing
Please register or sign in to comment