- Nov 19, 2018
-
-
Nikita Pettik authored
After patch that introduced "none" collation (a953051e), box.internal.bootstrap() started to fail due to inability to drop mentioned collation. Lets turn off system triggers for _collation space in order to process its complete purification during bootstrap.
-
- Nov 15, 2018
-
-
Nikita Pettik authored
This patch introduces two new collation sequences: "none" and "binary". Despite the fact that they use the same comparing algorithm (simple byte-by-byte comparison), they don't mean the same. "binary" collation get to the format if user explicitly points it: either specifies this collation in space format manually or adds <COLLATE BINARY> clause to column definition within CREATE TABLE statement. "none" collation is used when user doesn't specify any collation at all. "none" collation always comes with id == 0 and it can't be changed (since its id vastly used under the hood as an indicator of absence of collation). Difference between these collations is vital for ANSI SQL: mixing "binary" with other collations is prohibited, meanwhile "none" collation can be used alongside with others. In this respect current patch extends list of available collations: now not only ICU collations are allowed, but also BINARY. Note, that in SQL some queries have changed their query plan. That occurred due to the fact that our parser allows using <COLLATE> clause with numeric fields: CREATE TABLE (id INT PRIMARY KEY); SELECT id COLLATE "binary" ... In the example collation of LHS (id column) is NULL, but collation of RHS is "binary". Before this patch both collations were NULL. Hence, usage of certain indexes may not be allowed by query planner. On the other hand, this feature is obviously broken, so that doesn't seem to be big deal. Needed for #3185
-
- Aug 22, 2018
-
-
Vladimir Davydov authored
The space is a blackhole. It will be used for writing deferred DELETE statements generated by vinyl compaction tasks to WAL so that we can recover deferred DELETEs that hadn't been dumped to disk before the server was restarted. Since the new space doesn't depend on other system spaces, let's assign the minimal possible id to it, i.e. 257. Needed for #2129
-
Serge Petrenko authored
When granting or revoking a privilege on an entire entity, id 0 was used to indicate the fact that we don't grant a privilege on a single object, but on a whole entity. This caused confusion, because for entity USER, for example, id 0 is a valid object id (user 'guest' uses it). Any non-zero id dedicated to this cause obviously may be confused as well. Fix this by creating separate schema_object_types for entities: SC_ENTITY_SPACE, SC_ENTITY_SEQUENCE, etc. Closes #3574 Needed for #3524
-
- Aug 07, 2018
-
-
Nikita Pettik authored
This patch introduces new system space to persist foreign keys constraints. Format of the space: _fk_constraint (space id = 358) [<constraint name> STR, <parent id> UINT, <child id> UINT, <is deferred> BOOL, <match> STR, <on delete action> STR, <on update action> STR, <child cols> ARRAY<UINT>, <parent cols> ARRAY<UINT>] FK constraint is local to space, so every pair <FK name, child id> is unique (and it is PK in _fk_constraint space). After insertion into this space, new instance describing FK constraint is created. FK constraints are held in data-dictionary as two lists (for child and parent constraints) in struct space. There is a list of FK restrictions: - At the time of FK creation parent and child spaces must exist; - VIEWs can't be involved into FK processing; - Child space must be empty; - Types of referencing and referenced fields must be comparable; - Collations of referencing and referenced fields must match; - Referenced fields must compose unique index; - Referenced fields can not contain duplicates. Until space (child) features FK constraints it isn't allowed to be dropped. Implicitly referenced index also can't be dropped (and that is why parent space can't be dropped). But :drop() method of child space firstly deletes all FK constraint (the same as SQL triggers, indexes etc) and then removes entry from _space. Part of #3271 Review fixes
-
- Jun 29, 2018
-
-
Kirill Shcherbatov authored
As we would like to lookup triggers by space_id in future on space deletion to delete associated _trigger tuples we need to introduce new field space_id as secondary key. Part of #3273.
-
- Jun 14, 2018
-
-
Vladislav Shpilevoy authored
Merge upgrade to 1.8.2/.4 into 2.1.0. Versions 1.8.2/.4 are broken because of invalid _trigger creation and deprecated versioning policy. Vinyl/Xlog upgrade tests from 1.7.7 are broken too since they actually contains 1.8 snapshots, so remove them. Add the test on upgrade from 1.10 to ensure the new upgrade_to_2_1_0 works.
-
- May 11, 2018
-
-
Ilya Markov authored
Introduce _vsequence system space. Prerequisite of #3250
-
- Mar 31, 2018
-
-
Kirill Yukhin authored
_schema represented as key-value storage for various values common for Tarantool, like next id for space creation. SQL requires format to be fully specified for columns being access. Unfortunatelly, _schema is inserted into _space before _space's format is set and since DD triggers are disabled during upgrade, format for _schema tuple in _space stays the same. So, set value nullable field in upgrade, regenerate initial snap, update tests. Also, as far as _schema's tuple in _space is not updated: relax fieldno check in sql.c
-
- Feb 15, 2018
-
-
Kirill Yukhin authored
If Tarantool is being starteed using data from older version, where stat tables were not system, it will definitely crash, since SQL statistics analyzer will try to access non- existing statistics tables (which will be added during upgrade). To avoid such crash: create dummy statistics spaces during schema init. Also, fix types for statistics space format: prohibit null values for statistic values and make sample format stronger.
-
- Feb 09, 2018
-
-
AKhatskevich authored
Making `stat[14]` a system spaces enables us to allow users to create spaces which starts with `_`, because it cannot affect internal state anymore. Since now the only constraints on table names is: - consists of printable symbols only - length < 65k Closes #2126
-
- Dec 29, 2017
-
-
Konstantin Osipov authored
Add a role which contains all ACLs. Fixes gh-3022. Useful for any quick start: box.schema.user.grant('guest', 'super')
-
Ilya authored
Add system privileges 'session' and 'usage' * 'session' privilege lets user connect to database server * 'usage' privilege lets user use his/her rights on database objects * Both privileges are assigned to all users by default. Implementation details: * system privileges are special grant rights to 'universe'. Therefore, they can be granted only by admin. Because of this fact, during creation or deletion of user, we have to switch to 'admin' to grant or revoke these rights. Important changes: * changed bootstrap.snap due to need to start admin with new privileges * added auto upgrade script for 1.7.7 Fixes gh-2898. With contributions by @kostja.
-
- Nov 06, 2017
-
-
Roman Tsisyk authored
+ Don't use id=0 for collations Follow up #2649
-
- Oct 06, 2017
-
-
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
-
- 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
-
- Sep 19, 2017
-
-
Vladimir Davydov authored
This patch implements a new object type, persistent sequences. Sequences are created with function box.schema.sequence.create(name, options). Options include min/max, start value, increment, cache size, just like in Postgresql, although 'cache' is ignored for now. All sequences can be accessed via box.sequence.<name>, similarly to spaces. To generate a sequence value, use seq:next() method. To retrieve the last generated value, use seq:get(). A sequence value can also be reset to the start value or to any other value using seq:reset() and seq:set() methods. Needed for #389
-
- Sep 18, 2017
-
-
Vladislav Shpilevoy authored
Needed for #2754
-
- Aug 23, 2017
-
-
Vladislav Shpilevoy authored
Now all upgrade_to_1_... can be removed, except 1_8_2(). Inital function initializes schema for 1.7.5, not for 1.6.0. We can not support upgrade directly from <1.7.5, because these versions contains space format conflicts, which are checked in 1.8. Needed for #2652
-
Vladislav Shpilevoy authored
* upgrade handler for 1.8.2 must be set to auto instead of 1.7.5; * _trigger's first field has type string, but index on this field has type unsigned - it is conflict. Needed for #2652
-
- Aug 21, 2017
-
-
Vladislav Shpilevoy authored
Now system space formats contain conflicts between space:format, their index parts and actual tuple fields. Such formats can not be used to check tuple fields in SQL. Fix them in order of #2652
-
- Aug 17, 2017
-
-
Georgy Kirichenko authored
_truncate space write access is required for space truncation. Add this privilege to bootstrap.snap. See #2674
-
- Jun 21, 2017
-
-
Vladimir Davydov authored
Currently, space.create must insert an entry into 'truncate' system space - if it does not, space.truncate won't work. This is incontinent, as it makes it impossible to create spaces by simply inserting a tuple into the 'space' system space via iproto API. So let's insert entries into truncate space lazily, on the first space truncation. Closes #2524
-
- Jun 15, 2017
-
-
Vladimir Davydov authored
We added _truncate space to 1.7.5 and we are going to add new system spaces for storing sequences and triggers. Without upgrade, the corresponding operations won't work. Since 1.7.5 is a minor upgrade, users may not call box.schema.upgrade(), so we need to call it for them automatically. This patch introduces infrastructure for automatic upgrades and sets upgrade to 1.7.5 to be called automatically. While we are at it, rename schema version 1.7.4 to 1.7.5 (1.7.4 has already been released). Closes #2517
-
- Jun 08, 2017
-
-
Kirill Yukhin authored
Persistency for SQL triggers supported by introducing new system space called `_trigger` which should store all SQL triggers registered. Add space itself, make visible to Lua, update bootstrap code and regenerate bootstrap.snap. Insertion into the space is done by introducing new VDBE opcode `OP_ParseSchema3` which provides a pair of trigger name and SQL which creates the trigger. During system restore `_trigger` is scanned and its contents parsed back into VDBE. Update tests and extend test for persistency w/ trigger case. Closes #2320
-
Vladimir Davydov authored
Space truncation that we have now is not atomic: we recreate all indexes of the truncated space one by one. This can result in nasty failures if a tuple insertion races with the space truncation and sees some indexes truncated and others not. This patch redesigns space truncation as follows: - Truncate is now triggered by bumping a counter in a new system space called _truncate. As before, space truncation is implemented by recreating all of its indexes, but now this is done internally in one go, inside the space alter trigger. This makes the operation atomic. - New indexes are created with Handler::createIndex method, old indexes are deleted with Index::~Index. Neither Index::commitCreate nor Index::commitDrop are called in case of truncation, in contrast to space alter. Since memtx needs to release tuples referenced by old indexes, and vinyl needs to log space truncation in the metadata log, new Handler methods are introduced, prepareTruncateSpace and commitTruncateSpace, which are passed the old and new spaces. They are called before and after truncate record is written to WAL, respectively. - Since Handler::commitTruncateSpace must not fail while vylog write obviously may, we reuse the technique used by commitCreate and commitDrop methods of VinylIndex, namely leave the record we failed to write in vylog buffer to be either flushed along with the next write or replayed on WAL recovery. To be able to detect if truncation was logged while recovering WAL, we introduce a new vylog record type, VY_LOG_TRUNCATE_INDEX which takes truncate_count as a key: if on WAL recovery index truncate_count happens to be <= space truncate_count, then it it means that truncation was not logged and we need to log it again. Closes #618 Closes #2060
-
- Nov 18, 2016
-
-
Georgy Kirichenko authored
Check magic in xlog_cursor_read_tx. Issue #1720
-
- Sep 22, 2016
-
-
Georgy Kirichenko authored
-
- Aug 04, 2016
-
-
Roman Tsisyk authored
* Rename fields types in data dictionary and test suite: - 'num' => 'unsigned' - 'str' => 'string' - 'int' => 'integer' * Force coversion to lowercase * Add aliases to space:create_index(): - 'str' => 'string' - 'num' => 'unsigned' -- logs "field type 'num' is deprecated" warning - 'uint' => 'unsigned' - 'int' => 'integer' * Add prefix to `enum field_type` members * Add upgrade_to_1_7_2() script Fixes #942 Fixes #1534
-
- Jul 04, 2016
-
-
Konstantin Nazarov authored
This is required to do the following: tarantoolctl user@host tarantoolctl guest@host tarantoolctl guest:@host Currently all of those will lead to error from net.box. Either because password is not specified, or because guest user can't login with empty password. This change effectively sets guest password to an empty string, to make it less of a special case to authentication. And since now guest can be authenticated with an empty password, net.box will replace nil passwords with empty strings, when user name is provided. We still support the case when username=nil and password=nil. In this case net.box doesn't send authentication packet at all. Guest login is just assumed. The bootstrap snapshot will now have guest user with an empty password, instead of no password. Fixes #1545
-
- Mar 28, 2016
-
-
Roman Tsisyk authored
* Set version to {1, 6, 8} in box.space._schema * Add 'LUA' language to built-in stored procedures
-
- Jan 18, 2016
-
-
Roman Tsisyk authored
Make more abstract version of key_opts parser to re-use code for space options.
-
- Aug 10, 2015
-
-
Konstantin Osipov authored
* style fixes * fix a bug in key opts decoder (alter.cc) * ensure dimension is visible in box.space * rebuild bootstrap.snap to use the new format
-
- Apr 09, 2015
-
-
Roman Tsisyk authored
Add _vspace, _vindex, _vuser, _vfunc and _vpriv virtual spaces (views) which contains only objects allowed to the current user. This patch is needed for client connectors to work under non-admin user.
-
- Feb 20, 2015
-
-
Konstantin Osipov authored
Extract xlog.test.py into an own test suite, in preparation for a split into many tests. xlog.test.py restarts the server all the time anyway, there is no point to keep all tests in the same file. Deal with collateral damange of this seemingly innocuous move: * fix an assertion failure in user.drop(), user_has_data(). The check was using a wrong index. * fix test-run.py to leave cores around in case of a server crash (in a friendly gesture to develoeprs, and joining the ranks of such extremely succefful applications as apport and systemd, it used to delete them) * update bootstrap.snap to provide format for _index space * make a bunch of tests safe to the order in which they are executed * use space name rather than space id for error messages more often, since space id is very volatile after introduction of max_id sequence for space ids.
-
- Feb 17, 2015
-
-
Konstantin Osipov authored
Use a monotonically growing sequence for space identifiers, to ensure they are never reused. Update tests.
-
- Dec 19, 2014
-
-
Konstantin Osipov authored
-
Konstantin Osipov authored
-
- Dec 17, 2014
-
-
Konstantin Osipov authored
Update tests to use this role.
-
- Dec 01, 2014
-
-
Konstantin Osipov authored
Introduce 'public' role. Auto-grant 'public' to every user. Update the snapshot.
-