From fb5748decfbe7d42f9a4dfd4925b5bc61bb2ea45 Mon Sep 17 00:00:00 2001 From: Yu Zhang Date: Thu, 22 Jun 2023 12:36:22 -0700 Subject: [PATCH] Fix crash_test crash (#11554) Summary: `table_properties_` is not guaranteed to be available. Pull Request resolved: https://github.com/facebook/rocksdb/pull/11554 Reviewed By: akankshamahajan15 Differential Revision: D46944170 Pulled By: jowlyzhang fbshipit-source-id: 609d598e75b417471c9cd964cc316453776a2135 --- table/sst_file_dumper.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/table/sst_file_dumper.cc b/table/sst_file_dumper.cc index e385ab72a..da91c1130 100644 --- a/table/sst_file_dumper.cc +++ b/table/sst_file_dumper.cc @@ -174,7 +174,10 @@ Status SstFileDumper::NewTableReader( nullptr /* block_cache_tracer */, 0 /* max_file_size_for_l0_meta_pin */, "" /* cur_db_session_id */, 0 /* cur_file_num */, {} /* unique_id */, 0 /* largest_seqno */, 0 /* tail_size */, - static_cast(table_properties_->user_defined_timestamps_persisted)); + table_properties_ == nullptr + ? true + : static_cast( + table_properties_->user_defined_timestamps_persisted)); // Allow open file with global sequence number for backward compatibility. t_opt.largest_seqno = kMaxSequenceNumber;