diff options
Diffstat (limited to 'sql/table.cc')
-rw-r--r-- | sql/table.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sql/table.cc b/sql/table.cc index fc1b8a13497..bc437f250b9 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -1234,11 +1234,12 @@ bool get_field(MEM_ROOT *mem, Field *field, String *res) char *get_field(MEM_ROOT *mem, Field *field) { - char buff[MAX_FIELD_WIDTH] *to; + char buff[MAX_FIELD_WIDTH], *to; String str(buff,sizeof(buff),&my_charset_bin); uint length; field->val_str(&str,&str); + length= str.length(); if (!length || !(to= (char*) alloc_root(mem,length+1))) return NullS; memcpy(to,str.ptr(),(uint) length); |