summaryrefslogtreecommitdiff
path: root/sql/sql_string.h
diff options
context:
space:
mode:
Diffstat (limited to 'sql/sql_string.h')
-rw-r--r--sql/sql_string.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/sql/sql_string.h b/sql/sql_string.h
index d5d31c8db65..5b7b55575de 100644
--- a/sql/sql_string.h
+++ b/sql/sql_string.h
@@ -111,6 +111,9 @@ public:
inline const char *ptr() const { return Ptr; }
inline char *c_ptr()
{
+ DBUG_ASSERT(!alloced || !Ptr || !Alloced_length ||
+ (Alloced_length >= (str_length + 1)));
+
if (!Ptr || Ptr[str_length]) /* Should be safe */
(void) realloc(str_length);
return Ptr;
@@ -141,6 +144,16 @@ public:
Alloced_length=0;
str_charset=str.str_charset;
}
+
+
+ /**
+ Points the internal buffer to the supplied one. The old buffer is freed.
+ @param str Pointer to the new buffer.
+ @param arg_length Length of the new buffer in characters, excluding any
+ null character.
+ @param cs Character set to use for interpreting string data.
+ @note The new buffer will not be null terminated.
+ */
inline void set(char *str,uint32 arg_length, CHARSET_INFO *cs)
{
free();