1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-27 18:02:13 +03:00

Bug#45168: assertion with convert() and empty set value

The assertion in String::copy was added in order to avoid
valgrind errors when the destination was the same as the source.
Eased restriction to allow for the case when str == NULL.
This commit is contained in:
Martin Hansson
2009-06-16 16:36:15 +02:00
parent eecf06873e
commit acc642c87c
4 changed files with 40 additions and 6 deletions

View File

@ -322,14 +322,23 @@ bool String::set_or_copy_aligned(const char *str,uint32 arg_length,
return copy_aligned(str, arg_length, offset, cs);
}
/* Copy with charset conversion */
/**
Copies the character data into this String, with optional character set
conversion.
@return
FALSE ok
TRUE Could not allocate result buffer
*/
bool String::copy(const char *str, uint32 arg_length,
CHARSET_INFO *from_cs, CHARSET_INFO *to_cs, uint *errors)
{
uint32 offset;
DBUG_ASSERT(str != Ptr);
DBUG_ASSERT(!str || str != Ptr);
if (!needs_conversion(arg_length, from_cs, to_cs, &offset))
{