mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
CHARSET_INFO structure reorganization for easier maintainance
This commit is contained in:
@ -101,7 +101,7 @@ bool String::set(longlong num, CHARSET_INFO *cs)
|
||||
|
||||
if (alloc(l))
|
||||
return TRUE;
|
||||
str_length=(uint32) (cs->longlong10_to_str)(cs,Ptr,l,-10,num);
|
||||
str_length=(uint32) (cs->cset->longlong10_to_str)(cs,Ptr,l,-10,num);
|
||||
str_charset=cs;
|
||||
return FALSE;
|
||||
}
|
||||
@ -112,7 +112,7 @@ bool String::set(ulonglong num, CHARSET_INFO *cs)
|
||||
|
||||
if (alloc(l))
|
||||
return TRUE;
|
||||
str_length=(uint32) (cs->longlong10_to_str)(cs,Ptr,l,10,num);
|
||||
str_length=(uint32) (cs->cset->longlong10_to_str)(cs,Ptr,l,10,num);
|
||||
str_charset=cs;
|
||||
return FALSE;
|
||||
}
|
||||
@ -396,13 +396,13 @@ bool String::append(IO_CACHE* file, uint32 arg_length)
|
||||
|
||||
uint32 String::numchars()
|
||||
{
|
||||
return str_charset->numchars(str_charset, Ptr, Ptr+str_length);
|
||||
return str_charset->cset->numchars(str_charset, Ptr, Ptr+str_length);
|
||||
}
|
||||
|
||||
int String::charpos(int i,uint32 offset)
|
||||
{
|
||||
if (i<0) return i;
|
||||
return str_charset->charpos(str_charset,Ptr+offset,Ptr+str_length,i);
|
||||
return str_charset->cset->charpos(str_charset,Ptr+offset,Ptr+str_length,i);
|
||||
}
|
||||
|
||||
int String::strstr(const String &s,uint32 offset)
|
||||
@ -580,7 +580,7 @@ void String::qs_append(const char &c)
|
||||
|
||||
int sortcmp(const String *x,const String *y, CHARSET_INFO *cs)
|
||||
{
|
||||
return cs->strnncollsp(cs,
|
||||
return cs->coll->strnncollsp(cs,
|
||||
(unsigned char *) x->ptr(),x->length(),
|
||||
(unsigned char *) y->ptr(),y->length());
|
||||
}
|
||||
@ -639,7 +639,7 @@ copy_and_convert(char *to, uint32 to_length, CHARSET_INFO *to_cs,
|
||||
|
||||
while (1)
|
||||
{
|
||||
if ((cnvres=from_cs->mb_wc(from_cs, &wc, (uchar*) from, from_end)) > 0)
|
||||
if ((cnvres=from_cs->cset->mb_wc(from_cs, &wc, (uchar*) from, from_end)) > 0)
|
||||
from+= cnvres;
|
||||
else if (cnvres == MY_CS_ILSEQ)
|
||||
{
|
||||
@ -650,7 +650,7 @@ copy_and_convert(char *to, uint32 to_length, CHARSET_INFO *to_cs,
|
||||
break; // Impossible char.
|
||||
|
||||
outp:
|
||||
if ((cnvres= to_cs->wc_mb(to_cs, wc, (uchar*) to, to_end)) > 0)
|
||||
if ((cnvres= to_cs->cset->wc_mb(to_cs, wc, (uchar*) to, to_end)) > 0)
|
||||
to+= cnvres;
|
||||
else if (cnvres == MY_CS_ILUNI && wc != '?')
|
||||
{
|
||||
|
Reference in New Issue
Block a user