diff options
-rw-r--r-- | sql/sql_insert.cc | 7 | ||||
-rw-r--r-- | sql/table.cc | 11 |
2 files changed, 2 insertions, 16 deletions
diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc index 88eb76ef1ed..e750e97194a 100644 --- a/sql/sql_insert.cc +++ b/sql/sql_insert.cc @@ -970,12 +970,7 @@ bool mysql_insert(THD *thd,TABLE_LIST *table_list, be overwritten by fill_record() anyway (and fill_record() does not use default values in this case). */ -#ifdef HAVE_valgrind - if (table->file->ha_table_flags() && HA_RECORD_MUST_BE_CLEAN_ON_WRITE) - restore_record(table,s->default_values); // Get empty record - else -#endif - table->record[0][0]= share->default_values[0]; + table->record[0][0]= share->default_values[0]; /* Fix undefined null_bits. */ if (share->null_bytes > 1 && share->last_null_bit_pos) diff --git a/sql/table.cc b/sql/table.cc index a1e9ebfc0cc..3ab89897e07 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -4150,16 +4150,7 @@ void TABLE::init(THD *thd, TABLE_LIST *tl) DBUG_ASSERT(key_read == 0); - /* mark the record[0] uninitialized */ - TRASH(record[0], s->reclength); - - /* - Initialize the null marker bits, to ensure that if we are doing a read - of only selected columns (like in keyread), all null markers are - initialized. - */ - memset(record[0], 255, s->null_bytes); - memset(record[1], 255, s->null_bytes); + restore_record(this, s->default_values); /* Tables may be reused in a sub statement. */ DBUG_ASSERT(!file->extra(HA_EXTRA_IS_ATTACHED_CHILDREN)); |