revision-id: f0213bb6804b7625bec0c9e2b20e4a7f181f3524 (fb-prod8-202009-59-gf0213bb6804) parent(s): 9b54561dcebc0fe298b9e458970a27b57c507c53 author: Sergei Petrunia committer: Sergei Petrunia timestamp: 2021-02-01 20:22:21 +0300 message: Post-merge fixes --- storage/rocksdb/ha_rocksdb.cc | 8 ++++++-- storage/rocksdb/rdb_i_s.cc | 1 - 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/storage/rocksdb/ha_rocksdb.cc b/storage/rocksdb/ha_rocksdb.cc index ae37394a7fb..13376b57814 100644 --- a/storage/rocksdb/ha_rocksdb.cc +++ b/storage/rocksdb/ha_rocksdb.cc @@ -2876,6 +2876,8 @@ class Rdb_transaction { m_saved_snapshot = m_read_opts.snapshot; m_read_opts.snapshot = nullptr; m_stmt_ignores_snapshot= true; + if (!m_snapshot_timestamp) + rdb->GetEnv()->GetCurrentTime(&m_snapshot_timestamp); } } @@ -10895,7 +10897,8 @@ int ha_rocksdb::check_and_lock_unique_pk(const uint key_id, If the pk key has ttl, we may need to pretend the row wasn't found if it is already expired. */ - DBUG_ASSERT(row_info.tx->has_snapshot() && + DBUG_ASSERT((row_info.tx->has_snapshot() || + row_info.tx->in_snapshot_ignore_mode()) && row_info.tx->m_snapshot_timestamp != 0); if (key_found && m_pk_descr->has_ttl() && should_hide_ttl_rec(*m_pk_descr, m_retrieved_record, @@ -11055,7 +11058,8 @@ int ha_rocksdb::check_and_lock_sk( Also need to scan RocksDB and verify the key has not been deleted in the transaction. */ - DBUG_ASSERT(row_info.tx->has_snapshot() && + DBUG_ASSERT((row_info.tx->has_snapshot() || + row_info.tx->in_snapshot_ignore_mode()) && row_info.tx->m_snapshot_timestamp != 0); *found = !read_key_exact(kd, iter, all_parts_used, new_slice, row_info.tx->m_snapshot_timestamp); diff --git a/storage/rocksdb/rdb_i_s.cc b/storage/rocksdb/rdb_i_s.cc index 9509cc90825..45fb886f8ee 100644 --- a/storage/rocksdb/rdb_i_s.cc +++ b/storage/rocksdb/rdb_i_s.cc @@ -1751,7 +1751,6 @@ static ST_FIELD_INFO rdb_i_s_lock_info_fields_info[] = { ROCKSDB_FIELD_INFO("MODE", 32, MYSQL_TYPE_STRING, 0), ROCKSDB_FIELD_INFO_END}; - /* Fill the information_schema.rocksdb_locks virtual table */ static int rdb_i_s_lock_info_fill_table( my_core::THD *const thd, my_core::TABLE_LIST *const tables,