summaryrefslogtreecommitdiff
path: root/sql/unireg.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/unireg.cc')
-rw-r--r--sql/unireg.cc19
1 files changed, 10 insertions, 9 deletions
diff --git a/sql/unireg.cc b/sql/unireg.cc
index 0bb8a4e77c6..268ee24f509 100644
--- a/sql/unireg.cc
+++ b/sql/unireg.cc
@@ -73,7 +73,7 @@ static uchar *extra2_write_len(uchar *pos, size_t len)
}
static uchar *extra2_write(uchar *pos, enum extra2_frm_value_type type,
- LEX_STRING *str)
+ const LEX_CSTRING *str)
{
*pos++ = type;
pos= extra2_write_len(pos, str->length);
@@ -84,7 +84,7 @@ static uchar *extra2_write(uchar *pos, enum extra2_frm_value_type type,
static uchar *extra2_write(uchar *pos, enum extra2_frm_value_type type,
LEX_CUSTRING *str)
{
- return extra2_write(pos, type, reinterpret_cast<LEX_STRING *>(str));
+ return extra2_write(pos, type, reinterpret_cast<LEX_CSTRING *>(str));
}
/**
@@ -107,7 +107,7 @@ LEX_CUSTRING build_frm_image(THD *thd, const char *table,
List<Create_field> &create_fields,
uint keys, KEY *key_info, handler *db_file)
{
- LEX_STRING str_db_type;
+ LEX_CSTRING str_db_type;
uint reclength, key_info_length, i;
ulong key_buff_length;
ulong filepos, data_offset;
@@ -616,7 +616,8 @@ static bool pack_header(THD *thd, uchar *forminfo,
while ((field=it++))
{
if (validate_comment_length(thd, &field->comment, COLUMN_COMMENT_MAXLEN,
- ER_TOO_LONG_FIELD_COMMENT, field->field_name))
+ ER_TOO_LONG_FIELD_COMMENT,
+ field->field_name.str))
DBUG_RETURN(1);
totlength+= field->length;
@@ -632,7 +633,7 @@ static bool pack_header(THD *thd, uchar *forminfo,
length=field->pack_length;
if ((uint) field->offset+ (uint) data_offset+ length > reclength)
reclength=(uint) (field->offset+ data_offset + length);
- n_length+= (ulong) strlen(field->field_name)+1;
+ n_length+= field->field_name.length + 1;
field->interval_id=0;
field->save_interval= 0;
if (field->interval)
@@ -776,7 +777,7 @@ static size_t packed_fields_length(List<Create_field> &create_fields)
}
length+= FCOMP;
- length+= strlen(field->field_name)+1;
+ length+= field->field_name.length + 1;
length+= field->comment.length;
}
length+= 2;
@@ -837,7 +838,7 @@ static bool pack_fields(uchar **buff_arg, List<Create_field> &create_fields,
it.rewind();
while ((field=it++))
{
- buff= (uchar*)strmov((char*) buff, field->field_name);
+ buff= (uchar*)strmov((char*) buff, field->field_name.str);
*buff++=NAMES_SEP_CHAR;
}
*buff++= 0;
@@ -959,7 +960,7 @@ static bool make_empty_rec(THD *thd, uchar *buff, uint table_options,
field->unireg_check,
field->save_interval ? field->save_interval
: field->interval,
- field->field_name);
+ &field->field_name);
if (!regfield)
{
error= 1;
@@ -989,7 +990,7 @@ static bool make_empty_rec(THD *thd, uchar *buff, uint table_options,
/* If not ok or warning of level 'note' */
if (res != 0 && res != 3)
{
- my_error(ER_INVALID_DEFAULT, MYF(0), regfield->field_name);
+ my_error(ER_INVALID_DEFAULT, MYF(0), regfield->field_name.str);
error= 1;
delete regfield; //To avoid memory leak
goto err;