diff --git a/mod/box/box.m b/mod/box/box.m index 99ccc54f85a56c450e680bd9e26c61c74b4718b3..8361a76680bf15414c4b99976d797a6979a2b668 100644 --- a/mod/box/box.m +++ b/mod/box/box.m @@ -36,7 +36,6 @@ #include <fiber.h> #include <log_io.h> #include <pickle.h> -#include <salloc.h> #include <say.h> #include <stat.h> #include <tarantool.h> diff --git a/mod/box/box_lua.m b/mod/box/box_lua.m index e652a999832f33b0364744a9d5134f8fd6b5c5c9..8ee57c9bbbe1af02d66545970e09c692cf851787 100644 --- a/mod/box/box_lua.m +++ b/mod/box/box_lua.m @@ -43,7 +43,6 @@ #include "pickle.h" #include "tuple.h" -#include "salloc.h" /* contents of box.lua */ extern const char _binary_box_lua_start; diff --git a/mod/box/index.m b/mod/box/index.m index f71b3980707dae9f9270ea36012da7199dc09f6e..5d0e48cc2079a388aafb5767918b37f81682f497 100644 --- a/mod/box/index.m +++ b/mod/box/index.m @@ -30,7 +30,6 @@ #include "pickle.h" #include "exception.h" #include "box.h" -#include "salloc.h" #include "assoc.h" const char *field_data_type_strs[] = {"NUM", "NUM64", "STR", "\0"}; diff --git a/mod/box/tree.m b/mod/box/tree.m index b256bd31e2ba5589fcc86df0b117c2af1b3ec6b3..76d589e72877330c7ef96bd1ecb5a4bc5a4e520e 100644 --- a/mod/box/tree.m +++ b/mod/box/tree.m @@ -924,6 +924,7 @@ tree_iterator_free(struct iterator *iterator) - (struct iterator *) allocIterator { + assert(key_def->part_count); struct tree_iterator *it = malloc(sizeof(struct tree_iterator) + SIZEOF_SPARSE_PARTS(key_def)); @@ -947,6 +948,10 @@ tree_iterator_free(struct iterator *iterator) assert(iterator->free == tree_iterator_free); struct tree_iterator *it = tree_iterator(iterator); + if (key_cardinality > key_def->part_count) + tnt_raise(ClientError, :ER_KEY_CARDINALITY, + key_cardinality, key_def->part_count); + it->key_data.data = key; it->key_data.part_count = key_cardinality; fold_with_key_parts(key_def, &it->key_data); diff --git a/test/box_big/lua.result b/test/box_big/lua.result index 469ed946dea0e861a44303bbe75b041e9893773d..8024e87608230a18f495cbb1dd42742f4762e4d3 100644 --- a/test/box_big/lua.result +++ b/test/box_big/lua.result @@ -17,8 +17,7 @@ Found 1 tuple: # https://bugs.launchpad.net/tarantool/+bug/904208 # call box.select(1, 1, 'new', 'world', 'order') -Found 1 tuple: -['brave', 'new', 'world'] +An error occurred: ER_KEY_CARDINALITY, 'Key cardinality 3 is greater than index cardinality 2' call box.delete(1, 'brave') Found 1 tuple: ['brave', 'new', 'world']