Skip to content
Snippets Groups Projects
user avatar
Vladislav Shpilevoy authored
Closes #4519

@TarantoolBot document
Title: key_def.new() accept both 'field' and 'fieldno'

Before the patch key_def.new() took an index part
array as it is returned in <index_object>.parts: each
part should include 'type', 'fieldno', and what else
.parts element contains.

But it was not possible to create a key_def from an
index definition - the array passed to
<space_object>.create_index() 'parts' argument. Because
key_def.new() didn't recognize 'field' option. That
might be useful, when a key_def is needed on a remote
client, where a space object and its indexes do not
exist. And it would be strange to force a user to
create them just so as he would be able to access

    <net_box connection>.space.<space_name>.
        index.<index_name>.parts

As well as it would be crutchy to make a user manually
replace 'field' with 'fieldno' in its index definition
just to create a key_def.

Additionally, an ability to pass an index definition
to a key_def constructor makes the API more symmetric.

Note, that it still is not 100% symmetric, because a
user can't pass field names to the key_def
constructor. A space is needed for that anyway.
39918baf
History
Name Last commit Last update
..
lua
sql
CMakeLists.txt
alter.cc
alter.h
applier.cc
applier.h
authentication.cc
authentication.h
bind.c
bind.h
blackhole.c
blackhole.h
bootstrap.
bootstrap.snap
box.cc
box.h
call.c
call.h
checkpoint_schedule.c
checkpoint_schedule.h
ck_constraint.c
ck_constraint.h
coll_id.c
coll_id.h
coll_id_cache.c
coll_id_cache.h
coll_id_def.c
coll_id_def.h
column_mask.h
engine.c
engine.h
errcode.c
errcode.h
error.cc
error.h
execute.c
execute.h
field_def.c
field_def.h
field_map.c
field_map.h
fk_constraint.c
fk_constraint.h
func.c
func.h
func_def.c
func_def.h
gc.c
gc.h
identifier.c
identifier.h
index.cc
index.h
index_def.c
index_def.h
iproto.cc
iproto.h
iproto_constants.c
iproto_constants.h
iterator_type.c
iterator_type.h
journal.c
journal.h
key_def.c
key_def.h
key_list.c
key_list.h
memtx_bitset.c
memtx_bitset.h
memtx_engine.c
memtx_engine.h
memtx_hash.c
memtx_hash.h
memtx_rtree.c
memtx_rtree.h
memtx_space.c
memtx_space.h
memtx_tree.c
memtx_tree.h
merger.c
merger.h
opt_def.c
opt_def.h
port.c
port.h
recovery.cc
recovery.h
relay.cc
relay.h
replication.cc
replication.h
request.c
request.h
schema.cc
schema.h
schema_def.c
schema_def.h
sequence.c
sequence.h
session.cc
session.h
space.c
space.h
space_def.c
space_def.h
sql.c
sql.h
sysview.c
sysview.h
tuple.c
tuple.h
tuple_bloom.c
tuple_bloom.h
tuple_compare.cc
tuple_compare.h
tuple_convert.c
tuple_convert.h
tuple_dictionary.c
tuple_dictionary.h
tuple_extract_key.cc
tuple_extract_key.h
tuple_format.c
tuple_format.h
tuple_hash.cc
tuple_hash.h
tuple_update.c
tuple_update.h
txn.c
txn.h
user.cc
user.h
user_def.c
user_def.h
vclock.c
vclock.h
vinyl.c
vinyl.h
vy_cache.c
vy_cache.h
vy_entry.h
vy_history.c
vy_history.h
vy_log.c
vy_log.h
vy_lsm.c
vy_lsm.h
vy_mem.c
vy_mem.h
vy_point_lookup.c
vy_point_lookup.h
vy_quota.c
vy_quota.h
vy_range.c
vy_range.h
vy_read_iterator.c
vy_read_iterator.h
vy_read_set.c
vy_read_set.h
vy_read_view.h
vy_regulator.c
vy_regulator.h
vy_run.c
vy_run.h
vy_scheduler.c
vy_scheduler.h
vy_stat.h
vy_stmt.c
vy_stmt.h
vy_stmt_stream.h
vy_tx.c
vy_tx.h
vy_upsert.c
vy_upsert.h
vy_write_iterator.c
vy_write_iterator.h
wal.c
wal.h
xlog.c
xlog.h
xrow.c
xrow.h
xrow_io.cc
xrow_io.h
xstream.cc
xstream.h