*** ../mysql-5.0.bk-orig/sql/table.cc Tue Mar 6 18:19:14 2007 --- sql/table.cc Thu Mar 29 22:38:17 2007 *************** *** 25,33 **** static void frm_error(int error,TABLE *form,const char *name, int errortype, int errarg); static void fix_type_pointers(const char ***array, TYPELIB *point_to_type, ! uint types, char **names); static uint find_field(TABLE *form,uint start,uint length); static byte* get_field_name(Field **buff,uint *length, --- 25,33 ---- static void frm_error(int error,TABLE *form,const char *name, int errortype, int errarg); static void fix_type_pointers(const char ***array, TYPELIB *point_to_type, ! uint types, char **names, int max_names = 0); static uint find_field(TABLE *form,uint start,uint length); static byte* get_field_name(Field **buff,uint *length, *************** *** 477,485 **** } } if (keynames) ! fix_type_pointers(&int_array, &share->keynames, 1, &keynames); VOID(my_close(file,MYF(MY_WME))); file= -1; record= (char*) outparam->record[0]-1; /* Fieldstart = 1 */ --- 477,485 ---- } } if (keynames) ! fix_type_pointers(&int_array, &share->keynames, 1, &keynames, keys); VOID(my_close(file,MYF(MY_WME))); file= -1; record= (char*) outparam->record[0]-1; /* Fieldstart = 1 */ *************** *** 1228,1253 **** */ static void fix_type_pointers(const char ***array, TYPELIB *point_to_type, uint types, ! char **names) { char *type_name, *ptr; char chr; ptr= *names; while (types--) { point_to_type->name=0; point_to_type->type_names= *array; if ((chr= *ptr)) /* Test if empty type */ { ! while ((type_name=strchr(ptr+1,chr)) != NullS) { ! *((*array)++) = ptr+1; ! *type_name= '\0'; /* End string */ ! ptr=type_name; } ptr+=2; /* Skip end mark and last 0 */ } else --- 1228,1257 ---- */ static void fix_type_pointers(const char ***array, TYPELIB *point_to_type, uint types, ! char **names, int max_names) { char *type_name, *ptr; char chr; + int cnt; ptr= *names; while (types--) { + cnt= 0; point_to_type->name=0; point_to_type->type_names= *array; if ((chr= *ptr)) /* Test if empty type */ { ! while ((type_name=strchr(ptr+1,chr)) != NullS ! && (max_names == 0 || cnt < max_names)) { ! *((*array)++) = ptr+1; ! *type_name= '\0'; /* End string */ ! ptr=type_name; ! cnt++; } ptr+=2; /* Skip end mark and last 0 */ } else