Branch: refs/heads/master
Home: https://github.com/mailru/tarantool
Commit: fee7d123f359c422b83d03c185cab3e03851c539
https://github.com/mailru/tarantool/commit/fee7d123f359c422b83d03c185cab3e03851c539
Author: Konstantin Osipov <[email protected]>
Date: 2012-05-04 (Fri, 04 May 2012)
Changed paths:
M doc/user/data-model.xml
M doc/user/errcode.xml
M doc/user/space.xml
M doc/user/stored-procedures.xml
M include/errcode.h
M mod/box/index.m
M test/box_big/hash.result
M test/box_big/lua.result
M test/box_big/tree_pk_multipart.result
M test/lib/sql_ast.py
Log Message:
-----------
Continue the witch hunt (removing cardinality).
diff --git a/doc/user/data-model.xml b/doc/user/data-model.xml
index d8d193e..63560fd 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 affe269..ef2b92d 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 8f8816c..3bc9b92 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 8c9b32a..8d86e36 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 99e0531..2875d6e 100644
--- a/include/errcode.h
+++ b/include/errcode.h
@@ -99,7 +99,7 @@ struct errcode_record {
/* 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 5d6bdb9..d9a896d 100644
--- a/mod/box/index.m
+++ b/mod/box/index.m
@@ -199,7 +199,7 @@ - (void) initIteratorUnsafe: (struct iterator *) iterator
:(enum iterator_type)
- (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 1726ff0..1083930 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 8024e87..583ca06 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 bfcaaca..c3c4667 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 0f353df..fed763d 100644
--- a/test/lib/sql_ast.py
+++ b/test/lib/sql_ast.py
@@ -72,7 +72,7 @@
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" ,
================================================================
_______________________________________________
Mailing list: https://launchpad.net/~tarantool-developers
Post to : [email protected]
Unsubscribe : https://launchpad.net/~tarantool-developers
More help : https://help.launchpad.net/ListHelp