box: fix unique violation in functional index with nullable parts
Currently is_nullable property of a functional index part disables the unique property of the index. The bug is in func_index_compare(), which compares functional keys first, and if they are equal it compares the primary keys. This behaviour is correct only when some part of the key is NULL (and for non-unique indexes), but for now the primary keys are compared unconditionally. Fix this by checking for NULL key parts. Closes #8587 NO_DOC=bugfix
Showing
- changelogs/unreleased/gh-8587-unique-violation-in-functional-index-with-nullable.md 4 additions, 0 deletions...587-unique-violation-in-functional-index-with-nullable.md
- src/box/tuple_compare.cc 48 additions, 18 deletionssrc/box/tuple_compare.cc
- test/box-luatest/gh_8587_func_index_unique_violation_test.lua 106 additions, 0 deletions.../box-luatest/gh_8587_func_index_unique_violation_test.lua
- test/unit/key_def.c 112 additions, 1 deletiontest/unit/key_def.c
Loading
Please register or sign in to comment