From 7533d92b23384ca2baed08521519715bf1a90337 Mon Sep 17 00:00:00 2001 From: "ingo@mysql.com" <> Date: Mon, 7 Nov 2005 18:31:48 +0100 Subject: [PATCH] Bug#13707 - Server crash with INSERT DELAYED on MyISAM table Initialized 'ptr' for a newly instantiated varstring field. This is required by INSERT DELAYED. No test case. This is a migration issue. There are two shell scripts attached to the bug report. They can be used for testing. --- sql/field.cc | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/sql/field.cc b/sql/field.cc index 03d20b4bfe2..f7f7c22bfe9 100644 --- a/sql/field.cc +++ b/sql/field.cc @@ -6202,9 +6202,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 to now VARCHAR fields. */ - return new Field_varstring(field_length, maybe_null(), - field_name, new_table, - charset()); + Field *new_field= new Field_varstring(field_length, maybe_null(), + field_name, new_table, + charset()); + /* + 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 + Field_varstring sets ptr to NULL. + */ + new_field->ptr= ptr; + return new_field; } /****************************************************************************