diff --git a/src/box/alter.cc b/src/box/alter.cc index 121d1e8f03354c66a231234477f9fcacb72b6446..873626e86f1791b948055e07c06e86901ed2a0b5 100644 --- a/src/box/alter.cc +++ b/src/box/alter.cc @@ -423,7 +423,7 @@ alter_space_do(struct txn *txn, struct alter_space *alter, * Plus, implicit locks are evil. */ if (space->on_replace == space_alter_on_replace) - tnt_raise(ER_ALTER, space_id(space)); + tnt_raise(ER_ALTER_SPACE, space_name(space)); #endif alter->old_space = old_space; alter->space_def = old_space->def; @@ -498,12 +498,12 @@ ModifySpace::prepare(struct alter_space *alter) { if (def.id != space_id(alter->old_space)) tnt_raise(ClientError, ER_ALTER_SPACE, - (unsigned) space_id(alter->old_space), + space_name(alter->old_space), "space id is immutable"); if (strcmp(def.engine_name, alter->old_space->def.engine_name) != 0) tnt_raise(ClientError, ER_ALTER_SPACE, - (unsigned) space_id(alter->old_space), + space_name(alter->old_space), "can not change space engine"); engine_recovery *recovery = @@ -515,21 +515,21 @@ ModifySpace::prepare(struct alter_space *alter) space_size(alter->old_space) > 0) { tnt_raise(ClientError, ER_ALTER_SPACE, - (unsigned) def.id, + space_name(alter->old_space), "can not change field count on a non-empty space"); } Engine *engine = alter->old_space->handler->engine; if (def.temporary && !engine_can_be_temporary(engine->flags)) { tnt_raise(ClientError, ER_ALTER_SPACE, - (unsigned) def.id, + space_name(alter->old_space), "space does not support temporary flag"); } if (def.temporary != alter->old_space->def.temporary && recovery->state != READY_NO_KEYS && space_size(alter->old_space) > 0) { tnt_raise(ClientError, ER_ALTER_SPACE, - (unsigned) space_id(alter->old_space), + space_name(alter->old_space), "can not switch temporary flag on a non-empty space"); } } @@ -583,13 +583,13 @@ DropIndex::alter(struct alter_space *alter) */ if (space_is_system(alter->new_space)) tnt_raise(ClientError, ER_LAST_DROP, - space_id(alter->new_space)); + space_name(alter->new_space)); /* * Can't drop primary key before secondary keys. */ if (alter->new_space->index_count) { tnt_raise(ClientError, ER_DROP_PRIMARY_KEY, - (unsigned) alter->new_space->def.id); + space_name(alter->new_space)); } /* * OK to drop the primary key. Put the space back to @@ -1011,12 +1011,12 @@ on_replace_dd_space(struct trigger * /* trigger */, void *event) /* Verify that the space is empty (has no indexes) */ if (old_space->index_count) { tnt_raise(ClientError, ER_DROP_SPACE, - (unsigned) space_id(old_space), + space_name(old_space), "the space has indexes"); } if (schema_find_grants("space", old_space->def.id)) { tnt_raise(ClientError, ER_DROP_SPACE, - (unsigned) space_id(old_space), + space_name(old_space), "the space has grants"); } /* @todo lock space metadata until commit. */ diff --git a/src/box/engine.h b/src/box/engine.h index cb04693875f1886b987226881e813118ea5d22fa..f2cae1ead6397a79a1015a66fbc0fdb166a5ddbd 100644 --- a/src/box/engine.h +++ b/src/box/engine.h @@ -97,7 +97,7 @@ class Engine: public Object { * Check a key definition for violation of * various limits. */ - virtual void keydefCheck(struct key_def*) = 0; + virtual void keydefCheck(struct space *space, struct key_def*) = 0; /** * Create an instance of space index. Used in alter * space. diff --git a/src/box/errcode.h b/src/box/errcode.h index babda2dea27c37a227bd74c345b6504fe074a6d1..21cfb21d265e305a9c2e02a167264867b2f34b5b 100644 --- a/src/box/errcode.h +++ b/src/box/errcode.h @@ -54,28 +54,28 @@ struct errcode_record { /* 0 */_(ER_UNKNOWN, 2, "Unknown error") \ /* 1 */_(ER_ILLEGAL_PARAMS, 2, "Illegal parameters, %s") \ /* 2 */_(ER_MEMORY_ISSUE, 1, "Failed to allocate %u bytes in %s for %s") \ - /* 3 */_(ER_TUPLE_FOUND, 2, "Duplicate key exists in unique index %u") \ - /* 4 */_(ER_TUPLE_NOT_FOUND, 2, "Tuple doesn't exist in index %u") \ + /* 3 */_(ER_TUPLE_FOUND, 2, "Duplicate key exists in index '%s'") \ + /* 4 */_(ER_TUPLE_NOT_FOUND, 2, "Tuple doesn't exist in index '%s'") \ /* 5 */_(ER_UNSUPPORTED, 2, "%s does not support %s") \ /* 6 */_(ER_NONMASTER, 2, "Can't modify data on a replication slave. My master is: %s") \ /* 7 */_(ER_READONLY, 2, "Can't modify data because this server in read-only mode.") \ /* 8 */_(ER_INJECTION, 2, "Error injection '%s'") \ - /* 9 */_(ER_CREATE_SPACE, 2, "Failed to create space %u: %s") \ + /* 9 */_(ER_CREATE_SPACE, 2, "Failed to create space '%s': %s") \ /* 10 */_(ER_SPACE_EXISTS, 2, "Space '%s' already exists") \ - /* 11 */_(ER_DROP_SPACE, 2, "Can't drop space %u: %s") \ - /* 12 */_(ER_ALTER_SPACE, 2, "Can't modify space %u: %s") \ - /* 13 */_(ER_INDEX_TYPE, 2, "Unsupported index type supplied for index %u in space %u") \ - /* 14 */_(ER_MODIFY_INDEX, 2, "Can't create or modify index %u in space %u: %s") \ - /* 15 */_(ER_LAST_DROP, 2, "Can't drop the primary key in a system space, space id %u") \ + /* 11 */_(ER_DROP_SPACE, 2, "Can't drop space '%s': %s") \ + /* 12 */_(ER_ALTER_SPACE, 2, "Can't modify space '%s': %s") \ + /* 13 */_(ER_INDEX_TYPE, 2, "Unsupported index type supplied for index '%s' in space '%s'") \ + /* 14 */_(ER_MODIFY_INDEX, 2, "Can't create or modify index '%s' in space '%s': %s") \ + /* 15 */_(ER_LAST_DROP, 2, "Can't drop the primary key in a system space, space '%s'") \ /* 16 */_(ER_TUPLE_FORMAT_LIMIT, 2, "Tuple format limit reached: %u") \ - /* 17 */_(ER_DROP_PRIMARY_KEY, 2, "Can't drop primary key in space %u while secondary keys exist") \ + /* 17 */_(ER_DROP_PRIMARY_KEY, 2, "Can't drop primary key in space '%s' while secondary keys exist") \ /* 18 */_(ER_KEY_PART_TYPE, 2, "Supplied key type of part %u does not match index part type: expected %s") \ /* 19 */_(ER_EXACT_MATCH, 2, "Invalid key part count in an exact match (expected %u, got %u)") \ /* 20 */_(ER_INVALID_MSGPACK, 2, "Invalid MsgPack - %s") \ /* 21 */_(ER_PROC_RET, 2, "msgpack.encode: can not encode Lua type '%s'") \ /* 22 */_(ER_TUPLE_NOT_ARRAY, 2, "Tuple/Key must be MsgPack array") \ /* 23 */_(ER_FIELD_TYPE, 2, "Tuple field %u type does not match one required by operation: expected %s") \ - /* 24 */_(ER_FIELD_TYPE_MISMATCH, 2, "Ambiguous field type in index %u, key part %u. Requested type is %s but the field has previously been defined as %s") \ + /* 24 */_(ER_FIELD_TYPE_MISMATCH, 2, "Ambiguous field type in index '%s', key part %u. Requested type is %s but the field has previously been defined as %s") \ /* 25 */_(ER_SPLICE, 2, "SPLICE error on field %u: %s") \ /* 26 */_(ER_ARG_TYPE, 2, "Argument type in operation '%c' on field %u does not match field type: expected a %s") \ /* 27 */_(ER_TUPLE_IS_TOO_LONG, 2, "Tuple is too long %u") \ @@ -89,7 +89,7 @@ struct errcode_record { /* 35 */_(ER_NO_SUCH_INDEX, 2, "No index #%u is defined in space '%s'") \ /* 36 */_(ER_NO_SUCH_SPACE, 2, "Space '%s' does not exist") \ /* 37 */_(ER_NO_SUCH_FIELD, 2, "Field %u was not found in the tuple") \ - /* 38 */_(ER_SPACE_FIELD_COUNT, 2, "Tuple field count %u does not match space %u field count %u") \ + /* 38 */_(ER_SPACE_FIELD_COUNT, 2, "Tuple field count %u does not match space '%s' field count %u") \ /* 39 */_(ER_INDEX_FIELD_COUNT, 2, "Tuple field count %u is less than required by a defined index (expected %u)") \ /* 40 */_(ER_WAL_IO, 2, "Failed to write to disk") \ /* 41 */_(ER_MORE_THAN_ONE_TUPLE, 2, "More than one tuple found by get()") \ diff --git a/src/box/index.cc b/src/box/index.cc index 5246cb0d0b2e7f402faa8ab990e7e9b687ff9351..94a22bcd808cb5892efa51280ab3b8c4b112407e 100644 --- a/src/box/index.cc +++ b/src/box/index.cc @@ -182,9 +182,9 @@ index_build(Index *index, Index *pk) index->reserve(estimated_tuples); if (n_tuples > 0) { - say_info("Adding %" PRIu32 " keys to %s index %" - PRIu32 "...", n_tuples, - index_type_strs[index->key_def->type], index_id(index)); + say_info("Adding %" PRIu32 " keys to %s index '%s' ...", + n_tuples, index_type_strs[index->key_def->type], + index_name(index)); } struct iterator *it = pk->position(); diff --git a/src/box/index.h b/src/box/index.h index 7b609c3a055826ec31af032e3bc974a9e44b9640..65527eb034cf5b2c01bf126905725c4450bc892e 100644 --- a/src/box/index.h +++ b/src/box/index.h @@ -241,6 +241,12 @@ index_id(const Index *index) return index->key_def->iid; } +static inline const char * +index_name(const Index *index) +{ + return index->key_def->name; +} + /** True if this index is a primary key. */ static inline bool index_is_primary(const Index *index) diff --git a/src/box/key_def.cc b/src/box/key_def.cc index 05fcf46cbfeeffa3d7ab1641f01e9e744fd98365..2f7fff6bee4aed9a70e5a1e1b0c49e411ece57cf 100644 --- a/src/box/key_def.cc +++ b/src/box/key_def.cc @@ -72,8 +72,9 @@ key_def_new(uint32_t space_id, uint32_t iid, const char *name, int n = snprintf(def->name, sizeof(def->name), "%s", name); if (n >= sizeof(def->name)) { free(def); + struct space *space = space_cache_find(space_id); tnt_raise(LoggedError, ER_MODIFY_INDEX, - (unsigned) iid, (unsigned) space_id, + name, space_name(space), "index name is too long"); } if (!identifier_is_valid(def->name)) { @@ -146,41 +147,43 @@ key_list_del_key(struct rlist *key_list, uint32_t iid) void key_def_check(struct key_def *key_def) { + struct space *space = space_cache_find(key_def->space_id); + if (key_def->iid >= BOX_INDEX_MAX) { tnt_raise(ClientError, ER_MODIFY_INDEX, - (unsigned) key_def->iid, - (unsigned) key_def->space_id, + key_def->name, + space_name(space), "index id too big"); } if (key_def->iid == 0 && key_def->is_unique == false) { tnt_raise(ClientError, ER_MODIFY_INDEX, - (unsigned) key_def->iid, - (unsigned) key_def->space_id, + key_def->name, + space_name(space), "primary key must be unique"); } if (key_def->part_count == 0) { tnt_raise(ClientError, ER_MODIFY_INDEX, - (unsigned) key_def->iid, - (unsigned) key_def->space_id, + key_def->name, + space_name(space), "part count must be positive"); } if (key_def->part_count > BOX_INDEX_PART_MAX) { tnt_raise(ClientError, ER_MODIFY_INDEX, - (unsigned) key_def->iid, - (unsigned) key_def->space_id, + key_def->name, + space_name(space), "too many key parts"); } for (uint32_t i = 0; i < key_def->part_count; i++) { if (key_def->parts[i].type == field_type_MAX) { tnt_raise(ClientError, ER_MODIFY_INDEX, - (unsigned) key_def->iid, - (unsigned) key_def->space_id, + key_def->name, + space_name(space), "unknown field type"); } if (key_def->parts[i].fieldno > BOX_INDEX_FIELD_MAX) { tnt_raise(ClientError, ER_MODIFY_INDEX, - (unsigned) key_def->iid, - (unsigned) key_def->space_id, + key_def->name, + space_name(space), "field no is too big"); } for (uint32_t j = 0; j < i; j++) { @@ -191,17 +194,15 @@ key_def_check(struct key_def *key_def) if (key_def->parts[i].fieldno == key_def->parts[j].fieldno) { tnt_raise(ClientError, ER_MODIFY_INDEX, - (unsigned) key_def->iid, - (unsigned) key_def->space_id, + key_def->name, + space_name(space), "same key part is indexed twice"); } } } - struct space *space = - space_cache_find(key_def->space_id); /* validate key_def->type */ - space->handler->engine->keydefCheck(key_def); + space->handler->engine->keydefCheck(space, key_def); } void @@ -210,18 +211,18 @@ space_def_check(struct space_def *def, uint32_t namelen, uint32_t engine_namelen { if (def->id > BOX_SPACE_MAX) { tnt_raise(ClientError, errcode, - (unsigned) def->id, + def->name, "space id is too big"); } if (namelen >= sizeof(def->name)) { tnt_raise(ClientError, errcode, - (unsigned) def->id, + def->name, "space name is too long"); } identifier_check(def->name); if (engine_namelen >= sizeof(def->engine_name)) { tnt_raise(ClientError, errcode, - (unsigned) def->id, + def->name, "space engine name is too long"); } identifier_check(def->engine_name); @@ -230,7 +231,7 @@ space_def_check(struct space_def *def, uint32_t namelen, uint32_t engine_namelen Engine *engine = engine_find(def->engine_name); if (! engine_can_be_temporary(engine->flags)) tnt_raise(ClientError, ER_ALTER_SPACE, - (unsigned) def->id, + def->name, "space does not support temporary flag"); } } diff --git a/src/box/memtx_engine.cc b/src/box/memtx_engine.cc index d0cd173c7271fe90e33665c48ecf629d6d00046d..008376043e74f8627f9945313fb553bdf994d514 100644 --- a/src/box/memtx_engine.cc +++ b/src/box/memtx_engine.cc @@ -144,14 +144,14 @@ MemtxEngine::dropIndex(Index *index) } void -MemtxEngine::keydefCheck(struct key_def *key_def) +MemtxEngine::keydefCheck(struct space *space, struct key_def *key_def) { switch (key_def->type) { case HASH: if (! key_def->is_unique) { tnt_raise(ClientError, ER_MODIFY_INDEX, - (unsigned) key_def->iid, - (unsigned) key_def->space_id, + key_def->name, + space_name(space), "HASH index must be unique"); } break; @@ -161,35 +161,35 @@ MemtxEngine::keydefCheck(struct key_def *key_def) case RTREE: if (key_def->part_count != 1) { tnt_raise(ClientError, ER_MODIFY_INDEX, - (unsigned) key_def->iid, - (unsigned) key_def->space_id, + key_def->name, + space_name(space), "RTREE index key can not be multipart"); } if (key_def->is_unique) { tnt_raise(ClientError, ER_MODIFY_INDEX, - (unsigned) key_def->iid, - (unsigned) key_def->space_id, + key_def->name, + space_name(space), "RTREE index can not be unique"); } break; case BITSET: if (key_def->part_count != 1) { tnt_raise(ClientError, ER_MODIFY_INDEX, - (unsigned) key_def->iid, - (unsigned) key_def->space_id, + key_def->name, + space_name(space), "BITSET index key can not be multipart"); } if (key_def->is_unique) { tnt_raise(ClientError, ER_MODIFY_INDEX, - (unsigned) key_def->iid, - (unsigned) key_def->space_id, + key_def->name, + space_name(space), "BITSET can not be unique"); } break; default: tnt_raise(ClientError, ER_INDEX_TYPE, - (unsigned) key_def->iid, - (unsigned) key_def->space_id); + key_def->name, + space_name(space)); break; } for (uint32_t i = 0; i < key_def->part_count; i++) { @@ -198,16 +198,16 @@ MemtxEngine::keydefCheck(struct key_def *key_def) case STRING: if (key_def->type == RTREE) { tnt_raise(ClientError, ER_MODIFY_INDEX, - (unsigned) key_def->iid, - (unsigned) key_def->space_id, + key_def->name, + space_name(space), "RTREE index field type must be ARRAY"); } break; case ARRAY: if (key_def->type != RTREE) { tnt_raise(ClientError, ER_MODIFY_INDEX, - (unsigned) key_def->iid, - (unsigned) key_def->space_id, + key_def->name, + space_name(space), "ARRAY field type is not supported"); } break; diff --git a/src/box/memtx_engine.h b/src/box/memtx_engine.h index 1fade65a6080874c0facc3c73649f0b47dbedbef..127633f52604b7b63edb6b7c16798211f2a876c6 100644 --- a/src/box/memtx_engine.h +++ b/src/box/memtx_engine.h @@ -35,7 +35,7 @@ struct MemtxEngine: public Engine { virtual Handler *open(); virtual Index *createIndex(struct key_def *key_def); virtual void dropIndex(Index *index); - virtual void keydefCheck(struct key_def *key_def); + virtual void keydefCheck(struct space *space, struct key_def *key_def); virtual void rollback(struct txn*); virtual void begin_recover_snapshot(int64_t lsn); virtual void end_recover_snapshot(); diff --git a/src/box/memtx_hash.cc b/src/box/memtx_hash.cc index 7ff90bc5ce6f08ccab4c0fa6594fbe584e636b19..0b6a90e12bb16ebd1dabee8673caf29ce2a6eabd 100644 --- a/src/box/memtx_hash.cc +++ b/src/box/memtx_hash.cc @@ -297,7 +297,7 @@ MemtxHash::replace(struct tuple *old_tuple, struct tuple *new_tuple, "recover of int hash_table"); } } - tnt_raise(ClientError, errcode, index_id(this)); + tnt_raise(ClientError, errcode, index_name(this)); } if (dup_tuple) diff --git a/src/box/memtx_tree.cc b/src/box/memtx_tree.cc index 1983483052766168678918b1f0602596070152d9..528c156e0829462736dc0519e4c8caba116498e3 100644 --- a/src/box/memtx_tree.cc +++ b/src/box/memtx_tree.cc @@ -250,7 +250,7 @@ MemtxTree::replace(struct tuple *old_tuple, struct tuple *new_tuple, bps_tree_index_delete(&tree, new_tuple); if (dup_tuple) bps_tree_index_insert(&tree, dup_tuple, 0); - tnt_raise(ClientError, errcode, index_id(this)); + tnt_raise(ClientError, errcode, index_name(this)); } if (dup_tuple) return dup_tuple; diff --git a/src/box/sophia_engine.cc b/src/box/sophia_engine.cc index e63dd634e6ee24f842f8aeb19e67e14547bb9803..ccf19ceb824965324021020b8a9b4d4d72edcb15 100644 --- a/src/box/sophia_engine.cc +++ b/src/box/sophia_engine.cc @@ -215,40 +215,40 @@ SophiaEngine::dropIndex(Index *index) } void -SophiaEngine::keydefCheck(struct key_def *key_def) +SophiaEngine::keydefCheck(struct space *space, struct key_def *key_def) { switch (key_def->type) { case TREE: if (! key_def->is_unique) { tnt_raise(ClientError, ER_MODIFY_INDEX, - (unsigned) key_def->iid, - (unsigned) key_def->space_id, + key_def->name, + space_name(space), "Sophia TREE index must be unique"); } if (key_def->iid != 0) { tnt_raise(ClientError, ER_MODIFY_INDEX, - (unsigned) key_def->iid, - (unsigned) key_def->space_id, + key_def->name, + space_name(space), "Sophia TREE secondary indexes are not supported"); } if (key_def->part_count != 1) { tnt_raise(ClientError, ER_MODIFY_INDEX, - (unsigned) key_def->iid, - (unsigned) key_def->space_id, + key_def->name, + space_name(space), "Sophia TREE index key can not be multipart"); } if (key_def->parts[0].type != NUM && key_def->parts[0].type != STRING) { tnt_raise(ClientError, ER_MODIFY_INDEX, - (unsigned) key_def->iid, - (unsigned) key_def->space_id, + key_def->name, + space_name(space), "Sophia TREE index field type must be STR or NUM"); } break; default: tnt_raise(ClientError, ER_INDEX_TYPE, - (unsigned) key_def->iid, - (unsigned) key_def->space_id); + key_def->name, + space_name(space)); break; } } diff --git a/src/box/sophia_engine.h b/src/box/sophia_engine.h index c0fcfdcf19ee088db805267e26622d41c54c136d..5dbca59607f7af75d7fc60d8e2a948d28378d4d9 100644 --- a/src/box/sophia_engine.h +++ b/src/box/sophia_engine.h @@ -36,7 +36,7 @@ struct SophiaEngine: public Engine { virtual Handler *open(); virtual Index *createIndex(struct key_def*); virtual void dropIndex(Index*); - virtual void keydefCheck(struct key_def*f); + virtual void keydefCheck(struct space *space, struct key_def*f); virtual void begin(struct txn*, struct space*); virtual void commit(struct txn*); virtual void rollback(struct txn*); diff --git a/src/box/sophia_index.cc b/src/box/sophia_index.cc index 8a833d6a4e5d3f265379204576b575b321efc5c9..7a57c06b02d26d297451c31339d043f049f8996f 100644 --- a/src/box/sophia_index.cc +++ b/src/box/sophia_index.cc @@ -322,7 +322,7 @@ SophiaIndex::replace(struct tuple *old_tuple, struct tuple *new_tuple, if (errcode) { if (dup_tuple) tuple_unref(dup_tuple); - tnt_raise(ClientError, errcode, index_id(this)); + tnt_raise(ClientError, errcode, index_name(this)); } int rc; rc = sophia_index_stmt(engine->tx, db, 0, key_def, new_tuple); diff --git a/src/box/space.cc b/src/box/space.cc index aee0b277936137f5cda7014de8ec54436b7d749d..4956fbfd565b2268081255403fdc73a2317e5e2d 100644 --- a/src/box/space.cc +++ b/src/box/space.cc @@ -238,15 +238,15 @@ space_build_secondary_keys(struct space *space) uint32_t n_tuples = pk->size(); if (n_tuples > 0) { - say_info("Building secondary indexes in space %d...", - space_id(space)); + say_info("Building secondary indexes in space '%s'...", + space_name(space)); } for (uint32_t j = 1; j < space->index_count; j++) index_build(space->index[j], pk); if (n_tuples > 0) { - say_info("Space %d: done", space_id(space)); + say_info("Space '%s': done", space_name(space)); } } engine_recovery *r = &space->handler->recovery; @@ -309,7 +309,7 @@ space_validate_tuple(struct space *sp, struct tuple *new_tuple) uint32_t field_count = tuple_field_count(new_tuple); if (sp->def.field_count > 0 && sp->def.field_count != field_count) tnt_raise(ClientError, ER_SPACE_FIELD_COUNT, - field_count, sp->def.id, sp->def.field_count); + field_count, space_name(sp), sp->def.field_count); } void diff --git a/src/box/space.h b/src/box/space.h index 76313296f5df8b346575d44fed4df73cbb8474f8..ef4849f2ecea122f0649ad3b5dff324ffe79ca40 100644 --- a/src/box/space.h +++ b/src/box/space.h @@ -271,7 +271,7 @@ index_find(struct space *space, uint32_t index_id) Index *index = space_index(space, index_id); if (index == NULL) tnt_raise(LoggedError, ER_NO_SUCH_INDEX, index_id, - space->def.name); + space_name(space)); return index; } diff --git a/src/box/tuple.cc b/src/box/tuple.cc index ab63e89271c842b9690fec754b5515daca7b0af2..0f5eef27a3dc883047bd54d5f001e141e1f32fd8 100644 --- a/src/box/tuple.cc +++ b/src/box/tuple.cc @@ -77,7 +77,7 @@ field_type_create(enum field_type *types, uint32_t field_count, if (*ptype != UNKNOWN && *ptype != part->type) { tnt_raise(ClientError, ER_FIELD_TYPE_MISMATCH, - key_def->iid, part - key_def->parts, + key_def->name, part - key_def->parts, field_type_strs[part->type], field_type_strs[*ptype]); } diff --git a/test/big/hash.result b/test/big/hash.result index b9a4de03136477f1712588a3d9709b5b8aaa4b21..0a54595a61ce624144ed6e2b5a62049f28c27d67 100644 --- a/test/big/hash.result +++ b/test/big/hash.result @@ -538,7 +538,7 @@ hash.index['field3']:get{10} -- TupleFound (primary key) hash:insert{1, 10, 10, 10} --- -- error: Duplicate key exists in unique index 0 +- error: Duplicate key exists in index 'primary' ... hash.index['primary']:get{10} --- @@ -580,7 +580,7 @@ hash.index['field3']:get{10} -- TupleFound (key --1) hash:insert{10, 0, 10, 10} --- -- error: Duplicate key exists in unique index 0 +- error: Duplicate key exists in index 'primary' ... hash.index['primary']:get{10} --- @@ -627,7 +627,7 @@ hash.index['field1']:get{0} -- TupleFound (key --3) hash:insert{10, 10, 10, 0} --- -- error: Duplicate key exists in unique index 0 +- error: Duplicate key exists in index 'primary' ... hash.index['primary']:get{10} --- diff --git a/test/big/hash_multipart.result b/test/big/hash_multipart.result index 7d6bd7cbe5317b9837246ad7c24df489e1e681c0..b24c4eea0874263dac00e983340e0f0213472cdc 100644 --- a/test/big/hash_multipart.result +++ b/test/big/hash_multipart.result @@ -46,7 +46,7 @@ hash:insert{1, 'bar', 1, '', 4} -- try to insert a row with a duplicate key hash:insert{1, 'bar', 1, '', 5} --- -- error: Duplicate key exists in unique index 0 +- error: Duplicate key exists in index 'primary' ... -- output all rows --# setopt delimiter ';' diff --git a/test/big/lua.result b/test/big/lua.result index fa52503c9d91d6db652c87630d80c42b66595902..a140f10053a992ec01ea1f5059adf5ffdf3594d0 100644 --- a/test/big/lua.result +++ b/test/big/lua.result @@ -106,7 +106,7 @@ space:insert{'1', 'hello', 'world'} ... space:insert{'2', 'hello', 'world'} --- -- error: Duplicate key exists in unique index 1 +- error: Duplicate key exists in index 'minmax' ... space:drop() --- diff --git a/test/big/tree_pk.result b/test/big/tree_pk.result index da77322828d523a217567e9084adc1cdcd7a23b7..8e651cce9b89fd5229af1239b0439e17ddb13b09 100644 --- a/test/big/tree_pk.result +++ b/test/big/tree_pk.result @@ -364,7 +364,7 @@ s0.index['i3']:select{10} -- TupleFound (primary key) s0:insert{1, 10, 10, 10} --- -- error: Duplicate key exists in unique index 0 +- error: Duplicate key exists in index 'primary' ... s0.index['primary']:get{10} --- @@ -409,7 +409,7 @@ s0.index['i3']:select{10} -- TupleFound (key #1) s0:insert{10, 0, 10, 10} --- -- error: Duplicate key exists in unique index 0 +- error: Duplicate key exists in index 'primary' ... s0.index['primary']:get{10} --- @@ -434,7 +434,7 @@ s0.index['i1']:select{0} -- TupleFound (key #1) s0:replace{2, 0, 10, 10} --- -- error: Duplicate key exists in unique index 1 +- error: Duplicate key exists in index 'i1' ... s0.index['primary']:get{10} --- @@ -459,7 +459,7 @@ s0.index['i1']:select{0} -- TupleFound (key #3) s0:insert{10, 10, 10, 0} --- -- error: Duplicate key exists in unique index 0 +- error: Duplicate key exists in index 'primary' ... s0.index['primary']:get{10} --- @@ -484,7 +484,7 @@ s0.index['i3']:select{0} -- TupleFound (key #3) s0:replace{2, 10, 10, 0} --- -- error: Duplicate key exists in unique index 1 +- error: Duplicate key exists in index 'i1' ... s0.index['primary']:get{10} --- diff --git a/test/box/alter.result b/test/box/alter.result index 06f8a885e1b89c26a265c84f7c840a141bb86349..c736a151493979faca43d9e0c455e51592ff8631 100644 --- a/test/box/alter.result +++ b/test/box/alter.result @@ -13,7 +13,7 @@ ADMIN = 1 -- _space:insert{_space.id, ADMIN, 'test', 5 } --- -- error: Duplicate key exists in unique index 0 +- error: Duplicate key exists in index 'primary' ... -- -- Bad space id @@ -27,14 +27,14 @@ _space:insert{'hello', 'world', 'test'} -- _space:insert{_space.id, ADMIN, 'test', 'world'} --- -- error: Duplicate key exists in unique index 0 +- error: Duplicate key exists in index 'primary' ... -- -- There is already a tuple for the system space -- _space:insert{_space.id, ADMIN, '_space', 'memtx', 0} --- -- error: Duplicate key exists in unique index 0 +- error: Duplicate key exists in index 'primary' ... _space:replace{_space.id, ADMIN, '_space', 'memtx', 0} --- @@ -42,7 +42,7 @@ _space:replace{_space.id, ADMIN, '_space', 'memtx', 0} ... _space:insert{_index.id, ADMIN, '_index', 'memtx', 0} --- -- error: Duplicate key exists in unique index 0 +- error: Duplicate key exists in index 'primary' ... _space:replace{_index.id, ADMIN, '_index', 'memtx', 0} --- @@ -60,22 +60,22 @@ _space:replace{_space.id, ADMIN, '_space', 'memtx', 0} -- _space:delete{_space.id} --- -- error: 'Can''t drop space 280: the space has indexes' +- error: 'Can''t drop space ''_space'': the space has indexes' ... _space:delete{_index.id} --- -- error: 'Can''t drop space 288: the space has indexes' +- error: 'Can''t drop space ''_index'': the space has indexes' ... -- -- Can't change properties of a space -- _space:update({_space.id}, {{'+', 1, 1}}) --- -- error: 'Can''t modify space 280: space id is immutable' +- error: 'Can''t modify space ''_space'': space id is immutable' ... _space:update({_space.id}, {{'+', 1, 2}}) --- -- error: 'Can''t modify space 280: space id is immutable' +- error: 'Can''t modify space ''_space'': space id is immutable' ... -- -- Create a space @@ -138,7 +138,7 @@ space:replace{0} ... _index:insert{_space.id, 0, 'primary', 'tree', 1, 1, 0, 'num'} --- -- error: Duplicate key exists in unique index 0 +- error: Duplicate key exists in index 'primary' ... _index:replace{_space.id, 0, 'primary', 'tree', 1, 1, 0, 'num'} --- @@ -146,7 +146,7 @@ _index:replace{_space.id, 0, 'primary', 'tree', 1, 1, 0, 'num'} ... _index:insert{_index.id, 0, 'primary', 'tree', 1, 2, 0, 'num', 1, 'num'} --- -- error: Duplicate key exists in unique index 0 +- error: Duplicate key exists in index 'primary' ... _index:replace{_index.id, 0, 'primary', 'tree', 1, 2, 0, 'num', 1, 'num'} --- @@ -175,7 +175,7 @@ _index:select{} -- modify indexes of a system space _index:delete{_index.id, 0} --- -- error: Can't drop the primary key in a system space, space id 288 +- error: Can't drop the primary key in a system space, space '_index' ... _space:insert{1000, ADMIN, 'hello', 'memtx', 0} --- @@ -323,7 +323,7 @@ auto = box.schema.create_space('auto_original') ... auto2 = box.schema.create_space('auto', {id = auto.id}) --- -- error: Duplicate key exists in unique index 0 +- error: Duplicate key exists in index 'primary' ... box.schema.space.drop('auto') --- diff --git a/test/box/alter_limits.result b/test/box/alter_limits.result index f89e5d14deda8fc4bd691b071d61da760a75eca7..e80e514eb1cde92cdca4c9799817de6ac86d147e 100644 --- a/test/box/alter_limits.result +++ b/test/box/alter_limits.result @@ -84,7 +84,7 @@ s.id -- duplicate id box.schema.create_space('tweedledee', { id = 3000 }) --- -- error: Duplicate key exists in unique index 0 +- error: Duplicate key exists in index 'primary' ... -- stupid space id box.schema.create_space('tweedledee', { id = 'tweedledee' }) @@ -97,17 +97,19 @@ s:drop() -- too long space name box.schema.create_space(string.rep('tweedledee', 100)) --- -- error: 'Failed to create space 512: space name is too long' +- error: 'Failed to create space ''tweedledeetweedledeetweedledeetw'': space name + is too long' ... -- too long space engine name box.schema.create_space('tweedleedee', { engine = string.rep('too-long', 100) }) --- -- error: 'Failed to create space 512: space engine name is too long' +- error: 'Failed to create space ''tweedleedee'': space engine name is too long' ... -- space name limit box.schema.create_space(string.rep('t', box.schema.NAME_MAX)..'_') --- -- error: 'Failed to create space 512: space name is too long' +- error: 'Failed to create space ''tttttttttttttttttttttttttttttttt'': space name + is too long' ... s = box.schema.create_space(string.rep('t', box.schema.NAME_MAX - 1)..'_') --- @@ -196,7 +198,8 @@ box.space['tweedledum'] -- rename space - bad name s:rename(string.rep('t', box.schema.NAME_MAX * 2)) --- -- error: 'Can''t modify space 512: space name is too long' +- error: 'Can''t modify space ''tttttttttttttttttttttttttttttttt'': space name is + too long' ... s.name --- @@ -239,7 +242,7 @@ index = s:create_index('primary') -- field_count actually works s:insert{1} --- -- error: Tuple field count 1 does not match space 512 field count 2 +- error: Tuple field count 1 does not match space 'test' field count 2 ... s:insert{1, 2} --- @@ -247,7 +250,7 @@ s:insert{1, 2} ... s:insert{1, 2, 3} --- -- error: Tuple field count 3 does not match space 512 field count 2 +- error: Tuple field count 3 does not match space 'test' field count 2 ... s:select{} --- @@ -259,7 +262,8 @@ FIELD_COUNT = 4 -- increase field_count -- error box.space['_space']:update(s.id, {{"=", FIELD_COUNT + 1, 3}}) --- -- error: 'Can''t modify space 512: can not change field count on a non-empty space' +- error: 'Can''t modify space ''test'': can not change field count on a non-empty + space' ... s:select{} --- @@ -268,7 +272,8 @@ s:select{} -- decrease field_count - error box.space['_space']:update(s.id, {{"=", FIELD_COUNT + 1, 1}}) --- -- error: 'Can''t modify space 512: can not change field count on a non-empty space' +- error: 'Can''t modify space ''test'': can not change field count on a non-empty + space' ... -- remove field_count - ok box.space['_space']:update(s.id, {{"=", FIELD_COUNT + 1, 0}}) @@ -282,7 +287,8 @@ s:select{} -- increase field_count - error box.space['_space']:update(s.id, {{"=", FIELD_COUNT + 1, 3}}) --- -- error: 'Can''t modify space 512: can not change field count on a non-empty space' +- error: 'Can''t modify space ''test'': can not change field count on a non-empty + space' ... s:truncate() --- @@ -303,7 +309,7 @@ s:select{} -- field_count actually works s:insert{3, 4} --- -- error: Tuple field count 2 does not match space 512 field count 3 +- error: Tuple field count 2 does not match space 'test' field count 3 ... s:insert{3, 4, 5} --- @@ -311,7 +317,7 @@ s:insert{3, 4, 5} ... s:insert{3, 4, 5, 6} --- -- error: Tuple field count 4 does not match space 512 field count 3 +- error: Tuple field count 4 does not match space 'test' field count 3 ... s:insert{7, 8, 9} --- @@ -366,28 +372,31 @@ for k, v in pairs (s.index) do if v.id ~= 0 then v:drop() end end -- unknown index type index = s:create_index('test', { type = 'nosuchtype' }) --- -- error: Unsupported index type supplied for index 1 in space 512 +- error: Unsupported index type supplied for index 'test' in space 'test' ... -- hash index is not unique index = s:create_index('test', { type = 'hash', unique = false }) --- -- error: 'Can''t create or modify index 1 in space 512: HASH index must be unique' +- error: 'Can''t create or modify index ''test'' in space ''test'': HASH index must + be unique' ... -- bitset index is unique index = s:create_index('test', { type = 'bitset', unique = true }) --- -- error: 'Can''t create or modify index 1 in space 512: BITSET can not be unique' +- error: 'Can''t create or modify index ''test'' in space ''test'': BITSET can not + be unique' ... -- bitset index is multipart index = s:create_index('test', { type = 'bitset', parts = {1, 'num', 2, 'num'}}) --- -- error: 'Can''t create or modify index 1 in space 512: BITSET index key can not be - multipart' +- error: 'Can''t create or modify index ''test'' in space ''test'': BITSET index key + can not be multipart' ... -- part count must be positive index = s:create_index('test', { type = 'hash', parts = {}}) --- -- error: 'Can''t create or modify index 1 in space 512: part count must be positive' +- error: 'Can''t create or modify index ''test'' in space ''test'': part count must + be positive' ... -- part count must be positive index = s:create_index('test', { type = 'hash', parts = { 1 }}) @@ -398,7 +407,8 @@ index = s:create_index('test', { type = 'hash', parts = { 1 }}) -- unknown field type index = s:create_index('test', { type = 'hash', parts = { 1, 'nosuchtype' }}) --- -- error: 'Can''t create or modify index 1 in space 512: unknown field type' +- error: 'Can''t create or modify index ''test'' in space ''test'': unknown field + type' ... -- bad field no index = s:create_index('test', { type = 'hash', parts = { 'qq', 'nosuchtype' }}) @@ -409,15 +419,18 @@ index = s:create_index('test', { type = 'hash', parts = { 'qq', 'nosuchtype' }}) -- big field no index = s:create_index('test', { type = 'hash', parts = { box.schema.FIELD_MAX, 'num' }}) --- -- error: 'Can''t create or modify index 1 in space 512: field no is too big' +- error: 'Can''t create or modify index ''test'' in space ''test'': field no is too + big' ... index = s:create_index('test', { type = 'hash', parts = { box.schema.FIELD_MAX - 1, 'num' }}) --- -- error: 'Can''t create or modify index 1 in space 512: field no is too big' +- error: 'Can''t create or modify index ''test'' in space ''test'': field no is too + big' ... index = s:create_index('test', { type = 'hash', parts = { box.schema.FIELD_MAX + 90, 'num' }}) --- -- error: 'Can''t create or modify index 1 in space 512: field no is too big' +- error: 'Can''t create or modify index ''test'' in space ''test'': field no is too + big' ... index = s:create_index('test', { type = 'hash', parts = { box.schema.INDEX_FIELD_MAX + 1, 'num' }}) --- @@ -438,7 +451,8 @@ s = box.schema.create_space('test') -- same part can't be indexed twice index = s:create_index('t1', { type = 'hash', parts = { 1, 'num', 1, 'str' }}) --- -- error: 'Can''t create or modify index 0 in space 512: same key part is indexed twice' +- error: 'Can''t create or modify index ''t1'' in space ''test'': same key part is + indexed twice' ... -- a lot of key parts parts = {} @@ -457,7 +471,7 @@ end; ... index = s:create_index('t1', { type = 'hash', parts = parts}); --- -- error: 'Can''t create or modify index 0 in space 512: too many key parts' +- error: 'Can''t create or modify index ''t1'' in space ''test'': too many key parts' ... parts = {}; --- @@ -496,8 +510,8 @@ index = s:create_index('t1', { type = 'hash' }) -- field type contradicts field type of another index index = s:create_index('t2', { type = 'hash', parts = { 1, 'str' }}) --- -- error: Ambiguous field type in index 1, key part 0. Requested type is STR but the - field has previously been defined as NUM +- error: Ambiguous field type in index 't2', key part 0. Requested type is STR but + the field has previously been defined as NUM ... -- ok index = s:create_index('t2', { type = 'hash', parts = { 2, 'str' }}) @@ -506,7 +520,7 @@ index = s:create_index('t2', { type = 'hash', parts = { 2, 'str' }}) -- don't allow drop of the primary key in presence of other keys s.index[0]:drop() --- -- error: Can't drop primary key in space 512 while secondary keys exist +- error: Can't drop primary key in space 'test' while secondary keys exist ... -- cleanup s:drop() @@ -579,7 +593,8 @@ s.index.new.name -- too long name s.index[0]:rename(string.rep('t', box.schema.NAME_MAX)..'_') --- -- error: 'Can''t create or modify index 0 in space 512: index name is too long' +- error: 'Can''t create or modify index ''tttttttttttttttttttttttttttttttt_'' in space + ''test'': index name is too long' ... s.index[0].name --- @@ -624,12 +639,14 @@ s.index.primary.alter({unique=false}) ... s.index.primary:alter({unique=false}) --- -- error: 'Can''t create or modify index 0 in space 512: primary key must be unique' +- error: 'Can''t create or modify index ''primary'' in space ''test'': primary key + must be unique' ... -- unique -> non-unique, index type s.index.primary:alter({type='tree', unique=false, name='pk'}) --- -- error: 'Can''t create or modify index 0 in space 512: primary key must be unique' +- error: 'Can''t create or modify index ''pk'' in space ''test'': primary key must + be unique' ... --# push filter 'function: .*' to 'function <pointer>' s.index.primary @@ -671,7 +688,7 @@ index = s:create_index('third', { type = 'hash', parts = { 3, 'num' } }) ... s.index.third:rename('second') --- -- error: Duplicate key exists in unique index 2 +- error: Duplicate key exists in index 'name' ... s.index.third.id --- @@ -752,12 +769,12 @@ s.index.primary:select{} -- a duplicate in the created index index = s:create_index('nodups', { type = 'tree', unique=true, parts = { 2, 'num'} }) --- -- error: Duplicate key exists in unique index 2 +- error: Duplicate key exists in index 'nodups' ... -- change of non-unique index to unique: same effect s.index.year:alter({unique=true}) --- -- error: Duplicate key exists in unique index 1 +- error: Duplicate key exists in index 'year' ... s.index.primary:select{} --- @@ -776,8 +793,8 @@ box.space['_index']:update({s.id, s.index.year.id}, {{"=", 8, 'num'}}) -- ambiguous field type index = s:create_index('str', { type = 'tree', unique = false, parts = { 2, 'str'}}) --- -- error: Ambiguous field type in index 2, key part 0. Requested type is STR but the - field has previously been defined as NUM +- error: Ambiguous field type in index 'str', key part 0. Requested type is STR but + the field has previously been defined as NUM ... -- create index on a non-existing field index = s:create_index('nosuchfield', { type = 'tree', unique = true, parts = { 3, 'str'}}) @@ -815,7 +832,8 @@ s = box.schema.create_space('test') -- primary key must be unique index = s:create_index('primary', { unique = false }) --- -- error: 'Can''t create or modify index 0 in space 512: primary key must be unique' +- error: 'Can''t create or modify index ''primary'' in space ''test'': primary key + must be unique' ... -- create primary key index = s:create_index('primary', { type = 'hash' }) @@ -834,7 +852,7 @@ s:insert{2, 1} ... s.index.secondary:alter{ unique = true } --- -- error: Duplicate key exists in unique index 1 +- error: Duplicate key exists in index 'secondary' ... s:delete{2} --- @@ -845,7 +863,7 @@ s.index.secondary:alter{ unique = true } ... s:insert{2, 1} --- -- error: Duplicate key exists in unique index 1 +- error: Duplicate key exists in index 'secondary' ... s:insert{2, 2} --- diff --git a/test/box/call.result b/test/box/call.result index 92ec8d56ee78001e6cfd2b321bcbc2bbfe1ee652..7b57997d1cd7254c9bbedc3fefc7a2e30c1c2210 100644 --- a/test/box/call.result +++ b/test/box/call.result @@ -324,7 +324,7 @@ call myinsert(3, 'old', 2) --- - error: errcode: ER_TUPLE_FOUND - errmsg: Duplicate key exists in unique index 0 + errmsg: Duplicate key exists in index 'primary' ... space:update({3}, {{'=', 1, 4}, {'=', 2, 'new'}}) --- diff --git a/test/box/fiber.result b/test/box/fiber.result index 662257c41c39252ca52556ecd51ed8b4454b7d9e..da10dfd9596b4d4a0bba255f832b37e1838bb1ef 100644 --- a/test/box/fiber.result +++ b/test/box/fiber.result @@ -141,7 +141,7 @@ space:insert{1953719668, 'old', 1684234849} -- test that insert produces a duplicate key error space:insert{1953719668, 'old', 1684234849} --- -- error: Duplicate key exists in unique index 0 +- error: Duplicate key exists in index 'primary' ... space:update(1953719668, {{'=', 1, 1936941424}, {'=', 2, 'new'}}) --- diff --git a/test/box/misc.result b/test/box/misc.result index cbea705ed533ce6e1476325d298b079f63d67ad5..f0cf679c7f16b096d6dd283db81e6a1c54a92f70 100644 --- a/test/box/misc.result +++ b/test/box/misc.result @@ -293,7 +293,7 @@ pcall(myinsert, {1, 'hello'}) pcall(myinsert, {1, 'hello'}) --- - false -- Duplicate key exists in unique index 0 +- Duplicate key exists in index 'primary' ... box.space.tweedledum:truncate() --- diff --git a/test/box/net.box.result b/test/box/net.box.result index a1b225fd00b6021734c3b3eef4a7911f8ffcb75b..0f0abad763c78fab1e3d9be2e4ce4ec4e4cd3dbc 100644 --- a/test/box/net.box.result +++ b/test/box/net.box.result @@ -228,7 +228,7 @@ cn.space.net_box_test_space:insert{234, 1,2,3} ... cn.space.net_box_test_space:insert{234, 1,2,3} --- -- error: Duplicate key exists in unique index 0 +- error: Duplicate key exists in index 'primary' ... cn.space.net_box_test_space.insert{234, 1,2,3} --- diff --git a/test/box/rtree_misc.result b/test/box/rtree_misc.result index 891e65c29800c7dd2d23d7a34f51af8ff5302a61..ca6900581ca200764d629d9456c88e0533649605 100644 --- a/test/box/rtree_misc.result +++ b/test/box/rtree_misc.result @@ -4,29 +4,35 @@ s = box.schema.create_space('spatial') -- rtree index as primary key must be forbidden (unique) i = s:create_index('spatial', { type = 'rtree', unique = true, parts = {1, 'array'}}) --- -- error: 'Can''t create or modify index 0 in space 512: RTREE index can not be unique' +- error: 'Can''t create or modify index ''spatial'' in space ''spatial'': RTREE index + can not be unique' ... -- any non-unique index as primary key must be forbidden i = s:create_index('spatial', { type = 'hash', unique = false, parts = {1, 'num'}}) --- -- error: 'Can''t create or modify index 0 in space 512: primary key must be unique' +- error: 'Can''t create or modify index ''spatial'' in space ''spatial'': primary + key must be unique' ... i = s:create_index('spatial', { type = 'tree', unique = false, parts = {1, 'num'}}) --- -- error: 'Can''t create or modify index 0 in space 512: primary key must be unique' +- error: 'Can''t create or modify index ''spatial'' in space ''spatial'': primary + key must be unique' ... i = s:create_index('spatial', { type = 'rtree', unique = false, parts = {1, 'array'}}) --- -- error: 'Can''t create or modify index 0 in space 512: primary key must be unique' +- error: 'Can''t create or modify index ''spatial'' in space ''spatial'': primary + key must be unique' ... -- tree and hash indexes over array field is not possible i = s:create_index('primary', { type = 'tree', parts = {1, 'array'}}) --- -- error: 'Can''t create or modify index 0 in space 512: ARRAY field type is not supported' +- error: 'Can''t create or modify index ''primary'' in space ''spatial'': ARRAY field + type is not supported' ... i = s:create_index('primary', { type = 'hash', parts = {1, 'array'}}) --- -- error: 'Can''t create or modify index 0 in space 512: ARRAY field type is not supported' +- error: 'Can''t create or modify index ''primary'' in space ''spatial'': ARRAY field + type is not supported' ... -- normal indexes i = s:create_index('primary', { type = 'tree', parts = {1, 'num'}}) @@ -47,25 +53,26 @@ i = s:insert{1, {2, 3, 4}} -- rtree index must be one-part i = s:create_index('spatial', { type = 'rtree', unique = false, parts = {1, 'array', 2, 'array'}}) --- -- error: 'Can''t create or modify index 2 in space 512: RTREE index key can not be - multipart' +- error: 'Can''t create or modify index ''spatial'' in space ''spatial'': RTREE index + key can not be multipart' ... -- unique rtree index is not possible i = s:create_index('spatial', { type = 'rtree', unique = true, parts = {3, 'array'}}) --- -- error: 'Can''t create or modify index 2 in space 512: RTREE index can not be unique' +- error: 'Can''t create or modify index ''spatial'' in space ''spatial'': RTREE index + can not be unique' ... -- num rtree index is not possible i = s:create_index('spatial', { type = 'rtree', unique = false, parts = {3, 'num'}}) --- -- error: 'Can''t create or modify index 2 in space 512: RTREE index field type must - be ARRAY' +- error: 'Can''t create or modify index ''spatial'' in space ''spatial'': RTREE index + field type must be ARRAY' ... -- str rtree index is not possible i = s:create_index('spatial', { type = 'rtree', unique = false, parts = {3, 'str'}}) --- -- error: 'Can''t create or modify index 2 in space 512: RTREE index field type must - be ARRAY' +- error: 'Can''t create or modify index ''spatial'' in space ''spatial'': RTREE index + field type must be ARRAY' ... -- normal rtree index i = s:create_index('spatial', { type = 'rtree', unique = false, parts = {3, 'array'}}) @@ -127,15 +134,17 @@ s:insert{1, 2, {3, 4, 5, 6}} -- invalid alters s.index.spatial:alter({unique = true}) --- -- error: 'Can''t create or modify index 2 in space 512: RTREE index can not be unique' +- error: 'Can''t create or modify index ''spatial'' in space ''spatial'': RTREE index + can not be unique' ... s.index.spatial:alter({type = 'tree'}) --- -- error: 'Can''t create or modify index 2 in space 512: ARRAY field type is not supported' +- error: 'Can''t create or modify index ''spatial'' in space ''spatial'': ARRAY field + type is not supported' ... box.space[box.schema.SPACE_ID]:update({s.id}, {{"=", 4, 'sophia'}}) --- -- error: 'Can''t modify space 512: can not change space engine' +- error: 'Can''t modify space ''spatial'': can not change space engine' ... -- chech that truncate works s.index.spatial:select({0, 0, 10, 10}, {iterator = 'le'}) @@ -202,7 +211,7 @@ s = box.schema.create_space('sophia', {engine = 'sophia'}) -- rtree indexes are not enabled in sophia i = s:create_index('spatial', { type = 'rtree', unique = true, parts = {3, 'array'}}) --- -- error: Unsupported index type supplied for index 0 in space 512 +- error: Unsupported index type supplied for index 'spatial' in space 'sophia' ... i = s:create_index('primary', { type = 'tree', parts = {1, 'num'}}) --- @@ -210,7 +219,7 @@ i = s:create_index('primary', { type = 'tree', parts = {1, 'num'}}) -- ... even secondary i = s:create_index('spatial', { type = 'rtree', unique = true, parts = {3, 'array'}}) --- -- error: Unsupported index type supplied for index 1 in space 512 +- error: Unsupported index type supplied for index 'spatial' in space 'sophia' ... s:drop() --- diff --git a/test/box/temp_spaces.result b/test/box/temp_spaces.result index 548fb8cbddc76e3bd753a2ff3b7142ca23fbd415..5b35565bb95147edd4e998ff393adfb1cb99b003 100644 --- a/test/box/temp_spaces.result +++ b/test/box/temp_spaces.result @@ -59,7 +59,8 @@ box.space[box.schema.SPACE_ID]:update(s.id, {{'=', FLAGS, 'temporary'}}) ... box.space[box.schema.SPACE_ID]:update(s.id, {{'=', FLAGS, ''}}) --- -- error: 'Can''t modify space 512: can not switch temporary flag on a non-empty space' +- error: 'Can''t modify space ''t'': can not switch temporary flag on a non-empty + space' ... --# stop server default --# start server default @@ -122,7 +123,8 @@ box.space[box.schema.SPACE_ID]:update(s.id, {{'=', FLAGS, 'temporary'}}) ... box.space[box.schema.SPACE_ID]:update(s.id, {{'=', FLAGS, 'no-temporary'}}) --- -- error: 'Can''t modify space 512: can not switch temporary flag on a non-empty space' +- error: 'Can''t modify space ''t'': can not switch temporary flag on a non-empty + space' ... s:delete{1} --- diff --git a/test/sophia/dml.result b/test/sophia/dml.result index 10ce0b15df4f81cad172509f06bbb3d889346707..11d1243259b04757a457e948f53116a65212647b 100644 --- a/test/sophia/dml.result +++ b/test/sophia/dml.result @@ -106,7 +106,7 @@ space = box.schema.create_space('test', { id = 105, engine = 'sophia' }) ... index = space:create_index('primary', {type = 'hash'}) --- -- error: Unsupported index type supplied for index 0 in space 105 +- error: Unsupported index type supplied for index 'primary' in space 'test' ... space:drop() --- @@ -120,8 +120,8 @@ index1 = space:create_index('primary') ... index2 = space:create_index('secondary') --- -- error: 'Can''t create or modify index 1 in space 106: Sophia TREE secondary indexes - are not supported' +- error: 'Can''t create or modify index ''secondary'' in space ''test'': Sophia TREE + secondary indexes are not supported' ... space:drop() --- diff --git a/test/sophia/gh.result b/test/sophia/gh.result index 9a60d57f5fba8e5f7bf951f9dd90d443df857cc2..9a5f98bdf04dd69ac54cf8f2314f1ef41b2b23a6 100644 --- a/test/sophia/gh.result +++ b/test/sophia/gh.result @@ -66,7 +66,7 @@ s:drop() -- gh-436: No error when creating temporary sophia space s = box.schema.create_space('tester',{engine='sophia', temporary=true}) --- -- error: 'Can''t modify space 512: space does not support temporary flag' +- error: 'Can''t modify space ''tester'': space does not support temporary flag' ... -- gh-432: Sophia: ignored limit s = box.schema.create_space('tester',{id = 89, engine='sophia'})