From c5b05c18e6ead88aa53039ae888c890ad65ec1cf Mon Sep 17 00:00:00 2001 From: DandreChen Date: Fri, 23 Sep 2022 10:28:11 +0800 Subject: [PATCH] fix(stonedb8.0): fix Tianmu engine for union primary key crash (#534) details: if use the union primary query between two or more tables, the Tianmu engine may crash. because it do not init the bitmap of index field. --- storage/tianmu/handler/tianmu_handler.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/storage/tianmu/handler/tianmu_handler.cpp b/storage/tianmu/handler/tianmu_handler.cpp index 81520df35..c68542d1f 100644 --- a/storage/tianmu/handler/tianmu_handler.cpp +++ b/storage/tianmu/handler/tianmu_handler.cpp @@ -1536,6 +1536,8 @@ void TianmuHandler::key_convert(const uchar *key, uint key_len, std::vector records; for (auto &i : cols) { Field *f = field[i]; + // stonedb8 init for union primary key + bitmap_set_bit(table->read_set, f->field_index()); size_t length; if (f->is_null()) { throw common::Exception("Priamry key part can not be NULL");