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

All String->set() now have charset argument

This commit is contained in:
unknown
2002-10-30 16:19:43 +04:00
parent 2b6c55db1f
commit 85f35cbf57
13 changed files with 94 additions and 76 deletions

View File

@ -91,25 +91,29 @@ bool String::realloc(uint32 alloc_length)
return FALSE;
}
bool String::set(longlong num)
bool String::set(longlong num, CHARSET_INFO *cs)
{
if (alloc(21))
return TRUE;
str_length=(uint32) (longlong10_to_str(num,Ptr,-10)-Ptr);
str_charset=cs;
return FALSE;
}
bool String::set(ulonglong num)
bool String::set(ulonglong num, CHARSET_INFO *cs)
{
if (alloc(21))
return TRUE;
str_length=(uint32) (longlong10_to_str(num,Ptr,10)-Ptr);
str_charset=cs;
return FALSE;
}
bool String::set(double num,uint decimals)
bool String::set(double num,uint decimals, CHARSET_INFO *cs)
{
char buff[331];
str_charset=cs;
if (decimals >= NOT_FIXED_DEC)
{
sprintf(buff,"%.14g",num); // Enough for a DATETIME