- Oct 06, 2017
-
-
Vladimir Davydov authored
The typo caused the following box.schema.user.info() failure if the user was granted a permission to use a sequence: tarantool> box.schema.user.info() --- - error: 'builtin/box/schema.lua:1542: assign to undeclared variable ''seq''' ---
-
Vladimir Davydov authored
Class Handler contains only function pointers so we can easily convert it to a C struct. This is needed to introduce internal C API to perfrom DML requests on spaces which is required by SQL. Needed for #2776
-
Vladimir Davydov authored
- Engines should inherit struct space if they need to store engine specific data per space. - Engine::createSpace() now returns struct space instead of Handler. - Engines should overwrite Handler::destroy() to implement struct space destructor. This is a step towards converting class Handler to struct space_vtab. Needed for #2776
-
Vladimir Davydov authored
Currently, the format is stored in Handler and can be retrieved with Handler::format(). The only reason for such a layer of indirection is that the format should be created by an Engine method and currently it is created by Engine::createSpace(). Let's introduce a separate method for create a space format, Engine::createFormat(), and move the format back to where it belongs, i.e. to struct space. This is a step towards converting class Handler to struct space_vtab. Needed for #2776
-
Vladimir Davydov authored
We gain no benefit from having them separated from corresponding MemtxSpace::execute* methods. This is a step towards converting class Handler to struct space_vtab. Needed for #2776
-
Vladimir Davydov authored
space->handler->engine->... looks ugly. Since all Handler methods receive space as an argument anyway, let's move engine to struct space. This is a step towards converting class Handler to struct space_vtab. Needed for #2776
-
Alexandr Lyapunov authored
Make new option in index part - collation - where user can pass a name of a collation that he wants to use for comparison of the field. Fix #2649
-
Alexandr Lyapunov authored
Add a new space that contains collation definitions for future index collation and more. Add a collation cache for fast retrieving a collation object by its name. Needed for #2649
-
Alexandr Lyapunov authored
Introduce coll object that allows to compare strings. Add coll_def structure and functions for its setup. Add unit test. Needed for #2649
-
Alexandr Lyapunov authored
-
- Oct 05, 2017
-
-
Alexandr Lyapunov authored
Support [{field=<field_no>, type=<type>}, ...] index part format both in box.space._index and box.schema.index.create() Lua API. box.space_index now supports the following formats of index parts: 1. <field_no>, <type>, <field_no>, <type>, ... -- Tarantool 1.6.0+ 2. [[<field_no>, <type>], ...] -- Tarantool 1.6.6+ 3. [{field=<field_no>, type=<type>}] -- Tarantool 1.7.6+, this patch box.schema.upgrade() converts format #1 to #2. Format #2 is not converted automatically to #3 yet. Let's extend box.schema.upgrade() to do that later in order to keep upward compatibility for existing 1.7.x customers. Lua API now supports the following formats: 1. [<field1_no>, <type1>, ,..] -- Tarantool 1.6.0+ 2. [{field=<field_no>, type=<type>}] -- Tarantool 1.7.6+, this patch In addition to format #2, [{<field_no>, type = <type>}] and [<field_no>, <type>, may_be_added_in_the_future=xxx}] shortcut is supported. box.schema.space.create() automatically converts format #1 to #2, therefor all new indexes will have the new format. Closes #2802
-
Alexandr Lyapunov authored
By some philosophic reasons it was decided to name functions that deal with old format by name with a suffix - version of tarantool when the format was initially introduced instead of last version when this format was used.
-
Alexandr Lyapunov authored
-
Alexandr Lyapunov authored
Change type of 'map' argument to const char ** and return in it the end of parsed msgpack map.
-
Alexandr Lyapunov authored
Move opt_def functions from alter.cc to opt_def.c. Make no logical changes.
-
Alexandr Lyapunov authored
-
Alexandr Lyapunov authored
-
Ilya authored
Headers duplicates are written in string separated with comma Except special headers described in: https://nodejs.org/api/http.html#http_message_headers Relates to #2658
-
Roman Tsisyk authored
Fixes #2658
-
Vladislav Shpilevoy authored
In a case of collision of field and method names, the field name have higher priority. Closes #1014
-
Vladislav Shpilevoy authored
-
Vladislav Shpilevoy authored
Aliases will allow to call tuple methods, when tuple has fields with same names as methods. In such a case a field name has higher priority and the tuple method with the same name becomes inaccessible via tuple:...() API. Needed for #1014
-
Roman Tsisyk authored
-
Ilya authored
* Add package.search function * Fix failing tests after patch for new loaders Closes #2797
-
- Oct 04, 2017
-
-
Roman Tsisyk authored
A patch by Alexander Turenko. Fixes #2782
-
Ilya authored
Closes #2639
-
Vladimir Davydov authored
It's unclear how to perform access checks in this case. Let's forbid it explicitly until there's a user request for this feature.
-
Roman Tsisyk authored
- Fix the test case on macOS - Replace os.execute("cp ...") with fio.symlink() - Don't depend on files from other tests Follow up #2767
-
Ilya authored
- Add loader for current working directory - Add loader for rocks searching in higher dirs like npm - Remove rocks from `package.path` and `package.cpath` Closes #2767
-
Vladimir Davydov authored
-
Vladimir Davydov authored
Since commit c0a30d17 ("sequence: speed up allocation of sequence data tuple during checkpoint") sequence_data_iterator_next() does not throw an exception, so the whole thing can be moved to sequence.c.
-
Vladimir Davydov authored
- Add a new schema object class, 'sequence', which can be passed to box.schema.{grant,revoke} to grant access to a sequence. - To use a sequence (i.e. call next(), set(), or reset() on it), the user must either be the owner of the sequence or has a permission to write to it. - This also holds for sequences attached to spaces: the user can only insert a tuple to a space if he has a write access to the sequence attached to the space. UPDATE/DELETE do not require access to a sequence. - Automatically generated sequences are special: it can be used for auto increment (by passing nil to INSERT) even if the user was not explicitly granted access to it - it is enough to have write access to the space. See #389
-
- Oct 03, 2017
-
-
Vladislav Shpilevoy authored
vy_index_validate_formats() check consistency of vy_index formats. For example, all formats must have the same value of index_field_count and mem_format must be equal to disk_format for the primary index. Update disk_format for the primary key in the case when ALTER adds a new space:format() field.
-
- Oct 02, 2017
-
-
Vladislav Shpilevoy authored
Extract struct tuple_field from field_def. Store field_def in space_def and tuple_field in tuple_format. It allows to do not store field names in tuple_format and do not store binary offsets and internal flags in field definition (specified by an user).
-
Vladislav Shpilevoy authored
Make all iterators keys not const and reference them. Actually they were not const before, because they had been casted to (struct tuple *) explicitly by vy_tx_track(). Also it is needed for #1557, where iterators must be able to store key, not stored in a read iterator.
-
Vladislav Shpilevoy authored
Mp_compare_integer can be called from mp_compare_number. Both of them calls mp_typeof() for their arguments. But mp_typeof() makes lookup in a big table in msgpuck.h. Lets pass already decoded types from mp_compare_number to mp_compare_integer. Introduce similar functions with hint for other comparators.
-
- Sep 30, 2017
-
-
Vladislav Shpilevoy authored
-
- Sep 28, 2017
-
-
Vladislav Shpilevoy authored
Vinyl surrogate tuple can be constructed using a key and filling not indexed fields with NULL values. But not indexed field can be formatted using space:format. Such fields can not store NULLs and tuple_init_field_map raises an error on it. But vinyl actually does not use not indexed fields in surrogate tuples so we can store NULLs in surrogate not indexed formatted fields. Besides, we can not use field->type != FIELD_TYPE_ANY as a flag that a field is not indexed and is not formatted. Now ANY field type is available for users. To check if a field can be nullified in a surrogate tuple we must use key_def. The same problem is actual for construction a surrogate tuple from a normal tuple - we can not anymore use type != FIELD_TYPE_ANY to define a field is not indexed. Moreover in such a case we also can skip fields not used by an index and placed after the last field used by an index. For this optimization introduce tuple_format.index_field_count and field_def.is_key_part. Closes #2784
-
- Sep 26, 2017
-
-
Vladimir Davydov authored
The value returned by space.auto_increment() is not guaranteed to be monotonically growing, because this method uses max+1 for the next generated value, which can be less than a value generated before in case the max key is deleted. Besides, calling max() may be expensive, e.g. it requires a disk access in case of Vinyl. So this patch implements auto increment based on persistent sequences. To be used for auto increment, a sequence needs to be attached to a space. To attach an existing sequence to a space, pass 'sequence=ID' in index options when creating or modifying the primary key. Here ID is the name or the numeric identifier of the sequence to attach. Note, sequences can be attached only to spaces with integer primary key. After a sequence is attached, it will be used for auto increment when the user passes 'nil' for the primary key value. If the user passes a value different from 'nil', the value will be used to update the attached sequence. To detach a sequence from the space it was attached to, either drop the primary key of the space or alter the primary key with 'sequence=false'. It is not necessary to pre-create a sequence to use it for auto increment - a sequence can be automatically generated. To generate a sequence automatically, pass 'sequence=true' in index options. Automatically generated sequences are named '_auto_ID', where ID is the space id, and removed when the space is dropped or the sequence is detached. A sequence cannot be dropped as long as it is attached to any spaces. Closes #389
-
Konstantin Osipov authored
No need to allocate a tuple buffer for every sequence value.
-