1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-31 22:22:30 +03:00

All String->set() now have charset argument

This commit is contained in:
bar@bar.mysql.r18.ru
2002-10-30 16:19:43 +04:00
parent 637b97991d
commit b43876b9dd
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