Skip to content
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

Fixed bug in Query that prevented find_next() from being started at an arbitrary position. #137

Merged
merged 6 commits into from
Oct 1, 2013

Conversation

astigsen
Copy link
Contributor

find_next() only initialized the query when started from position -1. This made it impossible to change query during a search (for positional queries).

@rrrlasse

@ghost ghost assigned rrrlasse Aug 26, 2013
out << setw(index_width+1) << left << " ";
out << setw(name_width+1) << left << "tables";
out << setw(rows_width) << left << "rows" << endl;
out << setw(int(index_width)+1) << left << " ";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

old-style casts

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What? That is not an old-style cast. The old-style cast syntax is characterized by a type surrounded by parentheses. "int(index_width)" is a so-called functional cast, and is a natural part of modern C++.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:-) selvfølgelig - der var jeg lige lidt hurtig...

// Brian

On Wed, Aug 28, 2013 at 11:15 PM, Kristian Spangsege <
notifications@github.com> wrote:

In src/tightdb/group.cpp:

@@ -489,9 +489,9 @@ void Group::to_string(ostream& out) const

 // Print header
  • out << setw(index_width+1) << left << " ";
  • out << setw(name_width+1) << left << "tables";
  • out << setw(rows_width) << left << "rows" << endl;
  • out << setw(int(index_width)+1) << left << " ";

What? That is not an old-style cast. The old-style cast syntax is
characterized by a type surrounded by parentheses. "int(index_width)" is a
so-called functional cast, and is a natural part of modern C++.


Reply to this email directly or view it on GitHubhttps://github.com//pull/137/files#r6046722
.

@bmunkholm
Copy link
Contributor

Missing update of documentation, testcases and changes.txt.

@astigsen
Copy link
Contributor Author

There is a test case and the docs does not mention that you had to start at -1. It is just a bugfix.

@bmunkholm
Copy link
Contributor

Ok. +1.

// Brian

On Thu, Aug 29, 2013 at 2:38 AM, astigsen notifications@github.com wrote:

There is a test case and the docs does not mention that you had to start
at -1. It is just a bugfix.


Reply to this email directly or view it on GitHubhttps://github.com//pull/137#issuecomment-23459609
.

@rrrlasse
Copy link
Contributor

  1. I think we can in no way accept that 'start' is exclusive, because 'start' is inclusive everywhere else in the entire TightDB.

  2. The pull request is also missing a basic unit test where the first call has 'start' greater than first match.

@astigsen
Copy link
Contributor Author

  1. That was current behavior, makes it easier to follow up on last match,
    and could be said to be better than allowing to start from positions beyond
    the end. But I am up to changing it if does not break too much existing
    code.

  2. The last queries in the unit test create new queries and start them
    after the first match.

On Thu, Aug 29, 2013 at 4:42 AM, Lasse Reinhold notifications@github.comwrote:

  1. I think we can in no way accept that 'start' is exclusive, because
    'start' is inclusive everywhere else in the entire TightDB.

  2. The pull request is also missing a basic unit test where the first call
    has 'start' greater than first match.


Reply to this email directly or view it on GitHubhttps://github.com//pull/137#issuecomment-23483075
.

…y_findnext_fix

Conflicts:
	src/tightdb/group_shared.cpp
	src/tightdb/query.cpp
	src/tightdb/table_basic.hpp
	test/test_query.cpp
	test/testsettings.hpp
rrrlasse pushed a commit that referenced this pull request Oct 1, 2013
Fixed bug in Query that prevented find_next() from being started at an arbitrary position.
@rrrlasse rrrlasse merged commit 1b96587 into realm:master Oct 1, 2013
tgoyne pushed a commit that referenced this pull request Jul 11, 2018
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 25, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants