- Feb 26, 2019
-
-
Vladislav Shpilevoy authored
For the same reason why 'uri' was moved to src/lib - SWIM needs core and uuid, and SWIM will live in src/lib. This commit follows 'uri' relocation as a separate one because 'uri' relocation required some changes in the files, moved by this commit. Needed for #3234
-
Vladislav Shpilevoy authored
Http_parser in fact does not depend on anything, even on the core. As a rule, such basic libraries are stored in src/lib. The patch is not necessary for anything, but it is a right thing to do, while some activity is happening there.
-
Vladislav Shpilevoy authored
Http_parser is a standalone library, which in fact does not require httpc. And because of that it is going to be moved into lib/http_parser.
-
Vladislav Shpilevoy authored
URI and core libraries are going to be used by SWIM, stored in src/lib. But src/lib can not depend on src/. This patch pushes URI library down to src/lib - the lowest level of source dependencies. Needed for #3234
-
- Feb 25, 2019
-
-
Kirill Shcherbatov authored
Memtx uses separate mempools for iterators of different types. Due to the fact that there will be more iterators of different sizes in a series of upcoming changes, let's always allocate the iterator of the largest size. No changes have been made to the rtree iterators pool because the size of these structures is significantly larger. Needed for #3961
-
Vladimir Davydov authored
This can't entail any consequences, because socket fd is set to -1 in this case, but this just looks a bit messy. Let's clean it up. Follow-up commit 305dbcf6 ("iproto: close socket explicitly before wal_dir at exit").
-
Nikita Pettik authored
When we replaced SQLite's ephemeral spaces with our ones, one optimization concerning ORDER BY clause was disabled. It allows to reduce number of fields in format of ephemeral space or sorter table. To illustrate how it works, consider example: CREATE TABLE t (id INT PRIMARY KEY, b INT); SELECT * FROM t ORDER BY b; To sort entries from t, ephemeral space with format [b, id, b] is created. One can see, that such format contains duplicate of b column. To avoid such situation, SQLite provides optimization which removes duplicates. Meanwhile, it doesn't change already set format of ephemeral (or sorter) space (and SQLite tolerates that format difference). That's why it was turned off. However, such optimization turns out to be not optional but required: some column values shouldn't be computed twice. For instance: SELECT random() AS x FROM t ORDER BY x; Without filtering fields from ephemeral space format, it would be like: [random(), random()]. In other words, results would be sorted by first call to random() function, but resulting set would consist of values given by second call of random(). So, to enable it, we should reduce field count in format of ephemeral space by number of matches between SELECT and ORDER BY column lists. Also, type of return value for random() function has been fixed. Closes #3783
-
Kirill Shcherbatov authored
Refactored memtx_tree code so that memtx_tree.h, memtx_rtree.h, memtx_bitset.h, memtx_hash.h contained only the signature of the tree object constructor while all implementation details were in corresponding *.c files. Needed for #3961
-
Kirill Shcherbatov authored
Introduce a macro BPS_TREE_IDENTICAL for BPS TREE class. This makes possible to define custom comparators for stucture-based leafs. Previously, a C++ comparison operator "!=" override was used for this purpose. Due to the fact that we are not going to rework on C++ C-only components of Tarantool like memtx_tree, we needed a way to make complex structures comparisons using preprocessor. Needed for #3961
-
Kirill Shcherbatov authored
The bps_tree.h header defines the macro _api_name, but does not undefine it at the end. Fixed.
-
Ilya Kosarev authored
tarantool instance didn't close socket explicitly which could cause hot standby instance to fail to bind in case it tries to bind before socket is closed by OS. Now it is fixed by closing socket explicitly before wal_dir. Closes #3967
-
Roman Khabibov authored
Add preprocessing of the request headers. Each header must be 'string' or 'table' with '__tostring' metamethod. Closes #3679
-
Cyrill Gorcunov authored
If I create a new fiber and the join to himself we get an abort: | tarantool> f = require('fiber') | --- | ... | | tarantool> f.join(f.self()) | tarantool: src/fiber.c:407: fiber_join: Assertion `fiber->flags & FIBER_IS_JOINABLE' failed. | Aborted (core dumped) we should better throw an error.
-
Vladislav Shpilevoy authored
The only goal of reading and writing heap_node.pos was checking if a node is now in a heap, or not. This commit encapsulates this logic into a couple of functions.
-
Roman Khabibov authored
Replace assert in socket:read() and add a check in socket:sysread() when the size is negative. Closes #3979
-
Nikita Pettik authored
It is possible to create vinyl tables, if pragma sql_default_engine is set to corresponding engine. However, such spaces don't inherit global vinyl-specific options which can be set by box.cfg{}. Lets fix it and during encoding of index options fetch appropriate configurations from cfg. Closes #3912
-
Nikita Pettik authored
Since previous commit allows us to raise an error during msgpack decode inside VDBE, lets do this if decoded integer is out of [INT64_MIN, INT64_MAX] range and set "integer is overflowed" diagnostic message. Closes #3735 Workaround for #3810
-
Nikita Pettik authored
Tarantool allows to hold in INTEGER field values in range [INT64_MAX, UINT64_MAX], which is obviously larger than common int64_t range. In this regard, if value of integer field in range [INT64_MAX, UINT64_MAX] is presented in tuple (e.g. after insertion from Lua interface), then after decoding msgpack (during processing SQL query) its value won't fit into int64_t (which in turn is basic type used to hold integers inside VDBE memory). Now if this happens, instead of raising an overflow error, value is stored as floating point number (with precise loss, obviously). Such approach is considered to be messy and we are going to raise "integer overflow" error instead. To make this happen, lets firstly refactor sqlVdbeMsgpackGet() to make it return error code to indicate that something went wrong and move length of decoded part to output parameters. Codestyle fixes are included as well. Needed for #3735
-
Nikita Pettik authored
Before this patch, if integer overflow occurred during casting to integer, it was simply ignored. As a result, wrong results might take place. Lets check possible overflows before CAST conversion, and if it happens, raise an appropriate error. Part of #3735
-
Nikita Pettik authored
Before this patch, if integer was overflowed during math operations (OP_Add, OP_Subtract, OP_Multiply, OP_Divide), it would be implicitly converted and stored as floating point number. This is obviously wrong way to handle integer overflow errors. Instead, let's raise corresponding error. Part of #3735
-
Nikita Pettik authored
Before this patch, resulting type of concatenation operator always was TEXT (i.e. type of memory cell containing result - MEM_Str). Lets fix it and return type depending on type of concatenation arguments: if both arguments are TEXT, then resulting type is TEXT; BLOB otherwise. Note that other options of combining types of arguments are illegal. Closes #3544
-
Nikita Pettik authored
Original SQLite operator of concatenation accepts all types of arguments. If type of parameter is not TEXT, it is implicitly converted to TEXT (except for NULLs). That contradicts ANSI (it is regulated by [1]), so lets allow only TEXT and BLOB as argument type for concatenation. Moreover, they both must be of the same type at the same time (i.e. both TEXT or BLOB). [1] SQL ANSI 2013, 9.5 Result of data type combination Part of #3544
-
Nikita Pettik authored
Accidentally, mask which is used to map type of VDBE memory cell into outer API types was replaced with MEM_TypeMask. But value of the latter is larger then possible values of VDBE memory cells types. Hence, if it is applied to memory cell, not only pure types is taken into consideration, but some additional flags (such as MEM_Zero) as well. Overall, it results in wrong type calculation for zeroed blobs, for instance. Lets return back previous mask. Follow-up #3698 Needed for #3544
-
Alexander Turenko authored
yaml.encode() now wraps a string literal whose content is equal to a null or a boolean value representation in YAML into single quotes. Those literals are: 'false', 'no', 'true', 'yes', '~', 'null'. Reverted the a2d7643c commit to use single quotes instead of multiline encoding for 'true' and 'false' string literals. Follows up #3476 Closes #3662 Closes #3583
-
AKhatskevich authored
Use lua_is*() functions instead of explicit lua_gettop() checks in yaml.encode() and yaml.decode() functions. Behaviour changes: * yaml.decode(object, nil) ignores nil (it is consistent with encode behaviour). * yaml.encode() gives an usage error instead of "unsupported Lua type 'thread'". * yaml.encode('', {}, {}) ignores 3rd argument (it is consistent with decode behaviour).
-
Serge Petrenko authored
Previously readahead was set after the instance synced with all existing masters. This could lead to a case when some client connections created rather early would start with default readahead value even when it was explicitly set to some value. So, start setting readahead before replicaset sync. Follow-up: #3958
-
Serge Petrenko authored
Iproto connections keep old readahead values for input buffers even after box.cfg.readahead reconfiguration. This means that for the changes to take place for the old clients, they have to reconnect. Otherwise tarantool log will be spammed with 'readahead limit is reached' errors. To fix this, start updating input buffer size for iproto connections if needed every time the buffer is empty. Closes: #3958
-
- Feb 24, 2019
-
-
Vladislav Shpilevoy authored
Checks for fiber_name legth worked with FIBER_NAME_MAX, while one byte in fact was occupied by terminating zero. Closes #4011
-
- Feb 22, 2019
-
-
Vladimir Davydov authored
vy_run_iterator_seek left the return statement uninitialized under certain conditions. The branch in the code wasn't covered by any test, because it could only be triggered by an EQ SELECT following range coalescing, so we only saw it when a customer reported a crash. Fix it and improve vinyl/select_consistency test to cover this branch.
-
Vladislav Shpilevoy authored
Reserve() function by definition should ensure that there is enough space to store something. But heap reserve() always just increases the capacity twice. Even if there was already enough memory. Check for not necessary realloc was done out of this function. This was wrong. The commit makes reserve() be real reserve(). The commit is motivated not by pursue of justice, but by forthcoming usage of reserve() in SWIM module code.
-
Vladislav Shpilevoy authored
Now heap API works with struct heap_node only, which forces a user to constantly call container_of. Such a code looks really awful. This commit makes heap taking and returning user defined structures, and removes container_of clue. It is worth noting, that the similar API rb-tree and b-tree have. Even rlist has its rlist_*_entry() wrappers, and mhash provides macroses to define your own value type.
-
Vladislav Shpilevoy authored
-
Nikita Pettik authored
During DDL routines we pass encoded space/index/trigger formats into msgpack to VDBE. EXPLAIN query displays arguments of each opcode of VDBE program in a readable format. So, lets decode arguments of OP_Blob opcode with subtype = _MSGPACK before displaying them. Also, lets enlarge static buffers for P4 operand value and opcode comment to fit decoded msgpack. What is more, it fixes buffer-overflow since before this patch operands of OP_Blob were treated as strings and passed to functions like strlen() (only during EXPLAIN query). On the other hand, generally speaking msgpack can come without null termination, or contain '\0' symbols in the middle of encoded array. Closes #3868
-
Nikita Pettik authored
According to ANSI, result of concatenation operation should derive collation sequence from its operands. Now it is not true: result is always comes with no ("none") collation. In a nutshell[1], rules are quite simple: a) If some data type has an explicit collation EC1, then every data type that has an explicit collation shall have declared type collation that is EC1. The collation derivation is explicit and the collation is EC1. b) If every data type has an implicit collation, then: - If every data type has the same declared type collation IC1, then the collation derivation is implicit and the collation is IC1. - Otherwise, the collation derivation is none. c) Otherwise, the collation derivation is none. [1] Read complete statement at chapter 9.5 Result of data type combinations, ANSI 2013, Part 2: Foundations. Closes #3937
-
Nikita Pettik authored
Lets make sql_expr_coll() return error code. It is needed since we are going to use this function to detect operands of concatenation with incompatible collations. Hence, struct coll* has been moved to output parameters. For the same reason lets make sql_binary_compare_coll_seq() return error code instead of struct coll*. The latter is really required only in one out of six usages, so lets remove it at all. Needed for #3947
-
Konstantin Osipov authored
-
Nikita Pettik authored
Part of #3271
-
Konstantin Osipov authored
Rename struct fkey and struct fkey_def to fk_constraint and fk_constraint_def respectively. Consistently use "fk" for foreign key variables, and fk_def for foreign key definition variables. Remove dependency of fkey.h on space.h. Enfore subject-verb-object naming in a few fk-related methods.
-
Konstantin Osipov authored
Follow up on the patch adding transaction boundaries to xrow stream. Use tsn as an abbreviation for transaction identifier (transaction sequence number). It is an important enough concept to use a short and a convenient tag name for. Deploy the name across the code - in names and comments. Clarify comments. Still use box_txn_id() as API method since box_tsn() and box_txn() would be too easy to mistype.
-
Nikita Pettik authored
SQLite grammar implementing foreign keys parsing is quite compact, but on the other hand it allows to define ON DELETE and ON UPDATE actions multiple times. For instance: ... REFERENCES t ON DELETE UPDATE ON DELETE RESTRICT; It makes no sense and contradicts original ANSI syntax. So, lets rework it a bit. Firstly, MATCH clause must come first, so we place it in independent rule. Then we remove ON INSERT clause, since there is no such opportunity at all. Finally, we have only 4 options to expose refargs (i.e. grammar rule to parse FK actions): ON UPDATE, ON DELETE, ON UPDATE ON DELETE, ON DELETE ON UPDATE. That's it. Closes #3475
-