[Commits] 68674e66bc1: Fix issues found by RQG
revision-id: 68674e66bc1ab574029953ba56e989346509c60f (fb-prod201903-164-g68674e66bc1) parent(s): ff51e6038a6d64cf596f0ecda6c28aaf3dcfa3bf author: Sergei Petrunia committer: Sergei Petrunia timestamp: 2019-09-20 00:12:59 +0300 message: Fix issues found by RQG - As the comment in multi_range_read_init() already says, it should not return HA_ERR_END_OF_FILE. This confuses the SQL layer - The rows are returned in mrr_values[] array, and we need the current one in m_retrieved_record. Do "assignment" of PinnableSlice objects the right way. --- storage/rocksdb/ha_rocksdb.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/storage/rocksdb/ha_rocksdb.cc b/storage/rocksdb/ha_rocksdb.cc index 94b8c3741f3..00b92ff0aa7 100644 --- a/storage/rocksdb/ha_rocksdb.cc +++ b/storage/rocksdb/ha_rocksdb.cc @@ -15346,11 +15346,13 @@ int ha_rocksdb::multi_range_read_init(RANGE_SEQ_IF *seq, void *seq_init_param, mrr_rowid_reader = reader; } + res = mrr_fill_buffer(); + // note: here, we must NOT return HA_ERR_END_OF_FILE even if we know there // are no matches. We should return 0 here and return HA_ERR_END_OF_FILE // from the first multi_range_read_next() call. + if (res == HA_ERR_END_OF_FILE) res = 0; - res = mrr_fill_buffer(); return res; } @@ -15550,7 +15552,8 @@ int ha_rocksdb::multi_range_read_next(char **range_info) { *range_info = mrr_range_ptrs[cur_key]; - m_retrieved_record.PinSelf(mrr_values[cur_key]); + m_retrieved_record.Reset(); + m_retrieved_record.PinSlice(mrr_values[cur_key], &mrr_values[cur_key]); int rc = convert_record_from_storage_format(&rowkey, table->record[0]); m_retrieved_record.Reset();
participants (1)
-
psergey