summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mysql-test/t/loaddata.test4
-rw-r--r--mysys/my_malloc.c34
-rw-r--r--mysys/my_realloc.c33
-rw-r--r--sql/sql_yacc.yy3
-rw-r--r--sql/table.cc7
5 files changed, 39 insertions, 42 deletions
diff --git a/mysql-test/t/loaddata.test b/mysql-test/t/loaddata.test
index 2f484d30ff7..199da9c4a84 100644
--- a/mysql-test/t/loaddata.test
+++ b/mysql-test/t/loaddata.test
@@ -15,7 +15,3 @@ truncate table t1;
load data infile '../../std_data/loaddata1.dat' into table t1 fields terminated by ',' LINES STARTING BY ',' (b,c,d);
SELECT * from t1;
drop table t1;
-
-
-
-
diff --git a/mysys/my_malloc.c b/mysys/my_malloc.c
index b273363aaf1..df9fe1f9bc4 100644
--- a/mysys/my_malloc.c
+++ b/mysys/my_malloc.c
@@ -24,26 +24,26 @@
/* My memory allocator */
-gptr my_malloc(unsigned int Size, myf MyFlags)
+gptr my_malloc(unsigned int size, myf my_flags)
{
gptr point;
DBUG_ENTER("my_malloc");
- DBUG_PRINT("my",("Size: %u MyFlags: %d",Size, MyFlags));
+ DBUG_PRINT("my",("size: %u my_flags: %d",size, my_flags));
- if (!Size)
- Size=1; /* Safety */
- if ((point = (char*)malloc(Size)) == NULL)
+ if (!size)
+ size=1; /* Safety */
+ if ((point = (char*)malloc(size)) == NULL)
{
my_errno=errno;
- if (MyFlags & MY_FAE)
+ if (my_flags & MY_FAE)
error_handler_hook=fatal_error_handler_hook;
- if (MyFlags & (MY_FAE+MY_WME))
- my_error(EE_OUTOFMEMORY, MYF(ME_BELL+ME_WAITTANG),Size);
- if (MyFlags & MY_FAE)
+ if (my_flags & (MY_FAE+MY_WME))
+ my_error(EE_OUTOFMEMORY, MYF(ME_BELL+ME_WAITTANG),size);
+ if (my_flags & MY_FAE)
exit(1);
}
- else if (MyFlags & MY_ZEROFILL)
- bzero(point,Size);
+ else if (my_flags & MY_ZEROFILL)
+ bzero(point,size);
DBUG_PRINT("exit",("ptr: %lx",point));
DBUG_RETURN(point);
} /* my_malloc */
@@ -64,29 +64,29 @@ void my_no_flags_free(gptr ptr)
/* malloc and copy */
-gptr my_memdup(const byte *from, uint length, myf MyFlags)
+gptr my_memdup(const byte *from, uint length, myf my_flags)
{
gptr ptr;
- if ((ptr=my_malloc(length,MyFlags)) != 0)
+ if ((ptr=my_malloc(length,my_flags)) != 0)
memcpy((byte*) ptr, (byte*) from,(size_t) length);
return(ptr);
}
-char *my_strdup(const char *from, myf MyFlags)
+char *my_strdup(const char *from, myf my_flags)
{
gptr ptr;
uint length=(uint) strlen(from)+1;
- if ((ptr=my_malloc(length,MyFlags)) != 0)
+ if ((ptr=my_malloc(length,my_flags)) != 0)
memcpy((byte*) ptr, (byte*) from,(size_t) length);
return((my_string) ptr);
}
-char *my_strdup_with_length(const byte *from, uint length, myf MyFlags)
+char *my_strdup_with_length(const byte *from, uint length, myf my_flags)
{
gptr ptr;
- if ((ptr=my_malloc(length+1,MyFlags)) != 0)
+ if ((ptr=my_malloc(length+1,my_flags)) != 0)
{
memcpy((byte*) ptr, (byte*) from,(size_t) length);
((char*) ptr)[length]=0;
diff --git a/mysys/my_realloc.c b/mysys/my_realloc.c
index 49d96c2eb4f..5190fa75dce 100644
--- a/mysys/my_realloc.c
+++ b/mysys/my_realloc.c
@@ -23,40 +23,41 @@
/* My memory re allocator */
-gptr my_realloc(gptr oldpoint, uint Size, myf MyFlags)
+gptr my_realloc(gptr oldpoint, uint size, myf my_flags)
{
gptr point;
DBUG_ENTER("my_realloc");
- DBUG_PRINT("my",("ptr: %lx Size: %u MyFlags: %d",oldpoint, Size, MyFlags));
+ DBUG_PRINT("my",("ptr: %lx size: %u my_flags: %d",oldpoint, size,
+ my_flags));
- if (!oldpoint && (MyFlags & MY_ALLOW_ZERO_PTR))
- DBUG_RETURN(my_malloc(Size,MyFlags));
+ if (!oldpoint && (my_flags & MY_ALLOW_ZERO_PTR))
+ DBUG_RETURN(my_malloc(size,my_flags));
#ifdef USE_HALLOC
- if (!(point = malloc(Size)))
+ if (!(point = malloc(size)))
{
- if (MyFlags & MY_FREE_ON_ERROR)
- my_free(oldpoint,MyFlags);
- if (MyFlags & MY_HOLD_ON_ERROR)
+ if (my_flags & MY_FREE_ON_ERROR)
+ my_free(oldpoint,my_flags);
+ if (my_flags & MY_HOLD_ON_ERROR)
DBUG_RETURN(oldpoint);
my_errno=errno;
- if (MyFlags & MY_FAE+MY_WME)
- my_error(EE_OUTOFMEMORY, MYF(ME_BELL+ME_WAITTANG),Size);
+ if (my_flags & MY_FAE+MY_WME)
+ my_error(EE_OUTOFMEMORY, MYF(ME_BELL+ME_WAITTANG),size);
}
else
{
- memcpy(point,oldpoint,Size);
+ memcpy(point,oldpoint,size);
free(oldpoint);
}
#else
- if ((point = (char*)realloc(oldpoint,Size)) == NULL)
+ if ((point = (char*)realloc(oldpoint,size)) == NULL)
{
- if (MyFlags & MY_FREE_ON_ERROR)
+ if (my_flags & MY_FREE_ON_ERROR)
my_free(oldpoint,MyFLAGS);
- if (MyFlags & MY_HOLD_ON_ERROR)
+ if (my_flags & MY_HOLD_ON_ERROR)
DBUG_RETURN(oldpoint);
my_errno=errno;
- if (MyFlags & (MY_FAE+MY_WME))
- my_error(EE_OUTOFMEMORY, MYF(ME_BELL+ME_WAITTANG), Size);
+ if (my_flags & (MY_FAE+MY_WME))
+ my_error(EE_OUTOFMEMORY, MYF(ME_BELL+ME_WAITTANG), size);
}
#endif
DBUG_PRINT("exit",("ptr: %lx",point));
diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy
index 98746410470..2e66bcbb7aa 100644
--- a/sql/sql_yacc.yy
+++ b/sql/sql_yacc.yy
@@ -4363,6 +4363,7 @@ keyword:
| BOOL_SYM {}
| BOOLEAN_SYM {}
| BYTE_SYM {}
+ | BTREE_SYM {}
| CACHE_SYM {}
| CHANGED {}
| CHARSET {}
@@ -4408,6 +4409,7 @@ keyword:
| GRANTS {}
| GLOBAL_SYM {}
| HANDLER_SYM {}
+ | HASH_SYM {}
| HEAP_SYM {}
| HELP_SYM {}
| HOSTS_SYM {}
@@ -4490,6 +4492,7 @@ keyword:
| ROWS_SYM {}
| ROW_FORMAT_SYM {}
| ROW_SYM {}
+ | RTREE_SYM {}
| SAVEPOINT_SYM {}
| SECOND_SYM {}
| SERIAL_SYM {}
diff --git a/sql/table.cc b/sql/table.cc
index 9d12de1f6c7..a980e086d60 100644
--- a/sql/table.cc
+++ b/sql/table.cc
@@ -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);
}