Skip to content

Commit

Permalink
fixup! fixup! use after free debug
Browse files Browse the repository at this point in the history
  • Loading branch information
Goblin80 committed May 6, 2024
1 parent a03c4c8 commit 60a2716
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 18 deletions.
14 changes: 1 addition & 13 deletions src/engine/joinOrdering/GOO.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,19 +45,7 @@ requires RelationAble<N>
g.hist[n].push_back(b);

// TODO: STL chain iterators
// boost::join(g.edges_[a], g.edges_[b])
for (auto const& [x, e] : g.edges_[a]) {
if (e.hidden || x == a || x == b) continue;
g.add_rjoin(n, x, e.weight, Direction::UNDIRECTED);

if (!g.is_common_neighbour(a, b, x)) continue;
// when the 2 relations to be combined have common neighbours
// multiply edge weights of newly combined relation
g.edges_[x][n].weight = g.edges_[a][x].weight * g.edges_[b][x].weight;
g.edges_[n][x].weight = g.edges_[a][x].weight * g.edges_[b][x].weight;
}

for (auto const& [x, e] : g.edges_[b]) {
for (auto const& [x, e] : boost::join(g.edges_[a], g.edges_[b])) {
if (e.hidden || x == a || x == b) continue;
g.add_rjoin(n, x, e.weight, Direction::UNDIRECTED);

Expand Down
1 change: 1 addition & 0 deletions src/engine/joinOrdering/GOO.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#pragma once

#include "QueryGraph.h"
#include "boost/range/join.hpp"

namespace JoinOrdering {

Expand Down
3 changes: 2 additions & 1 deletion src/engine/joinOrdering/IKKBZ.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,8 @@ std::vector<N> IKKBZ_Normalized(QueryGraph<N>& g, ICostASI<N>& Ch,
normalized = false;
}
}
if (normalized) return subtree;
// if (normalized) return subtree;
if (normalized) return g.iter(subtree_root);
}
}

Expand Down
5 changes: 2 additions & 3 deletions src/engine/joinOrdering/QueryGraph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -178,11 +178,10 @@ auto QueryGraph<N>::get_chained_subtree(const N& n) -> N {

// since this is called from IKKBZ_Normalize
// we have already checked the existence of a subtree
// if (it != dxs.end())
return *it;
if (it != dxs.end()) return *it;

// AD_CONTRACT_CHECK(false);
// throw std::runtime_error("how did we get here?");
throw std::runtime_error("how did we get here?");

Check warning on line 184 in src/engine/joinOrdering/QueryGraph.cpp

View check run for this annotation

Codecov / codecov/patch

src/engine/joinOrdering/QueryGraph.cpp#L184

Added line #L184 was not covered by tests
}

template <typename N>
Expand Down
1 change: 0 additions & 1 deletion test/engine/joinOrdering/IKKBZTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -578,7 +578,6 @@ TEST(GOO_SANITY, SESSION04_EX) {

// TODO: undeterministic
// EXPECT_NO_THROW(JoinOrdering::GOO(g));
JoinOrdering::GOO(g);
// auto erg = JoinOrdering::GOO(g);
// for (auto const& x : g.hist[erg]) std::cout << x.getLabel() << "\n";
}

0 comments on commit 60a2716

Please sign in to comment.