Commit 541eb94f authored by Philipp Götze's avatar Philipp Götze

🛠 little fixes and additions

parent 46483791
......@@ -331,7 +331,7 @@ class PTable {
if (needsSplit) {
PLOG("Need to split for tuple: " << rec);
try {
auto pop = pool_by_vptr(this);
auto pop = pool_by_pptr(root);
std::pair < DataNodePtr, DataNodePtr > newNodes;
if (pmemobj_tx_stage() == TX_STAGE_NONE)
transaction::exec_tx(pop, [&] { newNodes = splitBlock(targetNode); });
......@@ -1128,7 +1128,7 @@ class PTable {
auto splitNode = node;
/* Loop for special case where multiple nodes share the same bdcc value */
while (bdcc_min == bdcc_max && !enoughSpace) {
while (bdcc_min == bdcc_max && !enoughSpace && splitNode->next != nullptr) {
splitNode = splitNode->next;
bdcc_min = reinterpret_cast<const uint32_t &>(splitNode->block.get_ro()[gBDCCRangePos1]);
bdcc_max = reinterpret_cast<const uint32_t &>(splitNode->block.get_ro()[gBDCCRangePos2]);
......
......@@ -30,12 +30,16 @@ enum ColumnType { Void_Type, Int_Type, Double_Type, String_Type };
using Column = std::pair<std::string, ColumnType>;
using ColumnInitList = std::initializer_list<Column>;
using ColumnIterator = std::vector<Column>::const_iterator;
using ColumnVector = std::vector<Column>;
using ColumnIterator = ColumnVector::const_iterator;
struct VTableInfo {
VTableInfo() {}
VTableInfo(const std::string &_name, ColumnVector _columns, ColumnType _keyType = Void_Type) :
name(_name), columns(_columns), keyType(_keyType) {}
VTableInfo(const std::string &_name, ColumnInitList _columns, ColumnType _keyType = Void_Type) :
name(_name), columns(_columns), keyType(_keyType) {}
......@@ -43,7 +47,7 @@ struct VTableInfo {
ColumnIterator end() const { return columns.end(); }
std::string name;
std::vector<Column> columns;
ColumnVector columns;
ColumnType keyType;
};
......
......@@ -66,12 +66,12 @@ void print(std::ostream &os, const std::tuple<Args...> &t) {
os << ")\n";
}
} /* namespace ptable */
template<typename... Types>
std::ostream &operator<<(std::ostream &os, std::tuple<Types...> tp) {
ptable::print(os, tp);
return os;
}
#endif /* utils_hpp_ */
\ No newline at end of file
} /* namespace ptable */
#endif /* utils_hpp_ */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment