Skip to content

Commit 24d6ec8

Browse files
committed
MDEV-17907 Class Static_binary_string
1 parent d6a00d9 commit 24d6ec8

File tree

2 files changed

+240
-217
lines changed

2 files changed

+240
-217
lines changed

sql/sql_string.cc

Lines changed: 8 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ static inline void APPEND_HEX(char *&to, uchar value)
156156
}
157157

158158

159-
void String::qs_append_hex(const char *str, uint32 len)
159+
void Static_binary_string::qs_append_hex(const char *str, uint32 len)
160160
{
161161
const char *str_end= str + len;
162162
for (char *to= Ptr + str_length ; str < str_end; str++)
@@ -677,7 +677,7 @@ bool String::append_with_prefill(const char *s,uint32 arg_length,
677677
}
678678

679679

680-
int String::strstr(const String &s,uint32 offset)
680+
int Static_binary_string::strstr(const Static_binary_string &s, uint32 offset)
681681
{
682682
if (s.length()+offset <= str_length)
683683
{
@@ -708,7 +708,7 @@ int String::strstr(const String &s,uint32 offset)
708708
** Search string from end. Offset is offset to the end of string
709709
*/
710710

711-
int String::strrstr(const String &s,uint32 offset)
711+
int Static_binary_string::strrstr(const Static_binary_string &s, uint32 offset)
712712
{
713713
if (s.length() <= offset && offset <= str_length)
714714
{
@@ -787,34 +787,34 @@ int String::reserve(size_t space_needed, size_t grow_by)
787787
return FALSE;
788788
}
789789

790-
void String::qs_append(const char *str, size_t len)
790+
void Static_binary_string::qs_append(const char *str, size_t len)
791791
{
792792
memcpy(Ptr + str_length, str, len + 1);
793793
str_length += (uint32)len;
794794
}
795795

796-
void String::qs_append(double d)
796+
void Static_binary_string::qs_append(double d)
797797
{
798798
char *buff = Ptr + str_length;
799799
str_length+= (uint32) my_gcvt(d, MY_GCVT_ARG_DOUBLE, FLOATING_POINT_BUFFER - 1, buff,
800800
NULL);
801801
}
802802

803-
void String::qs_append(double *d)
803+
void Static_binary_string::qs_append(double *d)
804804
{
805805
double ld;
806806
float8get(ld, (char*) d);
807807
qs_append(ld);
808808
}
809809

810-
void String::qs_append(int i)
810+
void Static_binary_string::qs_append(int i)
811811
{
812812
char *buff= Ptr + str_length;
813813
char *end= int10_to_str(i, buff, -10);
814814
str_length+= (int) (end-buff);
815815
}
816816

817-
void String::qs_append(ulonglong i)
817+
void Static_binary_string::qs_append(ulonglong i)
818818
{
819819
char *buff= Ptr + str_length;
820820
char *end= longlong10_to_str(i, buff, 10);
@@ -1149,26 +1149,6 @@ void String::print_with_conversion(String *print, CHARSET_INFO *cs) const
11491149
}
11501150

11511151

1152-
/*
1153-
Exchange state of this object and argument.
1154-
1155-
SYNOPSIS
1156-
String::swap()
1157-
1158-
RETURN
1159-
Target string will contain state of this object and vice versa.
1160-
*/
1161-
1162-
void String::swap(String &s)
1163-
{
1164-
swap_variables(char *, Ptr, s.Ptr);
1165-
swap_variables(uint32, str_length, s.str_length);
1166-
swap_variables(uint32, Alloced_length, s.Alloced_length);
1167-
swap_variables(bool, alloced, s.alloced);
1168-
Charset::swap(s);
1169-
}
1170-
1171-
11721152
/**
11731153
Convert string to printable ASCII string
11741154

0 commit comments

Comments
 (0)