- Jan 21, 2020
-
-
Cyrill Gorcunov authored
Test multireturn in lua output mode and lack of a parameter in '\set output <...>' command. Co-developed-by:
Alexander Turenko <alexander.turenko@tarantool.org> Signed-off-by:
Cyrill Gorcunov <gorcunov@gmail.com> Reviewed-by:
Alexander Turenko <alexander.turenko@tarantool.org> (cherry picked from commit cdf502c6)
-
Cyrill Gorcunov authored
In case if output format is not specified we should exit with more readable error message. Fixes #4638 Signed-off-by:
Cyrill Gorcunov <gorcunov@gmail.com> Reviewed-by:
Alexander Turenko <alexander.turenko@tarantool.org> (cherry picked from commit 9cc2c9c5)
-
Cyrill Gorcunov authored
Currently we handle only first member of multireturn statement. Fix it processing each element separately. n.b.: While at this file add vim settings. | tarantool> \set output lua | true; | tarantool> 1,2,3,4 | 1, 2, 3, 4; Fixes #4604 Reported-by:
Alexander Turenko <alexander.turenko@tarantool.org> Signed-off-by:
Cyrill Gorcunov <gorcunov@gmail.com> Reviewed-by:
Alexander Turenko <alexander.turenko@tarantool.org> (cherry picked from commit d7cbd007)
-
Vladislav Shpilevoy authored
Transaction adds a redo log for each statement. The log is an xrow header. Some requests don't have a header (local requests), some do (from remote client, from replication). When a request had a header, it was written as is to WAL. But requests from remote client have an xrow header, however barely filled. Most of its fields are default values, usually 0. Including group id. Indeed, remote clients should not care about setting such deep system fields. That led to a problem when a space had group id local (!= 0), but it was ignored because in a request header from a remote client the group id was default (== 0). On the summary, it was possible to force Tarantool to replicate a replica-local space. Now group id setting is server-authoritative. Box always sets it regardless of what is present in an xrow header received from a client. Thanks Kostja Osipov (@kostja) for the diagnostics and the solution. Closes #4729 (cherry picked from commit 3d0f12968a8f5349eedb1778d6e29950f04785d5)
-
- Jan 17, 2020
-
-
Chris Sosnin authored
'pragma collation_list' uses _collation space, although user may have no access to it. Thus, we replace it with the corresponding view. Closes #4713 (cherry picked from commit 28370f19)
-
- Jan 16, 2020
-
-
Oleg Babin authored
Usually functions return pair `nil, err` and expected that err is string. Let's make the behaviour of error object closer to string and define __concat metamethod. The case of error "error_mt.__concat(): neither of args is an error" is not covered by tests because of #4723 Closes #4489 (cherry picked from commit 935db173)
-
- Jan 14, 2020
-
-
Maria authored
Struct of type tuple_format is being passed as an argument to tuple_format_unref() where it might be freed. On such occasion any further references to format fields should not take place. Acked-by:
Cyrill Gorcunov <gorcunov@gmail.com> Closes #4658 (cherry picked from commit c08b94ed)
-
Chris Sosnin authored
- If an optional argument is provided for space_object:frommap() (which is {table = true|false}), type match for first arguments is omitted, which is incorrect. We should return the result only after making sure it is possible to build a tuple. - If there is a type mismatch, however, frommap() does not return nil, err as it is mentioned in the description, so we change it to be this way. Closes #4262 (cherry picked from commit ba2deae5acca0bf65e65433c67098a10946e7fd3)
-
- Jan 13, 2020
-
-
HustonMmmavr authored
Despite the lack of documentation, fio.mktree() was designed to work similar to mkdir -p: it creates the directory along with it's parents and doesn't complain about existing ones. But this function was subject to a race if two different processes were trying to create the same directory at the same time. It was caused by the fact that directory existence check and its creation aren't atomic. This patch fixes the race by impoving error handling: it's not an error if directory exists, even if it was created by someone else and mktree failed. Related to https://github.com/tarantool/doc/issues/1063 Closes #4660 (cherry picked from commit 21ae2899)
-
Alexander Turenko authored
It appears due to improper conflict resolution after pushing the following commits in the reverse order: * 2b9ef8d1 lua: don't modify pointer type in msgpack.decode* * 84bcba52 lua: keeping the pointer type in msgpackffi.decode() Originally 84bcba52 (which should land first) fixes the msgpackffi module and introduces the test_decode_buffer() function locally for the msgpackffi test. Then 2b9ef8d1 fixes the msgpack module in the same way, expands and moves the test_decode_buffer() function to serializer_test.lua (to use in msgpack and msgpackffi tests both). After changes made to push the commits in the reverse order, those commits doing something weird around tests. However the resulting state is different from the right one just in the dead function in msgpackffi.test.lua. Follows up #3926. (cherry picked from commit ec324247)
-
Maria authored
Method decode_unchecked returns two values - the one that has been decoded and a pointer to the new position within the buffer given as a parameter. The type of returned pointer used to be cdata<unsigned char *> and it was not possible to assign returned value to buf.rpos due to the following error: > cannot convert 'const unsigned char *' to 'char *' The patch fixes this by making decode_unchecked method return either cdata<char *> or cdata<const char *> depending on the given parameter. Closes #3926 (cherry picked from commit 84bcba52)
-
Alexander Turenko authored
msgpackffi.decode_unchecked([const] char *) returns two values: a decoded result and a new pointer within passed buffer. After #3926 a cdata type of the returned pointer follows a type of passed buffer. This commit modifies behaviour of msgpack module in the same way. The following functions now returns cdata<char *> or cdata<const char *> depending of its argument: * msgpack.decode(cdata<[const] char *>, number) * msgpack.decode_unchecked(cdata<[const] char *>) * msgpack.decode_array_header(cdata<[const] char *>, number) * msgpack.decode_map_header(cdata<[const] char *>, number) Follows up #3926. (cherry picked from commit 2b9ef8d1)
-
Serge Petrenko authored
The tarantool_free() call in the end of main() works all the time except when we exit due to a panic. We need to clear terminal state in this case also, so return to using atexit() to clear readline state. Closes #4466 (cherry picked from commit c6d4f010)
-
- Dec 31, 2019
-
-
Ilya Kosarev authored
master1.lua did not reach all needed remote branches with adb0a01b. It is needed for join_vclock test.
-
Ilya Kosarev authored
socket.test had a number of flaky problems: - socket readiness expectation & read timeouts - race conditions on socket shutdown in emulation test cases - UDP datagrams losses on mac os - excessive random port searches Now they are solved. 127.0.0.1 is now used instead of 0.0.0.0 or localhost to prevent wrong connections where appropriate. Socket test is not fragile anymore. Closes #4426 Closes #4451 Closes #4469 (cherry picked from commit 4137134c)
-
Ilya Kosarev authored
join_vclock test is assumed to verify that changes are not being lost on the replica. Due to this the test is changed to explicitly check that all changes on master are applied on replica. Previously this test was also indirectly verifying that changes are being applied in the correct order. Now there is separate test for this, called replica_apply_order. As far as changed join_vclock test might fail due to #4669, we are now creating cluster out of fresh instances instead of using default instance. Considering mentioned fixes it is not fragile anymore. Closes #4160 (cherry picked from commit adb0a01b)
-
Kirill Yukhin authored
-
Alexander Turenko authored
* Support to set default SQL engine using _session_settings space in addition to pragma sql_default_engine. This feature is only for *.test.sql tests. Needed for #4511. * Use exact IPv4/IPv6 address in test_run:cmd() in order to avoid rare failures due to using wrong address (PR #197). (cherry picked from commit a6535ab3b8d3e395d2f81699cf35329118412307)
-
- Dec 30, 2019
-
-
Nikita Pettik authored
In scope of 8fac6972 it was fixed misbehavior while passing floating point values to integer iterator. Unfortunately, that patch introduced off-by-one error. Number of constraints (equalities and inequalities) can not be greater than number of key parts (obviously, each constraint can be tested against at most one index part). Inequality constraint can involve only field representing last key part. To get it number of constraints was used as index. However, since array is 0-based, the last key part should be calculated as parts[eq_numb - 1]. Before this patch it was parts[eq_numb]. Closes #4558 (cherry picked from commit bb905d1d)
-
- Dec 29, 2019
-
-
Mergen Imeev authored
The test re encoding of -2^63 Lua number value did use update by a field name, which does not supported in 1.10 and 2.2 branches. Field name updates are orthogonal to Lua number serialization and we don't intend to test them here. So it is safe and logical to get rid of them in the test. This change allow the test to pass on 1.10 and 2.2 branches. Follows up #4672. Reviewed-by:
Alexander Tikhonov <avtikhon@tarantool.org> Reviewed-by:
Alexander Turenko <alexander.turenko@tarantool.org> (cherry picked from commit 408b9ad4)
-
- Dec 27, 2019
-
-
Nikita Pettik authored
Accidentally, number of indexes to be considered during query planning in presence of INDEXED BY is calculated wrong. Instead of one (INDEXED BY is not a hint but requirement) index to be used (which is indicated in INDEXED BY clause), all space indexes take part in query planning. There are not so many tests checking this feature, so unfortunately this bug was hidden. Let's fix it and force only one index to be used in QP in case of INDEXED BY clause. (cherry picked from commit 49fedfe3)
-
- Dec 23, 2019
-
-
Ilya Kosarev authored
libcurl-7.66.0 and older returns CURLE_WRITE_ERROR when a server responds with unknown or unsupported Content-Encoding (see [1] and [2]). This was fixed in future libcurl-7.67.0 and proper CURLE_BAD_CONTENT_ENCODING code will be returned in this case. We should process the code in the same way as we do for CURLE_WRITE_ERROR. [1]: curl/curl#4310 [2]: curl/curl#4449 Closes #4579 Reviewed-by:
Alexander Turenko <alexander.turenko@tarantool.org> (cherry picked from commit e3432636)
-
Ilya Kosarev authored
After executing curl request we need to process curl_request code. It might be CURLE_WRITE_ERROR. We had special case for it, which assumed diagnostic message being set and contained corresponding assert, though it is incorrect. Better way is to handle it as any other non-standard event. It was discovered while adding accept_encoding option. In case of unknown encoding curl_request code is currently set to CURLE_WRITE_ERROR and therefore we come to an assert assuming we have some diagnostics set. However, it is not being set and it is totally fine. This means we are failing on assert and it is not correct behavior. Prerequisites: #4232 Reviewed-by:
Alexander Turenko <alexander.turenko@tarantool.org> (cherry picked from commit 728d08a6)
-
- Dec 19, 2019
-
-
Mergen Imeev authored
This patch fixes a bug that appeared after commit 3a13be1d ('lua: fix lua_tofield() for 2**64 value') . Due to this bug, -2^63 was serialized as double, although it should be serialized as integer. Closes #4672 (cherry picked from commit 06aeb768)
-
Oleg Babin authored
Before this patch if user passed {verbose = false} to http client it was considered as "true" This patch fixes such behaviour and takes into account user's value (cherry picked from commit 77936721c02a89e17701c64f0f442abdf78ed7fc)
-
- Dec 17, 2019
-
-
Ilya Kosarev authored
JetBrains IDEs use .idea folder to store configuration files. To provide more comfort for it's users .idea folder should be ignored. Reviewed-by:
Alexander Turenko <alexander.turenko@tarantool.org> (cherry picked from commit afa692e5)
-
- Dec 16, 2019
-
-
Chris Sosnin authored
As long as we are sure, that strlen(sd_unix_path) < sizeof(sa.sun_path) we can assume that there is always enough space and the path will be null-terminated. Thus, copy 1 byte less to get rid of the warning. Closes #4515 (cherry picked from commit 49fa68a7)
-
- Dec 11, 2019
-
-
Vladislav Shpilevoy authored
The test started failing after my commit: ca07088c (func: fix not unloading of unused modules), because I forgot to update the result file. Follow up #4648 (cherry picked from commit eddc8cc0)
-
- Dec 10, 2019
-
-
Vladislav Shpilevoy authored
C functions are loaded from .so/.dylib dynamic libraries. A library is loaded when any function from there is called first time. And was supposed to be unloaded, when all its functions are dropped from the schema (box.schema.func.drop()), and none of them is still in a call. But the unloading part was broken. In fact, box.schema.func.drop() never unloaded anything. Moreover, when functions from the module were added again without a restart, it led to a second mmap of the same module. And so on, the same library could be loaded any number of times. The problem was in a useless flag in struct module preventing its unloading even when it is totally unused. It is dropped. Closes #4648
-
Vladislav Shpilevoy authored
Error injections are used to simulate an error. They are represented as a flag, or a number, and are used in Lua tests. But they don't have any feedback. That makes impossible to use the injections to check that something has happened. Something very needed to be checked, and impossible to check in a different way. More certainly, the patch is motivated by a necessity to count loaded dynamic libraries to ensure, that they are loaded and unloaded when expected. This is impossible to do in a platform independent way. But an error injection as a debug-only counter would solve the problem. Needed for #4648
-
Serge Petrenko authored
snrpintf always null-terminates the passed string, and it also returns the number of bytes that "would have been written if there was enough space", so not only we don't have to null-terminate the string, but even more so we shouldn't do it erroneously. The only case when a string should be null-terminated manually is when the print cycle doesn't run at all, so move the termination before the cycle. Closes #4636 (cherry picked from commit 2066f297)
-
- Dec 06, 2019
-
-
Chris Sosnin authored
It was requested to be raised from 32 to 128 Closes #4670 (cherry picked from commit a4e514e46ca87242fe9d72e63e0079a1fec24990)
-
Vladislav Shpilevoy authored
Closes #4519 @TarantoolBot document Title: key_def.new() accept both 'field' and 'fieldno' Before the patch key_def.new() took an index part array as it is returned in <index_object>.parts: each part should include 'type', 'fieldno', and what else .parts element contains. But it was not possible to create a key_def from an index definition - the array passed to <space_object>.create_index() 'parts' argument. Because key_def.new() didn't recognize 'field' option. That might be useful, when a key_def is needed on a remote client, where a space object and its indexes do not exist. And it would be strange to force a user to create them just so as he would be able to access <net_box connection>.space.<space_name>. index.<index_name>.parts As well as it would be crutchy to make a user manually replace 'field' with 'fieldno' in its index definition just to create a key_def. Additionally, an ability to pass an index definition to a key_def constructor makes the API more symmetric. Note, that it still is not 100% symmetric, because a user can't pass field names to the key_def constructor. A space is needed for that anyway. (cherry picked from commit 39918baf)
-
- Dec 05, 2019
-
-
Vladislav Shpilevoy authored
The problem was in that the test uses the global trigger box.session.on_disconnect() to set a global variable by one connection. But test-run can do multiple connects/reconnects to the same instance. That led to multiple invocations of box.session.on_disconnect(), which could override the global variable in unexpected ways and moments. The patch makes only one session execute that trigger. Probably related to https://github.com/tarantool/test-run/issues/46 Follow up #4627 Reviewed-by:
Alexander Turenko <alexander.turenko@tarantool.org> (cherry picked from commit 9643fdc7)
-
Kirill Yukhin authored
List of changes - fold: keep type of emitted CONV in sync with its mode - test: adjust the test name related to PAIRSMM flag (cherry picked from commit e12930d0)
-
Olga Arkhangelskaia authored
Turns on LUAJIT_ENABLE_PAIRSMM flag for tarantool build. Now __pairs/__ipairs metamethods are available. Closes #4650 (cherry picked from commit b504ca1a096a839f3a4fddc72a33457a3f0dc700)
-
Alexander V. Tikhonov authored
Added build + test jobs in GitLab-CI and build + test + deploy jobs on Travis-CI for Fedora 31. Updated testing dependencies in the RPM spec to follow the new Python 2 package naming scheme that was introduced in Fedora 31: it uses python2-' prefix rather then 'python-'. Fedora 31 does not provide python2-gevent and python2-greenlet packages, so they were pushed to https://packagecloud.io/packpack/backports repository. This repository is enabled in our build image (packpack/packpack:fedora-31) by default. Those dependencies are build-time, so nothing was changed for a user. The source RPM packages were gathered from https://rpms.remirepo.net/rpmphp/ . Closes #4612 Reviewed-by:
Alexander Turenko <alexander.turenko@tarantool.org> (cherry picked from commit 9e09b07c)
-
Alexander Turenko authored
Strengthen test_run:cmd() against temporary connection failures (#193). We recently added 'replication/box_set_replication_stress' test that may exceed file descriptor limit. When test_run:cmd() function executes a command ('switch master' in the case), it tries to create a new socket and connect it to test-run's inspector, but it may fail to do so in the case, because of the file descriptor limit. The sockets that the test produces are closed in background, so if we'll keep trying to create and connect a socket we'll succeed once. This is exactly that the test-run's patch doing: it fails test_run:cmd() function only if a socket cannot be connected during 100 seconds. I guess that the reason why sockets are not closed immediately is that relays wait until replicas will close its side of a socket and only then closes its side. Didn't investigate it deeper, to be honest. (cherry picked from commit 5fccf003)
-
- Dec 03, 2019
-
-
Maria authored
Inside json_decode() struct luaL_serializer is allocated on stack, but json context stores pointer to it: 998 static int json_decode(lua_State *l) 999 { ... 1007 if (lua_gettop(l) == 2) { 1008 struct luaL_serializer user_cfg = *luaL_checkserializer(l); 1009 luaL_serializer_parse_options(l, &user_cfg); 1010 lua_pop(l, 1); 1011 json.cfg = &user_cfg; 1012 } Later (for instance in json_decode_descend()), it can be dereferenced which in turn results in stack-use-after-scope (object turns into garbage right after scope is ended). To fix it let's simply avoid allocating and copying luaL_serializer on stack and instead use pointer to it. Bug is found by ASAN: test app-tap/json.test.lua fails with enabled ASAN. Current fix allows to pass all tests. Thanks to @Korablev77 for the initial investigation. Closes #4637 (cherry picked from commit 6508ddb7)
-
- Dec 02, 2019
-
-
Alexander Turenko authored
This reverts commit a0b196dd. This commit was pushed occasionally and points to a draft commit in test-run repository. See also https://github.com/tarantool/test-run/issues/195 (cherry picked from commit 4acdeeda)
-