diff --git a/src/observer/storage/common/bplus_tree.cpp b/src/observer/storage/common/bplus_tree.cpp index df62fc86d26eb6e3ca81154fe48d32c9756e939f..ff5d313185c148f449ab035fb69a09f020d2618a 100644 --- a/src/observer/storage/common/bplus_tree.cpp +++ b/src/observer/storage/common/bplus_tree.cpp @@ -314,7 +314,7 @@ std::string to_string(const LeafIndexNodeHandler &handler, const KeyPrinter &pri ss << to_string((const IndexNodeHandler &)handler) << ",prev page:" << handler.prev_page() << ",next page:" << handler.next_page(); - ss << ",values=[" << printer(handler.__key_at(0)); + ss << ",values=[" << printer(handler.__key_at(0)) ; for (int i = 1; i < handler.size(); i++) { ss << "," << printer(handler.__key_at(i)); } diff --git a/src/observer/storage/common/bplus_tree.h b/src/observer/storage/common/bplus_tree.h index f5090b6d55deaf2fa8a3d42321cc2b293476f935..673c44be86df6ef2df087e67c37919af5b90b51b 100644 --- a/src/observer/storage/common/bplus_tree.h +++ b/src/observer/storage/common/bplus_tree.h @@ -143,11 +143,12 @@ public: } std::string operator() (const char *v) const { - std::string result = attr_printer_(v); - result.append(","); + std::stringstream ss; + ss << "{key:" << attr_printer_(v) << ","; const RID *rid = (const RID *)(v + attr_printer_.attr_length()); - return result.append(rid->to_string()); + ss << "rid:{" << rid->to_string() << "}}"; + return ss.str(); } private: