mirror of
https://github.com/MariaDB/server.git
synced 2025-07-27 18:02:13 +03:00
MDEV-8253 EXPLAIN SELECT prints unexpected characters
Item_string::clone_item() creates a new Item_string that points exactly to the same buffer that the original one does. Later, Item_string::print() uses c_ptr() for the original Item_string, which reallocs the original buffer, and the clone remain with the old freed buffer. Refactoring the code not to use c_ptr() in Item_string::print().
This commit is contained in:
@ -954,6 +954,16 @@ void String::print(String *str) const
|
||||
str->append_for_single_quote(Ptr, str_length);
|
||||
}
|
||||
|
||||
|
||||
void String::print_with_conversion(String *print, CHARSET_INFO *cs) const
|
||||
{
|
||||
StringBuffer<256> tmp(cs);
|
||||
uint errors= 0;
|
||||
tmp.copy(this, cs, &errors);
|
||||
tmp.print(print);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
Exchange state of this object and argument.
|
||||
|
||||
|
Reference in New Issue
Block a user