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

Transaction cursor wrong selection #7919

Closed
antonzherdev opened this issue Dec 8, 2017 · 1 comment
Closed

Transaction cursor wrong selection #7919

antonzherdev opened this issue Dec 8, 2017 · 1 comment
Assignees
Labels
Milestone

Comments

@antonzherdev
Copy link
Contributor

OrientDB Version: 2.2.30

Java Version: 1.8

OS: OS X

Expected behavior

The document will be returned in the selection although it's out of selection

Actual behavior

The document should not be returned

Steps to reproduce

Create an index
In a transaction create a document in this index
iterateEntriesBetween so that the document will be out of the range. If ascending, it should be before the document, if descending it should be after the document

The problem happens in PureTxBetweenIndexForwardCursor and PureTxBetweenIndexBackwardCursor.

For PureTxBetweenIndexForwardCursor, lastKey will be null and firstKey after the toKey parameter. ODefaultComparator.INSTANCE.compare(nextKey, lastKey) > 0 will return 1 after this but the first item will be still returned.

For PureTxBetweenIndexBackwardCursor, it's even worse, as ODefaultComparator.INSTANCE.compare(nextKey, firstKey) < 0 return 1 and it will return all items from the transaction.

I think it's a critical problem.

@andrii0lomakin
Copy link
Member

Hi @antonzherdev . Fixed. Sorry for the long delay in a fix. Thank you for your report.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

3 participants