- Feb 25, 2019
-
-
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
-
- Feb 21, 2019
-
-
Georgy Kirichenko authored
Append txn_id and is_commit to xrow_header structure, txn_id identifies transaction id on replica where transaction was started. As transaction id a lsn of the first row in the transaction is used. is_commit is set to true for the last row in a transaction. As encoding/deconding rule assumed: * txn_id encoded using transaction sequence number iproto field as IPROTO_TSN = lsn - txn_id, * is_commit packed into IPROTO_FLAGS field with a bit mask, * txn_id and is_commit are encoded only for multi-row transactions. So if we do not have txn_id after row decoding then this means that it is a single row transaction. These rules provide compatibility with previous xlog format as well as good compaction level. Needed for #2798
-
Vladimir Davydov authored
The function doesn't require any knowledge of vinyl statement layout and can work on regular tuples. Let's rename it to tuple_key_contains_null, move its implementation to tuple_extract_key.cc, and declare it in key_def.h, as we do with other similar functions.
-
Vladimir Davydov authored
Most of them are already there - for instance see see tuple_extract_key and tuple_compare. Let's move the rest there too for consistency.
-
Vladimir Davydov authored
- Rename key_def_set_cmp to key_def_set_func, because it sets not only comparators these days. - Rename tuple_hash_func_set and tuple_extract_key_set to key_def_set_hash_func and key_def_set_extract_func, because it's more like subject-verb-object naming convention used throughout the code. - Introduce key_def_set_compare_func and use it instead of setting comparators explicitly in key_def.c.
-
Vladimir Davydov authored
It isn't used anywhere outside vy_stmt.c.
-
Vladimir Davydov authored
No need to allocate an empty key during DDL - we already have one preallocated in vy_lsm_env.
-
Michał Durak authored
Add optional 'chars' parameter to string.strip, string.lstrip and string.rstrip for specifying the unwanted characters. Behavior modeled after the equivalent Python built-ins. Closes: #2977 @TarantoolBot document Title: string.strip(inp, chars) Update the documentation for string.strip, string.lstrip and string.rstrip to reflect the addition of the optional param.
-
Mergen Imeev authored
This patch adds space name to descriptions of some of new errors. Also it fixes name and description of a few errors. Part of #3965
-
Vladislav Shpilevoy authored
When a connection is closed, it should not allow any requests - async and not. But before this patch this error from netbox.perform_async_request was ignored.
-
- Feb 18, 2019
-
-
Vladislav Shpilevoy authored
-
Mergen Imeev authored
This patch reworks SQL errors of types "no such object" and "object exists". After this patch, these error will be set as Tarantool errors. Part of #3965
-
Mergen Imeev authored
The suppressErr field was used to indicate that most of the errors during the parsing should be suppressed. There was only one feature that used it. After deleting this feature, it became obvious that this field had become unused and should be removed. The feature in question is: allow to use names and aliases from input in ORDER BY clause of UNION or INTERSECT. After deleting of this feature, requests like the one below become invalid: SELECT 1 AS a UNION ALL SELECT 2 AS b ORDER BY b; Part of #3965
-
Stanislav Zudin authored
The pragmas "query_only" and "read_uncommitted" didn't affect anything and were removed. Fixed an error in pragma index_list which caused a segmantation fault. pragma sql_default_engine accepts only strings. Thus pragma sql_default_engine('memtx') is a well-formed command, while pragma sql_default_engine(memtx) or pragma sql_default_engine("memtx") are considered as an ill-formed and raise an error. Closes #3733
-
Kirill Shcherbatov authored
The box.tuple.new() used to call luamp_encode_tuple with default LUA serializer config 'luaL_msgpack_default'. This routine may consider an array to be excessively sparse when + encode_sparse_ratio > 0 + max(table) > encode_sparse_safe + max(table) > count(table) * encode_sparse_ratio. Sparse optimization save memory via representing excessively sparse tuple as MP_MAP. But Tarantool tuple always must be MP_ARRAY so it is not relevant for box.tuple.new semantics. So it is disabled with encode_sparse_ratio = 0 in a new local serializer config. Closes #3882
-
- Feb 15, 2019
-
-
Vladislav Shpilevoy authored
It is going to be used in SWIM module to set UDP server socket options. Apparently this function sets some usefull flags like NONBLOCK, REUSEADDR.
-
Vladislav Shpilevoy authored
The function parses string URI consisting of either IP and port, or UNIX socket address, and stores the result into struct sockaddr.
-
Roman Khabibov authored
Set the reason "Unknown" when it is CURLE_OK and status is more than or equal to 400. Closes #3681
-
Roman Khabibov authored
A bug existed because module_init was called during a call to box_cfg{}. Modules were not initialized before calling box.cfg{}. Closes #3770
-
Ivan Koptelov authored
Lets completely remove struct Table. Also the patch simplifies memory management as in many cases struct space (which replaces struct Table) is allocated on region and shouldn't be explicitly freed. Some wrappers fetching data from space (such as space_checks_expr_list) have been removed since now we can get all properties right from space object right from cache. Closes #3235
-
Vladimir Davydov authored
This patch makes logging a little bit more verbose so as to facilitate post-mortem replication failure analysis: - When an instance starts up, print its uuid and vclock. - When a replica connects to a master, print the master's uuid to the replica's log. - Print replica uuid and address to the master's log on join/subscribe. - Log local and remote vclock on subscribe, both on master and on replica. - Log ids assigned to replicas both on recovery and when online. Also, log when a replica is deleted from the cluster.
-