1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-27 18:02:13 +03:00

Merge branch '10.2' into bb-10.2-connector-c-integ-subm

This commit is contained in:
Sergei Golubchik
2016-09-21 12:54:56 +02:00
1734 changed files with 255763 additions and 106485 deletions

View File

@ -32,6 +32,7 @@ class String;
typedef struct st_io_cache IO_CACHE;
typedef struct st_mem_root MEM_ROOT;
#include "pack.h"
int sortcmp(const String *a,const String *b, CHARSET_INFO *cs);
String *copy_if_not_alloced(String *a,String *b,uint32 arg_length);
inline uint32 copy_and_convert(char *to, uint32 to_length,
@ -359,7 +360,9 @@ public:
if (ALIGN_SIZE(arg_length+1) < Alloced_length)
{
char *new_ptr;
if (!(new_ptr=(char*) my_realloc(Ptr,arg_length,MYF(0))))
if (!(new_ptr=(char*)
my_realloc(Ptr, arg_length,MYF((thread_specific ?
MY_THREAD_SPECIFIC : 0)))))
{
Alloced_length = 0;
real_alloc(arg_length);
@ -495,6 +498,11 @@ public:
{
Ptr[str_length++] = c;
}
void q_append2b(const uint32 n)
{
int2store(Ptr + str_length, n);
str_length += 2;
}
void q_append(const uint32 n)
{
int4store(Ptr + str_length, n);
@ -559,6 +567,7 @@ public:
return Ptr+ old_length; /* Area to use */
}
inline bool append(const char *s, uint32 arg_length, uint32 step_alloc)
{
uint32 new_length= arg_length + str_length;
@ -623,6 +632,19 @@ public:
{
return !sortcmp(this, other, cs);
}
void q_net_store_length(ulonglong length)
{
DBUG_ASSERT(Alloced_length >= (str_length + net_length_size(length)));
char *pos= (char *) net_store_length((uchar *)(Ptr + str_length), length);
str_length= pos - Ptr;
}
void q_net_store_data(const uchar *from, size_t length)
{
DBUG_ASSERT(Alloced_length >= (str_length + length +
net_length_size(length)));
q_net_store_length(length);
q_append((const char *)from, length);
}
};