-
Notifications
You must be signed in to change notification settings - Fork 378
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
Duplicate-key error message for vinyl says index name is null #5975
Comments
Reproducer without SQL:
Error:
|
locker
added a commit
that referenced
this issue
May 17, 2024
The code setting ER_TUPLE_FOUND uses index_name_by_id() to find the index name, but it passes an index in the dense index map to it while the function expects an index in the sparse index map. Apparently, this doesn't work as expected after an index is removed from the middle of the index map. This bug was introduced by commit fc3834c ("vinyl: check key uniqueness before modifying tx write set"). Instead of just fixing the index passed to index_name_by_id(), we do a bit of refactoring. We stop passing index_name and space_name to vy_check_is_unique_*() functions and instead get them right before raising ER_TUPLE_FOUND. Note, to get the space name, we need to call space_by_id() but it should be fine because (a) the space is very likely to be cached as the last accessed one and (b) this is an error path so it isn't performance critical. We also drop index_name_by_id() and extract the index name from the LSM tree object. Closes #5975 NO_DOC=bug fix
locker
added a commit
that referenced
this issue
May 20, 2024
The code setting ER_TUPLE_FOUND uses index_name_by_id() to find the index name, but it passes an index in the dense index map to it while the function expects an index in the sparse index map. Apparently, this doesn't work as expected after an index is removed from the middle of the index map. This bug was introduced by commit fc3834c ("vinyl: check key uniqueness before modifying tx write set"). Instead of just fixing the index passed to index_name_by_id(), we do a bit of refactoring. We stop passing index_name and space_name to vy_check_is_unique_*() functions and instead get them right before raising ER_TUPLE_FOUND. Note, to get the space name, we need to call space_by_id() but it should be fine because (a) the space is very likely to be cached as the last accessed one and (b) this is an error path so it isn't performance critical. We also drop index_name_by_id() and extract the index name from the LSM tree object. Closes #5975 NO_DOC=bug fix
locker
added a commit
that referenced
this issue
May 20, 2024
The code setting ER_TUPLE_FOUND uses index_name_by_id() to find the index name, but it passes an index in the dense index map to it while the function expects an index in the sparse index map. Apparently, this doesn't work as expected after an index is removed from the middle of the index map. This bug was introduced by commit fc3834c ("vinyl: check key uniqueness before modifying tx write set"). Instead of just fixing the index passed to index_name_by_id(), we do a bit of refactoring. We stop passing index_name and space_name to vy_check_is_unique_*() functions and instead get them right before raising ER_TUPLE_FOUND. Note, to get the space name, we need to call space_by_id() but it should be fine because (a) the space is very likely to be cached as the last accessed one and (b) this is an error path so it isn't performance critical. We also drop index_name_by_id() and extract the index name from the LSM tree object. Closes #5975 NO_DOC=bug fix (cherry picked from commit 2cfba5e)
locker
added a commit
that referenced
this issue
May 20, 2024
The code setting ER_TUPLE_FOUND uses index_name_by_id() to find the index name, but it passes an index in the dense index map to it while the function expects an index in the sparse index map. Apparently, this doesn't work as expected after an index is removed from the middle of the index map. This bug was introduced by commit fc3834c ("vinyl: check key uniqueness before modifying tx write set"). Instead of just fixing the index passed to index_name_by_id(), we do a bit of refactoring. We stop passing index_name and space_name to vy_check_is_unique_*() functions and instead get them right before raising ER_TUPLE_FOUND. Note, to get the space name, we need to call space_by_id() but it should be fine because (a) the space is very likely to be cached as the last accessed one and (b) this is an error path so it isn't performance critical. We also drop index_name_by_id() and extract the index name from the LSM tree object. Closes #5975 NO_DOC=bug fix (cherry picked from commit 2cfba5e)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I have Ubuntu 20.04
Tarantool version: Tarantool 2.7.1-186-g365e67c51 pulled from source today
I execute these requests:
Result: error message =
Duplicate key exists in unique index '(null)' in space 'J'
... There is a duplicate key but there is no unique index named '(null)'.
The expected behaviour is: error message =
Duplicate key exists in unique index 'I5' in space 'J'
.
The text was updated successfully, but these errors were encountered: