-
Notifications
You must be signed in to change notification settings - Fork 165
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix query on size of a single link over links #6918
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -519,11 +519,16 @@ void LinkCount::evaluate(size_t index, ValueBase& destination) | |
const Obj obj = m_link_map.get_target_table()->get_object(links[i]); | ||
auto val = obj._get<int64_t>(m_column_key.get_index()); | ||
size_t s; | ||
if (val & 1) { | ||
if (m_column_key.get_type() == col_type_Link && !m_column_key.is_collection()) { | ||
// It is a single link column | ||
s = (val == 0) ? 0 : 1; | ||
} | ||
else if (val & 1) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How can you be sure that, at this point, we are dealing with a simple backlink column that points to one value? I guess what I am trying to say, is that... the logic behind There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe a bit obscure. The only case where we can have a tagged value here is when we are dealing with a backlink column with a single link. All other cases we have a ref to bplustree of links. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. OK maybe we can use a comment here. Describing this. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There is actually a comment |
||
// It is a backlink column with just one value | ||
s = 1; | ||
} | ||
else { | ||
// This is some kind of collection or backlink column | ||
s = _impl::get_collection_size_from_ref(to_ref(val), alloc); | ||
} | ||
destination.set(i, int64_t(s)); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do I read this correctly? You are trying to avoid to deal with collections of links? Right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. We must handle single link columns separately. That was the problem.