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

incorrect behavior when trying to update a field with fieldName #63

Closed
ArtDu opened this issue Feb 11, 2021 · 0 comments · Fixed by #151
Closed

incorrect behavior when trying to update a field with fieldName #63

ArtDu opened this issue Feb 11, 2021 · 0 comments · Fixed by #151
Assignees
Labels
bug Something isn't working

Comments

@ArtDu
Copy link
Contributor

ArtDu commented Feb 11, 2021

Data loss problem. An error is expected in assert, but it updates the last field if the fieldName that is specified in update does not exist:

updateResult = testSpace.update(conditions, TupleOperations.add("asd", 100000)).get();
assertEquals(101968, updateResult.get(0).getInteger(4));

This line changes fieldId from None to -1:

@ArtDu ArtDu added the bug Something isn't working label Feb 11, 2021
@vrogach2020 vrogach2020 self-assigned this Nov 19, 2021
@ArtDu ArtDu assigned ArtDu and unassigned vrogach2020 Nov 19, 2021
ArtDu added a commit that referenced this issue Nov 19, 2021
ArtDu added a commit that referenced this issue Nov 22, 2021
We use update/upsert from TarantoolSpace, which updates the space via
iproto. To specify the field to update, use fieldName. Previously, if we
made a mistake in the name, no error occurred and a request was sent to
tarantool where fieldIndex = -1, and this is correct for tarantool
because it uses reverse index, so -1 is the last element in the Tuple.
For now, we'll throw a TarantoolSpaceFieldNotFoundException if the
specified fieldName doesn't exist.

Closes #63

Co-authored-by: Vladimir Rogach <v.rogach@corp.mail.ru>
Co-authored-by: Oleg Kuznetsov <oleg.kuznetsov@corp.mail.ru
ArtDu added a commit that referenced this issue Nov 22, 2021
We use update/upsert from TarantoolSpace, which updates the space via
iproto. To specify the field to update, use fieldName. Previously, if we
made a mistake in the name, no error occurred and a request was sent to
tarantool where fieldIndex = -1, and this is correct for tarantool
because it uses reverse index, so -1 is the last element in the Tuple.
For now, we'll throw a TarantoolSpaceFieldNotFoundException if the
specified fieldName doesn't exist.

Closes #63

Co-authored-by: Vladimir Rogach <v.rogach@corp.mail.ru>
Co-authored-by: Oleg Kuznetsov <oleg.kuznetsov@corp.mail.ru>
ArtDu added a commit that referenced this issue Nov 22, 2021
We use update/upsert from TarantoolSpace, which updates the space via
iproto. To specify the field to update, use fieldName. Previously, if we
made a mistake in the name, no error occurred and a request was sent to
tarantool where fieldIndex = -1, and this is correct for tarantool
because it uses reverse index, so -1 is the last element in the Tuple.
For now, we'll throw a TarantoolSpaceFieldNotFoundException if the
specified fieldName doesn't exist.

Closes #63

Co-authored-by: Vladimir Rogach <v.rogach@corp.mail.ru>
Co-authored-by: Oleg Kuznetsov <oleg.kuznetsov@corp.mail.ru>
wey1and added a commit that referenced this issue Feb 10, 2022
We use update/upsert from TarantoolSpace, which updates the space via
iproto. To specify the field to update, use fieldName. Previously, if we
made a mistake in the name, no error occurred and a request was sent to
tarantool where fieldIndex = -1, and this is correct for tarantool
because it uses reverse index, so -1 is the last element in the Tuple.
For now, we'll throw a TarantoolSpaceFieldNotFoundException if the
specified fieldName doesn't exist.

Closes #63

Co-authored-by: Vladimir Rogach <v.rogach@corp.mail.ru>
Co-authored-by: Oleg Kuznetsov <oleg.kuznetsov@corp.mail.ru>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants