mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
Cleanups
BTREE, HASH and RTREE are not reserved symbols anymore mysql-test/t/loaddata.test: Removed empty lines mysys/my_malloc.c: Fixed old style variable name mysys/my_realloc.c: Fixed old style variable name sql/sql_yacc.yy: BTREE, HASH and RTREE are not reserved symbols anymore sql/table.cc: Simple optimization
This commit is contained in:
@ -1207,17 +1207,14 @@ 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];
|
||||
String str(buff,sizeof(buff),&my_charset_bin);
|
||||
uint length;
|
||||
|
||||
field->val_str(&str,&str);
|
||||
if (!(length= str.length()))
|
||||
return NullS;
|
||||
to= (char*) alloc_root(mem,length+1);
|
||||
memcpy(to, str.ptr(), (uint) length);
|
||||
to[length]=0;
|
||||
return to;
|
||||
return strmake_root(mem, str.ptr(), length);
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user