diff options
author | monty@mysql.com <> | 2004-09-06 15:14:10 +0300 |
---|---|---|
committer | monty@mysql.com <> | 2004-09-06 15:14:10 +0300 |
commit | 31122efde725e9b472e467a7cb1807100b7e6b1e (patch) | |
tree | d9ef905036723648a1d354d0523ef8124e4dee76 /sql/sql_string.h | |
parent | 32594c99899edd6de0053609c087f04dc21fbbfd (diff) | |
parent | 5d71817c7049e9db5c22e1667a41f57cf558d8ed (diff) | |
download | mariadb-git-31122efde725e9b472e467a7cb1807100b7e6b1e.tar.gz |
Merge with 4.1
(Includes merge of arena code in 4.1 and 5.0)
Diffstat (limited to 'sql/sql_string.h')
-rw-r--r-- | sql/sql_string.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/sql/sql_string.h b/sql/sql_string.h index 79365b7481b..ad32305e9b4 100644 --- a/sql/sql_string.h +++ b/sql/sql_string.h @@ -95,9 +95,18 @@ public: Ptr[str_length]=0; return Ptr; } + inline char *c_ptr_safe() + { + if (Ptr && str_length < Alloced_length) + Ptr[str_length]=0; + else + (void) realloc(str_length); + return Ptr; + } void set(String &str,uint32 offset,uint32 arg_length) { + DBUG_ASSERT(&str != this); free(); Ptr=(char*) str.ptr()+offset; str_length=arg_length; alloced=0; if (str.Alloced_length) |