Commit 07ddf769 authored by unknown's avatar unknown

Bug#13707 - Server crash with INSERT DELAYED on MyISAM table

After push fix. Must not access new_field if it is NULL.

parent 14637f97
...@@ -6194,6 +6194,8 @@ uint Field_string::max_packed_col_length(uint max_length) ...@@ -6194,6 +6194,8 @@ uint Field_string::max_packed_col_length(uint max_length)
Field *Field_string::new_field(MEM_ROOT *root, struct st_table *new_table) Field *Field_string::new_field(MEM_ROOT *root, struct st_table *new_table)
{ {
Field *new_field;
if (type() != MYSQL_TYPE_VAR_STRING || table == new_table) if (type() != MYSQL_TYPE_VAR_STRING || table == new_table)
return Field::new_field(root, new_table); return Field::new_field(root, new_table);
...@@ -6202,15 +6204,16 @@ Field *Field_string::new_field(MEM_ROOT *root, struct st_table *new_table) ...@@ -6202,15 +6204,16 @@ Field *Field_string::new_field(MEM_ROOT *root, struct st_table *new_table)
This is done to ensure that ALTER TABLE will convert old VARCHAR fields This is done to ensure that ALTER TABLE will convert old VARCHAR fields
to now VARCHAR fields. to now VARCHAR fields.
*/ */
Field *new_field= new Field_varstring(field_length, maybe_null(), if (new_field= new Field_varstring(field_length, maybe_null(),
field_name, new_table, field_name, new_table, charset()))
charset()); {
/* /*
delayed_insert::get_local_table() needs a ptr copied from old table. delayed_insert::get_local_table() needs a ptr copied from old table.
This is what other new_field() methods do too. The above method of This is what other new_field() methods do too. The above method of
Field_varstring sets ptr to NULL. Field_varstring sets ptr to NULL.
*/ */
new_field->ptr= ptr; new_field->ptr= ptr;
}
return new_field; return new_field;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment