mirror of
https://github.com/MariaDB/server.git
synced 2025-01-16 12:02:42 +01:00
BUG#11908153 CRASH AND/OR VALGRIND ERRORS IN FIELD_BLOB::GET_KEY_IMAGE
Backporting bug patch from 5.5 to 5.1. This fix is applicable to BUG#14362617 as well
This commit is contained in:
parent
776df0a366
commit
26f662be1c
2 changed files with 10 additions and 1 deletions
|
@ -1824,7 +1824,13 @@ public:
|
|||
int store(longlong nr, bool unsigned_val);
|
||||
int store_decimal(const my_decimal *);
|
||||
uint size_of() const { return sizeof(*this); }
|
||||
int reset(void) { return !maybe_null() || Field_blob::reset(); }
|
||||
|
||||
/**
|
||||
Non-nullable GEOMETRY types cannot have defaults,
|
||||
but the underlying blob must still be reset.
|
||||
*/
|
||||
int reset(void) { return Field_blob::reset() || !maybe_null(); }
|
||||
|
||||
geometry_type get_geometry_type() { return geom_type; };
|
||||
};
|
||||
#endif /*HAVE_SPATIAL*/
|
||||
|
|
|
@ -179,7 +179,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;
|
||||
|
|
Loading…
Reference in a new issue