- Aug 13, 2018
-
-
Olga Arkhangelskaia authored
In case of bad or erroneous options for log configurations errors had ambiguous or absent messages. In some cases it lead to app crashes. Closes #3553
-
Vladimir Davydov authored
-
Vladimir Davydov authored
-
Vladimir Davydov authored
There's a new system space _fk_constraint with two indexes. Take this into account in tests that check presence of system spaces.
-
Nikita Pettik authored
After introducing foreign key constraints, space:drop() processes lookup in _fk_constraint system space to drop child constraints (if any exist). Thus, we must provide at least 'read' privilege for this space.
-
- Aug 11, 2018
-
-
Vladimir Davydov authored
Reproduce file: - [box/access.test.lua, null] - [box/iterator.test.lua, null] - [box/bitset.test.lua, null] The issue happens, because box/bitset.lua:dump() uses iterate(), which gets cleared by box/iterator test. Fix this by using utils.iterate() instead.
-
- Aug 10, 2018
-
-
Vladimir Davydov authored
index.update() looks up the old tuple in the primary index, applies update operations to it, then writes a DELETE statement to secondary indexes to delete the old tuple and a REPLACE statement to all indexes to insert the new tuple. It also sets a column mask for both DELETE and REPLACE statements. The column mask is a bit mask which has a bit set if the corresponding field is updated by update operations. It is used by the write iterator for two purposes. First, the write iterator skips REPLACE statements that don't update key fields. Second, the write iterator turns a REPLACE that has a column mask that intersects with key fields into an INSERT (so that it can get annihilated with a DELETE when the time comes). The latter is correct, because if an update() does update secondary key fields, then it must have deleted the old tuple and hence the new tuple is unique in terms of extended key (merged primary and secondary key parts, i.e. cmp_def). The problem is that a bit may be set in a column mask even if the corresponding field does not actually get updated. For example, consider the following example. s = box.schema.space.create('test', {engine = 'vinyl'}) s:create_index('pk') s:create_index('sk', {parts = {2, 'unsigned'}}) s:insert{1, 10} box.snapshot() s:update(1, {{'=', 2, 10}}) The update() doesn't modify the secondary key field so it only writes REPLACE{1, 10} to the secondary index (actually it writes DELETE{1, 10} too, but it gets overwritten by the REPLACE). However, the REPLACE has column mask that says that update() does modify the key field, because a column mask is generated solely from update operations, before applying them. As a result, the write iterator will not skip this REPLACE on dump. This won't have any serious consequences, because this is a mere optimization. What is worse, the write iterator will also turn the REPLACE into an INSERT, which is absolutely wrong as the REPLACE is preceded by INSERT{1, 10}. If the tuple gets deleted, the DELETE statement and the INSERT created by the write iterator from the REPLACE will get annihilated, leaving the old INSERT{1, 10} visible. The issue may result in invalid select() output as demonstrated in the issue description. It may also result in crashes, because the tuple cache is very sensible to invalid select() output. To fix this issue let's clear key bits in the column mask if we detect that an update() doesn't actually update secondary key fields although the column mask says it does. Closes #3607
-
- Aug 08, 2018
-
-
Mergen Imeev authored
In some cases operation box.snapshot() takes longer than expected. This leads to situations when the previous error is reported instead of the new one. Now these errors completely separated. Closes #3599
-
Olga Arkhangelskaia authored
Added server option to syslog configuration. Server option is responsible for log destination. At the momemt there is two ways of usage:server=unix:/path/to/socket or server=ipv4:port. If port is not set default udp port 514 is used. If logging to syslog is set, however there is no server options - default location is used: Linux /dev/log and Mac /var/run/syslog. Closes #3487
-
- Aug 07, 2018
-
-
Kirill Yukhin authored
-
Kirill Yukhin authored
-
Kirill Yukhin authored
Print reproduce file.
-
Kirill Yukhin authored
-
Kirill Yukhin authored
-
Sergei Voronezhskii authored
The -j -1 used to legacy consistent mode. Reducing the number of jobs to one by switching to -j 1, uses same part of the code as in parallel mode. The code in parallel mode kills hung tests. Part of https://github.com/tarantool/test-run/issues/106
-
Kirill Shcherbatov authored
Starting from 9a543202 on tuple insertion in _space we execute sql_checks_resolve_space_def_reference for checks if any on executing on_replace_dd_space trigger. Routine box_space_id_by_name that takes a look to _space space returns not-null value, at the same time space object doesn't present in space cache and can't be found by space_by_id. Before 1.10 patch 0ecabde8 was merged to 2.0 as a part of 13df2b1f box_space_id_by_name used to return BOX_ID_NIL due to "multi-engine transaction error" that is not raised in same situation now. Closes #3611.
-
Nikita Pettik authored
We always compile with enabled foreign keys constraints. They still can be turned off by <pragma foreign_keys = false> in runtime. Follow-up #3271
-
Nikita Pettik authored
Before insertion to _fk_constraint we must be sure that there is no entry with given <name, child id>. Otherwise, insertion will fail and 'duplicate key' will be shown. Such error message doesn't seem to be informative enough, so lets verify before insertion to _fk_constraint that it doesn't already contain entry with given name. The same is for dropping constraint, but here vice versa: we test that _fk_constraint contains entry with given name and child id. It is worth mentioning that during CREATE TABLE processing schema id changes and check in OP_OpenRead opcode fails (which in turn shows that pointer to space may expire). On the other hand, _fk_constraint space itself remains immutable, so as a temporary workaround lets use flag indicating pointer to system space passed to OP_OpenRead. It makes possible to use pointer to space, even if schema has changed. Closes #3271
-
Nikita Pettik authored
After introducing separate space for persisting foreign key constraints, nothing prevents us from adding ALTER TABLE statement to add or drop named constraints. According to ANSI syntax is following: ALTER TABLE <referencing table> ADD CONSTRAINT <referential constraint name> FOREIGN KEY <left paren> <referencing columns> <right paren> REFERENCES <referenced table> [ <referenced columns> ] [ MATCH <match type> ] [ <referential triggered action> ] [ <constraint check time> ] ALTER TABLE <referencing table> DROP CONSTRAINT <constrain name> In our terms it looks like: ALTER TABLE t1 ADD CONSTRAINT f1 FOREIGN KEY(id, a) REFERENCES t2 (id, b) MATCH FULL; ALTER TABLE t1 DROP CONSTRAINT f1; FK constraints which come with CREATE TABLE statement are also persisted with auto-generated name. They are coded after space and its indexes. Moreover, we don't use original SQLite foreign keys anymore: those obsolete structs have been removed alongside FK hash. Now FK constraints are stored only in space. Since types of referencing and referenced fields must match, and now in SQL only PK is allowed to feature INT (other fields are always SCALAR), some tests have been corrected to obey this rule. Part of #3271
-
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
-
Nikita Pettik authored
Originally, SQLite allows to create table with foreign keys constraint which refers to yet not created parent table. For instance: CREATE TABLE child(id INT PRIMARY KEY REFERENCES parent); CREATE TABLE parent(id INT PRIMARY KEY); This patch bans such ability since it contradicts SQL ANSI. Moreover, SQLite allows to drop parent table if deletion of all rows wouldn't result in FK constraint violations. This feature has been removed since in such situation child table would become inconsistent. Finally, within current patch ability to create FK constraints on VIEWs is banned as well. Part of #3271
-
Kirill Yukhin authored
-
Kirill Yukhin authored
-
Vladimir Davydov authored
It is dangerous to call box.cfg() concurrently from different fibers. For example, replication configuration uses static variables and yields so calling it concurrently can result in a crash. To make sure it never happens, let's protect box.cfg() with a lock. Closes #3606
-
- Aug 03, 2018
-
-
Alexander Turenko authored
The test case has execution time around 25 seconds on vinyl (while around 5 seconds on memtx) on a slow laptop with HDD. On a modern laptop with SSD it is ~8 seconds for vinyl and ~2-3 seconds for memtx. Both measurement were performed with parallel run of many instances of the test. Also enabled ability to run a sql-tap test w/o test-run. It was broken since b09f5964. Fixes #3590.
-
Kirill Yukhin authored
-
Kirill Yukhin authored
-
Alexander Turenko authored
Fixes #3489.
-
- Aug 02, 2018
-
-
Alexander Turenko authored
-
Alexander Turenko authored
-
Alexander Turenko authored
* support expected fail of non-default server * fix format_process function: prevent crash on some machines (#92) * print whole reject file when a test failed (#102)
-
Kirill Yukhin authored
-
Nikita Pettik authored
Originally, SQLite doesn't allow to use binding parameters in trigger's body. triggerE test checks only this taboo. However, binding mechanism is not properly implemented now, so this test seems to be useless and can be removed.
-
Georgy Kirichenko authored
There is a different error message while gitlab ci running Fixes #3602
-
Eugine Blikh authored
No more `include/yaml.h` and `lib/libyaml_static.a` installs. closes gh-3547
-
Kirill Shcherbatov authored
As space deletion in 2.0 require lookup _trigger space we have grant read from it for actual user. Closes #3595.
-
Nikita Pettik authored
Now we operate only on one database, so prefixes like 'first_db.table1' are not applieble to our SQL implementation (at least now).
-
Kirill Yukhin authored
-
Mergen Imeev authored
This patch allow to use option "--language" with "tarantoolctl enter" command. Also default value for language were added in default configuration file. Language is either SQL or Lua. Closes #2385. @TarantoolBot document Title: Language selection for tarantoolctl "enter". User can select either Lua or SQL when he uses tarantoolctl "enter" command. It can be done using "--language=<language>" syntax. Default language is set in tarantoolctl config file. Usage: tarantoolctl enter <app_name> --language=SQL tarantoolctl enter <app_name> --language=Lua
-
- Aug 01, 2018
-
-
Vladimir Davydov authored
Add txn_is_first_statement() function, which returns true if this is the first statement of the transaction. The function is supposed to be used from on_replace trigger to detect transaction boundaries. Needed for #2129
-