From 7779c79f04cb0471ef307d03baa8eac1cc37d2ed Mon Sep 17 00:00:00 2001 From: Tor Didriksen Date: Mon, 4 Jul 2011 13:53:07 +0200 Subject: Bug#11908153: CRASH AND/OR VALGRIND ERRORS IN FIELD_BLOB::GET_KEY_IMAGE Field_geom::reset() failed to reset its base Field_blob. The range optimizer used the un-initilized field during optimization and execution. mysql-test/r/gis.result: New test case. mysql-test/t/gis.test: New test case. sql/field.h: Field_geom::reset() must call Field_blob::reset(), even if the field is not nullable. --- sql/field_conv.cc | 3 +++ 1 file changed, 3 insertions(+) (limited to 'sql/field_conv.cc') diff --git a/sql/field_conv.cc b/sql/field_conv.cc index 3890fe395d7..1a3ac9de08b 100644 --- a/sql/field_conv.cc +++ b/sql/field_conv.cc @@ -178,7 +178,10 @@ set_field_to_null_with_conversions(Field *field, bool no_conversions) ((Field_timestamp*) field)->set_time(); return 0; // Ok to set time to NULL } + + // Note: we ignore any potential failure of reset() here. field->reset(); + if (field == field->table->next_number_field) { field->table->auto_increment_field_not_null= FALSE; -- cgit v1.2.1