1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

MDEV-15304: Server crash in print_keydup_error / key_unpack or unexpected ER_DUP_KEY

Fix two issues:
1. Rdb_ddl_manager::rename() loses the value of m_hidden_pk_val. new
object used to get 0, which means "not loaded from the db yet".

2. ha_rocksdb::load_hidden_pk_value() uses current transaction (and its
snapshot) when loading hidden PK value from disk. This may cause it to
load an out-of-date value.
This commit is contained in:
Sergei Petrunia
2018-05-18 17:26:12 +03:00
parent de86997160
commit 727d0d4f9b
4 changed files with 77 additions and 8 deletions

View File

@@ -4271,6 +4271,9 @@ bool Rdb_ddl_manager::rename(const std::string &from, const std::string &to,
rec->m_auto_incr_val.load(std::memory_order_relaxed);
new_rec->m_key_descr_arr = rec->m_key_descr_arr;
new_rec->m_hidden_pk_val =
rec->m_hidden_pk_val.load(std::memory_order_relaxed);
// so that it's not free'd when deleting the old rec
rec->m_key_descr_arr = nullptr;