QUICKSTEP-95: Fixed the exception due to zero tuple estimation for the empty project expression.
diff --git a/storage/CMakeLists.txt b/storage/CMakeLists.txt
index 6446a83..92a3292 100644
--- a/storage/CMakeLists.txt
+++ b/storage/CMakeLists.txt
@@ -907,6 +907,7 @@
quickstep_utility_Macros
quickstep_utility_PrimeNumber)
target_link_libraries(quickstep_storage_SplitRowStoreTupleStorageSubBlock
+ glog
quickstep_catalog_CatalogRelationSchema
quickstep_expressions_predicate_PredicateCost
quickstep_storage_SplitRowStoreValueAccessor
diff --git a/storage/SplitRowStoreTupleStorageSubBlock.cpp b/storage/SplitRowStoreTupleStorageSubBlock.cpp
index 0e5cfe6..5060208 100644
--- a/storage/SplitRowStoreTupleStorageSubBlock.cpp
+++ b/storage/SplitRowStoreTupleStorageSubBlock.cpp
@@ -37,6 +37,8 @@
#include "utility/Macros.hpp"
#include "utility/ScopedBuffer.hpp"
+#include "glog/logging.h"
+
namespace quickstep {
QUICKSTEP_REGISTER_TUPLE_STORE(SplitRowStoreTupleStorageSubBlock, SPLIT_ROW_STORE);
@@ -128,6 +130,13 @@
tuple_slot_bytes_ = per_tuple_null_bitmap_bytes_
+ relation.getFixedByteLength()
+ relation.numVariableLengthAttributes() * (sizeof(std::uint32_t) * 2);
+ if (tuple_slot_bytes_ == 0) {
+ LOG(WARNING)
+ << "Estimated zero bytes per tuple for relation \"" << relation.getName()
+ << "\" (relation_id: " << relation.getID()
+ << "). Adjusting to 1 byte.";
+ tuple_slot_bytes_ = 1;
+ }
// Size the occupancy bitmap by calculating the maximum tuples that can fit
// assuming the bare-minimum per tuple storage is used (no variable-length