-
Notifications
You must be signed in to change notification settings - Fork 168
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
Error when searching in empty degenerate subtable #124
Error when searching in empty degenerate subtable #124
Conversation
…search happens on an empty degenerate table (unattached m_columns.)
This problem may be present in other functions than the mentioned search functions. Be sure to check. |
It turns out that the same problem occurs for aggregate functions. What about queries? |
…or an empty degenerate subtable
I would prefer solution 2. Solution 1 implies that all language bindings and C++ applications must check for not_found everything a subtable is involved. What I really want to be able to do:
Currently this will fail as Bill have no children (even if I write it in C++). Solution 1 implies that the |
Kneth, my intention with (1) was not to require that applications and language bindings should check for the degenerate case. Instead I am suggesting that the core library makes this check initially, and return the appropriate value in the degenerate case. Solution (1) and (2) would both fix the problem with no visible difference from the point of view of applications and language bindings. After further consideration, I think we should choose option (1) because the potential benefit of (2) is not currently well understood. Later on, we may or may not choose to switch to (2). |
What will the appropriate value be in solution (1)? A |
I'm not sure what you mean. The appropriate return value for a degenerate By a non-degenerate empty subtable, I mean a subtable that has a 'columns' Note that a degenerate empty subtable, is one that does not even have a On Sun, Aug 18, 2013 at 9:03 PM, Kenneth Geisshirt <[email protected]
|
It sounds like the solution I want - a (sub)table with zero rows. 👍 |
Nice thumbs-up :-) |
We also need to make sure that it works on read-only tables. Currently On Mon, Aug 19, 2013 at 7:02 AM, Kristian Spangsege <
|
Alexander, I doubt it, unless we violate C++ constness in our language In C++ there is no problem. A read transaction will only give you If we violate that constness constraint in our language bindings, then we On Mon, Aug 19, 2013 at 5:04 PM, astigsen [email protected] wrote:
|
Here is one way to go about it: Group wrapper: Now, m_group doubles as a flag for mutability, so no other flag is needed. All invocations of read-only functions in the core library API, should Mutating functions should check for the presence of m_group, and if present It's simple and safe, as it requires no constness casting. On Mon, Aug 19, 2013 at 5:24 PM, Kristian Spangsege [email protected] wrote:
|
If fact, I doubt ther will be any good reason not to follow this precise On Mon, Aug 19, 2013 at 5:31 PM, Kristian Spangsege [email protected] wrote:
|
Lasse, I have reassigned this one to you, as I believe Brian asked you to look at it. Please remember to commit your changes to the branch associated with this pull request. |
Yup, will do On Tue, Sep 24, 2013 at 8:58 PM, Kristian Spangsege <
|
… are done for updating queries (such as delete()). Asana task has been created with this issue
…mpty-table-search-error Conflicts: .dir-locals.el test/test_table.cpp
Error when searching in empty degenerate subtable
Fsa/prerelease testing Change-Id: Ia2eb875f7c30babfde46abbde21870e04d0c8210
NOT FIXED!
All search functions (Table::lookup(), Table::find_fist_int(), ...) will fail for an empty degenerate subtable, that is, a subtable whose 'ref' is null and whose m_columns is therefore unattached.
The same is true for all aggregate functions.
There are two possible routes to solving this problem:
The disadvantage of (1) is that it adds a fixed overhead to all searches and aggregates.
Also, (2) may offer other advantages than solving this particular problem.
\cc @kneth @bmunkholm @astigsen