mirror of
https://github.com/MariaDB/server.git
synced 2025-07-27 18:02:13 +03:00
cleanup String::set(integer)
This commit is contained in:
@ -96,24 +96,14 @@ bool String::realloc(uint32 alloc_length)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool String::set(longlong num, CHARSET_INFO *cs)
|
||||
bool String::set(longlong num, bool unsigned_flag, CHARSET_INFO *cs)
|
||||
{
|
||||
uint l=20*cs->mbmaxlen+1;
|
||||
int base= unsigned_flag ? 10 : -10;
|
||||
|
||||
if (alloc(l))
|
||||
return TRUE;
|
||||
str_length=(uint32) (cs->cset->longlong10_to_str)(cs,Ptr,l,-10,num);
|
||||
str_charset=cs;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool String::set(ulonglong num, CHARSET_INFO *cs)
|
||||
{
|
||||
uint l=20*cs->mbmaxlen+1;
|
||||
|
||||
if (alloc(l))
|
||||
return TRUE;
|
||||
str_length=(uint32) (cs->cset->longlong10_to_str)(cs,Ptr,l,10,num);
|
||||
str_length=(uint32) (cs->cset->longlong10_to_str)(cs,Ptr,l,base,num);
|
||||
str_charset=cs;
|
||||
return FALSE;
|
||||
}
|
||||
|
Reference in New Issue
Block a user