merge 5.1 => 5.5
This commit is contained in:
commit
da4f2a26ca
@ -1,7 +1,7 @@
|
|||||||
#ifndef CLIENT_SQL_STRING_INCLUDED
|
#ifndef CLIENT_SQL_STRING_INCLUDED
|
||||||
#define CLIENT_SQL_STRING_INCLUDED
|
#define CLIENT_SQL_STRING_INCLUDED
|
||||||
|
|
||||||
/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
|
/* Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
This program is free software; you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
@ -192,8 +192,12 @@ public:
|
|||||||
}
|
}
|
||||||
bool real_alloc(uint32 arg_length); // Empties old string
|
bool real_alloc(uint32 arg_length); // Empties old string
|
||||||
bool realloc(uint32 arg_length);
|
bool realloc(uint32 arg_length);
|
||||||
inline void shrink(uint32 arg_length) // Shrink buffer
|
|
||||||
|
// Shrink the buffer, but only if it is allocated on the heap.
|
||||||
|
inline void shrink(uint32 arg_length)
|
||||||
{
|
{
|
||||||
|
if (!is_alloced())
|
||||||
|
return;
|
||||||
if (arg_length < Alloced_length)
|
if (arg_length < Alloced_length)
|
||||||
{
|
{
|
||||||
char *new_ptr;
|
char *new_ptr;
|
||||||
@ -209,7 +213,7 @@ public:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
bool is_alloced() { return alloced; }
|
bool is_alloced() const { return alloced; }
|
||||||
inline String& operator = (const String &s)
|
inline String& operator = (const String &s)
|
||||||
{
|
{
|
||||||
if (&s != this)
|
if (&s != this)
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#ifndef SQL_STRING_INCLUDED
|
#ifndef SQL_STRING_INCLUDED
|
||||||
#define SQL_STRING_INCLUDED
|
#define SQL_STRING_INCLUDED
|
||||||
|
|
||||||
/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
|
/* Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
This program is free software; you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
@ -235,8 +235,12 @@ public:
|
|||||||
}
|
}
|
||||||
bool real_alloc(uint32 arg_length); // Empties old string
|
bool real_alloc(uint32 arg_length); // Empties old string
|
||||||
bool realloc(uint32 arg_length);
|
bool realloc(uint32 arg_length);
|
||||||
inline void shrink(uint32 arg_length) // Shrink buffer
|
|
||||||
|
// Shrink the buffer, but only if it is allocated on the heap.
|
||||||
|
inline void shrink(uint32 arg_length)
|
||||||
{
|
{
|
||||||
|
if (!is_alloced())
|
||||||
|
return;
|
||||||
if (arg_length < Alloced_length)
|
if (arg_length < Alloced_length)
|
||||||
{
|
{
|
||||||
char *new_ptr;
|
char *new_ptr;
|
||||||
@ -252,7 +256,7 @@ public:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
bool is_alloced() { return alloced; }
|
bool is_alloced() const { return alloced; }
|
||||||
inline String& operator = (const String &s)
|
inline String& operator = (const String &s)
|
||||||
{
|
{
|
||||||
if (&s != this)
|
if (&s != this)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user