Skip to content

Commit

Permalink
Reset table->record[1] early for sequences to fix comparision of inno…
Browse files Browse the repository at this point in the history
…db row

Added also suppression of openssl warnings from valgrind
  • Loading branch information
montywi committed Oct 22, 2017
1 parent 7204f66 commit a3b4f57
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 7 deletions.
31 changes: 31 additions & 0 deletions mysql-test/valgrind.supp
Original file line number Diff line number Diff line change
Expand Up @@ -1737,3 +1737,34 @@
...
}

#
# OpenSSL 1.0.1k problems
#

{
OPENSSL 1.0.1k crypto leak
Memcheck:Leak
match-leak-kinds: reachable
fun:malloc
fun:CRYPTO_malloc
fun:ENGINE_ADD
}
{
OPENSSL 1.0.1k crypto leak
Memcheck:Leak
match-leak-kinds: reachable
fun:malloc
fun:CRYPTO_malloc
fun:ENGINE_new
}

{
OPENSSL 1.0.1k crypto leak2
Memcheck:Leak
match-leak-kinds: reachable
fun:malloc
fun:CRYPTO_malloc
fun:sk_new
obj:/lib64/libcrypto.so*
fun:ENGINE_ADD
}
6 changes: 6 additions & 0 deletions sql/ha_sequence.cc
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,12 @@ int ha_sequence::open(const char *name, int mode, uint flags)
}
else
table->m_needs_reopen= true;

/*
The following is needed to fix comparison of rows in
ha_update_first_row() for InnoDB
*/
memcpy(table->record[1], table->s->default_values, table->s->reclength);
}
DBUG_RETURN(error);
}
Expand Down
2 changes: 1 addition & 1 deletion sql/handler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6066,7 +6066,7 @@ int handler::update_first_row(uchar *new_data)
/*
We have to do the memcmp as otherwise we may get error 169 from InnoDB
*/
if (memcmp(table->record[0], table->record[1], table->s->reclength))
if (memcmp(new_data, table->record[1], table->s->reclength))
error= update_row(table->record[1], new_data);
}
end_error= ha_rnd_end();
Expand Down
6 changes: 0 additions & 6 deletions sql/sql_sequence.cc
Original file line number Diff line number Diff line change
Expand Up @@ -594,12 +594,6 @@ int sequence_definition::write(TABLE *table, bool all_fields)
else
table->rpl_write_set= &table->s->all_set;

/*
The following is needed to fix comparison of rows in
ha_update_first_row() for InnoDB
*/
memcpy(table->record[1],table->s->default_values, table->s->reclength);

/* Update table */
save_write_set= table->write_set;
save_read_set= table->read_set;
Expand Down

0 comments on commit a3b4f57

Please sign in to comment.