diff --git a/doc/user/data-model.xml b/doc/user/data-model.xml index d8d193e5e95bde5677451fb343d0624a45903398..63560fd000b0387bcc8b19f3bee68feaacb36254 100644 --- a/doc/user/data-model.xml +++ b/doc/user/data-model.xml @@ -90,7 +90,7 @@ <listitem><para> REPLACE replaces data when a tuple with given primary key already exists. Such replace - can insert a tuple of different cardinality. + can insert a tuple with a different number of fields. </para></listitem> </itemizedlist> </para> diff --git a/doc/user/errcode.xml b/doc/user/errcode.xml index affe269ee40413b5213e88a0ecdf4741068b3986..ef2b92d5d9cc582aa0b26ca709b089fa6a18fa64 100644 --- a/doc/user/errcode.xml +++ b/doc/user/errcode.xml @@ -56,8 +56,8 @@ of existing codes.</para> </varlistentry> <varlistentry> - <term xml:id="ER_KEY_CARDINALITY" xreflabel="ER_KEY_CARDINALITY">ER_KEY_CARDINALITY</term> - <listitem><para>Key cardinality is greater than index cardinality + <term xml:id="ER_KEY_PART_COUNT" xreflabel="ER_KEY_PART_COUNT">ER_KEY_PART_COUNT</term> + <listitem><para>Key part count is greater than index part count </para></listitem> </varlistentry> diff --git a/doc/user/space.xml b/doc/user/space.xml index 8f8816c97fa198181ed080aee999c804b889d75d..3bc9b92076877ba6b408d13e62a2efae547e61e5 100644 --- a/doc/user/space.xml +++ b/doc/user/space.xml @@ -41,8 +41,8 @@ struct space_t /* A space can be quickly disabled and re-enabled at run time. */ bool enabled; /* - * A limit on tuple cardinality can be set, to prevent too large tuples - * from coming in. + * If given, each tuple in the space must have exactly + * this many fields. */ unsigned int cardinality; /* Only used for HASH indexes, to preallocate memory. */ diff --git a/doc/user/stored-procedures.xml b/doc/user/stored-procedures.xml index 8c9b32a41f2bc206d1b5d1bc586da4e05ec4ed1a..8d86e362d6f83f546385f0cb03b3df6c1ec6afd1 100644 --- a/doc/user/stored-procedures.xml +++ b/doc/user/stored-procedures.xml @@ -720,7 +720,7 @@ localhost> lua t:slice(1, -1) <emphasis role="lua">space.cardinality</emphasis> </term> <listitem><simpara> - A limit on tuple cardinality for tuples in this space. + A limit on tuple field count for tuples in this space. This limit can be set in the configuration file. Value 0 stands for <quote>unlimited</quote>. </simpara></listitem> diff --git a/include/errcode.h b/include/errcode.h index 99e0531496484fa678c8be2a11642b263c1bcc5e..2875d6e625f7bdfff7426ae2295fd7c78759cd47 100644 --- a/include/errcode.h +++ b/include/errcode.h @@ -99,7 +99,7 @@ enum { TNT_ERRMSG_MAX = 512 }; /* 44 */_(ER_UNKNOWN_UPDATE_OP, 2, "Unknown UPDATE operation") \ /* 45 */_(ER_EXACT_MATCH, 2, "Partial key in an exact match (key field count: %d, expected: %d)") \ /* 46 */_(ER_UNUSED46, 2, "Unused46") \ - /* 47 */_(ER_KEY_CARDINALITY, 2, "Key cardinality %d is greater than index cardinality %d") \ + /* 47 */_(ER_KEY_PART_COUNT, 2, "Key part count %d is greater than index part count %d") \ /* 48 */_(ER_PROC_RET, 2, "Return type '%s' is not supported in the binary protocol") \ /* 49 */_(ER_TUPLE_NOT_FOUND, 2, "Tuple doesn't exist") \ /* 50 */_(ER_NO_SUCH_PROC, 2, "Procedure '%.*s' is not defined") \ diff --git a/mod/box/index.m b/mod/box/index.m index 5d6bdb97a554245f1641b1d0f566c21f1ca10dd2..d9a896d6ca70c11d2030565a7408d21d878be1b1 100644 --- a/mod/box/index.m +++ b/mod/box/index.m @@ -199,7 +199,7 @@ iterator_first_equal(struct iterator *it) - (void) checkKeyParts: (int) part_count :(bool) partial_key_allowed { if (part_count > key_def->part_count) - tnt_raise(ClientError, :ER_KEY_CARDINALITY, + tnt_raise(ClientError, :ER_KEY_PART_COUNT, part_count, key_def->part_count); if (!partial_key_allowed && part_count < key_def->part_count) tnt_raise(ClientError, :ER_EXACT_MATCH, diff --git a/test/box_big/hash.result b/test/box_big/hash.result index 1726ff069a7a6444624f061bc6b19f88c70c2673..1083930a5ad75f84254e78906a589c066ea23fe4 100644 --- a/test/box_big/hash.result +++ b/test/box_big/hash.result @@ -100,7 +100,7 @@ error: 'Supplied key field type does not match index type: expected u32' ... lua box.space[10]:select(0, 1, 2) --- -error: 'Key cardinality 2 is greater than index cardinality 1' +error: 'Key part count 2 is greater than index part count 1' ... #-----------------------------------------------------------------------------# @@ -141,7 +141,7 @@ error: 'Supplied key field type does not match index type: expected u32' ... lua box.space[10]:delete(1, 2) --- -error: 'Key cardinality 2 is greater than index cardinality 1' +error: 'Key part count 2 is greater than index part count 1' ... #=============================================================================# @@ -245,7 +245,7 @@ error: 'Supplied key field type does not match index type: expected u64' ... lua box.space[11]:select(0, '00000001', '00000002') --- -error: 'Key cardinality 2 is greater than index cardinality 1' +error: 'Key part count 2 is greater than index part count 1' ... #-----------------------------------------------------------------------------# @@ -286,7 +286,7 @@ error: 'Supplied key field type does not match index type: expected u64' ... lua box.space[11]:delete('00000001', '00000002') --- -error: 'Key cardinality 2 is greater than index cardinality 1' +error: 'Key part count 2 is greater than index part count 1' ... #=============================================================================# @@ -372,7 +372,7 @@ lua box.space[12]:select(0, 'key 5') lua box.space[12]:select(0, 'key 1', 'key 2') --- -error: 'Key cardinality 2 is greater than index cardinality 1' +error: 'Key part count 2 is greater than index part count 1' ... #-----------------------------------------------------------------------------# @@ -409,7 +409,7 @@ lua box.space[12]:delete('key 5') lua box.space[12]:delete('key 1', 'key 2') --- -error: 'Key cardinality 2 is greater than index cardinality 1' +error: 'Key part count 2 is greater than index part count 1' ... lua box.space[10]:truncate() --- diff --git a/test/box_big/lua.result b/test/box_big/lua.result index 8024e87608230a18f495cbb1dd42742f4762e4d3..583ca0679d584dc0b00a833369a3f12429dfa36f 100644 --- a/test/box_big/lua.result +++ b/test/box_big/lua.result @@ -17,7 +17,7 @@ Found 1 tuple: # https://bugs.launchpad.net/tarantool/+bug/904208 # call box.select(1, 1, 'new', 'world', 'order') -An error occurred: ER_KEY_CARDINALITY, 'Key cardinality 3 is greater than index cardinality 2' +An error occurred: ER_KEY_PART_COUNT, 'Key part count 3 is greater than index part count 2' call box.delete(1, 'brave') Found 1 tuple: ['brave', 'new', 'world'] diff --git a/test/box_big/tree_pk_multipart.result b/test/box_big/tree_pk_multipart.result index bfcaaca1b8f6fb7b589c08f39c83b21ea40e02c8..c3c4667fa64dd764e12b973fa4ed779203874b6e 100644 --- a/test/box_big/tree_pk_multipart.result +++ b/test/box_big/tree_pk_multipart.result @@ -194,7 +194,7 @@ error: 'Partial key in an exact match (key field count: 2, expected: 3)' ... lua box.delete(9, 'The Wolf!', 'Vincent', 1, 'Come again?') --- -error: 'Key cardinality 4 is greater than index cardinality 3' +error: 'Key part count 4 is greater than index part count 3' ... lua box.update_ol(9, { box.upd.assign(3, '<ooops>') }, 'The Wolf!', 'Vincent', 1) --- @@ -223,7 +223,7 @@ error: 'Partial key in an exact match (key field count: 2, expected: 3)' ... lua box.update_ol(9, { box.upd.assign(3, '<ooops>') }, 'The Wolf!', 'Vincent', 1, 'Come again?') --- -error: 'Key cardinality 4 is greater than index cardinality 3' +error: 'Key part count 4 is greater than index part count 3' ... lua box.space[9]:len() --- diff --git a/test/lib/sql_ast.py b/test/lib/sql_ast.py index 0f353dfb17088f39f8a9a86a517f8ac917d75a1d..fed763dc886fc734f5472b00844dac33456a3eda 100644 --- a/test/lib/sql_ast.py +++ b/test/lib/sql_ast.py @@ -72,7 +72,7 @@ ER = { 44: "ER_UNKNOWN_UPDATE_OP" , 45: "ER_EXACT_MATCH" , 46: "ER_UNUSED46" , - 47: "ER_KEY_CARDINALITY" , + 47: "ER_KEY_PART_COUNT" , 48: "ER_PROC_RET" , 49: "ER_TUPLE_NOT_FOUND" , 50: "ER_NO_SUCH_PROC" ,