mirror of
https://github.com/MariaDB/server.git
synced 2025-08-07 00:04:31 +03:00
Merge remote-tracking branch 'origin/10.2' into bb-10.2-ext
This commit is contained in:
@@ -357,22 +357,22 @@ public:
|
||||
Ptr=0;
|
||||
str_length=0; /* Safety */
|
||||
}
|
||||
inline bool alloc(uint32 arg_length)
|
||||
inline bool alloc(size_t arg_length)
|
||||
{
|
||||
if (arg_length < Alloced_length)
|
||||
return 0;
|
||||
return real_alloc(arg_length);
|
||||
}
|
||||
bool real_alloc(uint32 arg_length); // Empties old string
|
||||
bool realloc_raw(uint32 arg_length);
|
||||
bool realloc(uint32 arg_length)
|
||||
bool real_alloc(size_t arg_length); // Empties old string
|
||||
bool realloc_raw(size_t arg_length);
|
||||
bool realloc(size_t arg_length)
|
||||
{
|
||||
if (realloc_raw(arg_length))
|
||||
return TRUE;
|
||||
Ptr[arg_length]=0; // This make other funcs shorter
|
||||
return FALSE;
|
||||
}
|
||||
bool realloc_with_extra(uint32 arg_length)
|
||||
bool realloc_with_extra(size_t arg_length)
|
||||
{
|
||||
if (extra_alloc < 4096)
|
||||
extra_alloc= extra_alloc*2+128;
|
||||
@@ -381,7 +381,7 @@ public:
|
||||
Ptr[arg_length]=0; // This make other funcs shorter
|
||||
return FALSE;
|
||||
}
|
||||
bool realloc_with_extra_if_needed(uint32 arg_length)
|
||||
bool realloc_with_extra_if_needed(size_t arg_length)
|
||||
{
|
||||
if (arg_length < Alloced_length)
|
||||
{
|
||||
@@ -391,7 +391,7 @@ public:
|
||||
return realloc_with_extra(arg_length);
|
||||
}
|
||||
// Shrink the buffer, but only if it is allocated on the heap.
|
||||
inline void shrink(uint32 arg_length)
|
||||
inline void shrink(size_t arg_length)
|
||||
{
|
||||
if (!is_alloced())
|
||||
return;
|
||||
@@ -408,7 +408,7 @@ public:
|
||||
else
|
||||
{
|
||||
Ptr=new_ptr;
|
||||
Alloced_length=arg_length;
|
||||
Alloced_length=(uint32)arg_length;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -431,7 +431,7 @@ public:
|
||||
|
||||
bool copy(); // Alloc string if not alloced
|
||||
bool copy(const String &s); // Allocate new string
|
||||
bool copy(const char *s,uint32 arg_length, CHARSET_INFO *cs); // Allocate new string
|
||||
bool copy(const char *s,size_t arg_length, CHARSET_INFO *cs); // Allocate new string
|
||||
static bool needs_conversion(uint32 arg_length,
|
||||
CHARSET_INFO *cs_from, CHARSET_INFO *cs_to,
|
||||
uint32 *offset);
|
||||
@@ -484,8 +484,8 @@ public:
|
||||
DBUG_ASSERT(ls.length < UINT_MAX32);
|
||||
return append(ls.str, (uint32) ls.length);
|
||||
}
|
||||
bool append(const char *s, uint32 arg_length);
|
||||
bool append(const char *s, uint32 arg_length, CHARSET_INFO *cs);
|
||||
bool append(const char *s, size_t size);
|
||||
bool append(const char *s, uint arg_length, CHARSET_INFO *cs);
|
||||
bool append_ulonglong(ulonglong val);
|
||||
bool append_longlong(longlong val);
|
||||
bool append(IO_CACHE* file, uint32 arg_length);
|
||||
@@ -568,10 +568,11 @@ public:
|
||||
float8store(Ptr + str_length, *d);
|
||||
str_length += 8;
|
||||
}
|
||||
void q_append(const char *data, uint32 data_len)
|
||||
void q_append(const char *data, size_t data_len)
|
||||
{
|
||||
memcpy(Ptr + str_length, data, data_len);
|
||||
str_length += data_len;
|
||||
DBUG_ASSERT(str_length <= UINT_MAX32 - data_len);
|
||||
str_length += (uint)data_len;
|
||||
}
|
||||
void q_append(const LEX_CSTRING *ls)
|
||||
{
|
||||
|
Reference in New Issue
Block a user