summaryrefslogtreecommitdiff
path: root/sql/sql_string.cc
diff options
context:
space:
mode:
authorAlexey Kopytov <Alexey.Kopytov@sun.com>2009-02-06 12:51:11 +0300
committerAlexey Kopytov <Alexey.Kopytov@sun.com>2009-02-06 12:51:11 +0300
commitb30239bc1a3e73f4ad4f1ecac9cc1e193f7a0b61 (patch)
tree7c127b2641b6000e831a8deb2064ca0cd4311ab6 /sql/sql_string.cc
parent759b626d11e4ee6402a510e570ac83864e8844d4 (diff)
downloadmariadb-git-b30239bc1a3e73f4ad4f1ecac9cc1e193f7a0b61.tar.gz
Temporarily reverted patch for bug #41868 as it was causing problems in PB.
Diffstat (limited to 'sql/sql_string.cc')
-rw-r--r--sql/sql_string.cc20
1 files changed, 10 insertions, 10 deletions
diff --git a/sql/sql_string.cc b/sql/sql_string.cc
index b6ce4d8dc8d..75e47dd0c8e 100644
--- a/sql/sql_string.cc
+++ b/sql/sql_string.cc
@@ -72,26 +72,26 @@ bool String::realloc(uint32 alloc_length)
if (alloced)
{
if ((new_ptr= (char*) my_realloc(Ptr,len,MYF(MY_WME))))
- new_ptr[alloc_length]= 0;
+ {
+ Ptr=new_ptr;
+ Alloced_length=len;
+ }
else
- return TRUE; // Signal error
+ return TRUE; // Signal error
}
else if ((new_ptr= (char*) my_malloc(len,MYF(MY_WME))))
{
- if (str_length > len - 1)
- str_length= 0;
if (str_length) // Avoid bugs in memcpy on AIX
- memcpy(new_ptr, Ptr, str_length);
- new_ptr[str_length]= 0;
+ memcpy(new_ptr,Ptr,str_length);
+ new_ptr[str_length]=0;
+ Ptr=new_ptr;
+ Alloced_length=len;
alloced=1;
}
else
return TRUE; // Signal error
- Ptr= new_ptr;
- Alloced_length= len;
}
- else
- Ptr[alloc_length]= 0;
+ Ptr[alloc_length]=0; // This make other funcs shorter
return FALSE;
}