revision-id: a4d7b682f90eaffb6c1de0e5ca8e75bb0167be17 (fb-prod201903-171-ga4d7b682f90) parent(s): 71f5fa77faeae64d653012db88f0a9e224227d5f author: Sergei Petrunia committer: Sergei Petrunia timestamp: 2019-10-12 22:41:44 +0300 message: Issue #790, MyRocks/MRR: address review input part 3 - in ha_rocksdb::index_end(), call mrr_free() only if we are in an MRR scan. - added a comment. --- storage/rocksdb/ha_rocksdb.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/storage/rocksdb/ha_rocksdb.cc b/storage/rocksdb/ha_rocksdb.cc index 2735d9d6adb..4da9293a75f 100644 --- a/storage/rocksdb/ha_rocksdb.cc +++ b/storage/rocksdb/ha_rocksdb.cc @@ -8013,6 +8013,9 @@ int ha_rocksdb::read_row_from_secondary_key(uchar *const buf, #ifndef DBUG_OFF m_keyread_only = save_keyread_only; #endif + // Due to MRR, now an index-only scan have pushed index condition. + // (If it does, we follow non-index only code path here, except that + // we don't fetch the row). bool have_icp = (pushed_idx_cond && pushed_idx_cond_keyno == active_index); if (covered_lookup && m_lock_rows == RDB_LOCK_NONE && !have_icp) { @@ -10569,7 +10572,8 @@ int ha_rocksdb::index_end() { active_index = MAX_KEY; in_range_check_pushed_down = FALSE; - mrr_free(); + if (mrr_rowid_reader) + mrr_free(); DBUG_RETURN(HA_EXIT_SUCCESS); }