- Dec 25, 2019
-
-
Nikita Pettik authored
Move names and types of resulting set to a separate structure. Simplify their storage by introducing separate members for name and type (previously names and types were stored in one char * array). It will allow us to add new metadata properties with ease. Needed for #4407
-
- Dec 24, 2019
-
-
Nikita Pettik authored
Any user defined function features assumed type of returned value (if it is not set explicitly during UDF creation, then it is ANY). After function's invocation in SQL, type of returned value is checked to be compatible with mentioned type of returned value specified in function's definition. It is done by means of field_mp_plain_type_is_compatible(). This functions accepts 'is_nullable' arguments which indicates whether value can be nullable or not. For some reason 'is_nullable' is set to 'false' in our particular case. Hence, nils can't be returned from UDF for SCALAR types. Since there's no reason why nils can't be returned from UDFs, let's fix this unfortunate bug.
-
Chris Sosnin authored
It is possible to create a sequence manually, and give it to a newly created index as a source of unique identifiers. Such sequences are not owned by a space, and therefore shouldn't be deleted when the space is dropped. They are not dropped when space:drop() in Lua is called, but were dropped in SQL 'DROP TABLE' before this patch. Now Lua and SQL are consistent in that case.
-
Nikita Pettik authored
GCC features warning diagnostics which allows to detect wrong ; right after 'if' operator: if (X == Y); { ... } In this case despite evaluation of 'if' argument expression, statements after it will be always executed. According to our codestyle, we neglect bracers around 'if' body in case it consists of single statement and fits into one line. On the other hand, in SQL debug macros like VdbeComment() are defined as empty, so statements like: if (X) VdbeComment(); turn into if (X) ; in release builds. As a result, we get 'false' warning (which is compilation error in -Werror mode). To fix it let's make VdbeComment() macros be non-empty in release mode and expand them into (void) 0.
-
Chris Sosnin authored
Dropping table with sql removes everything associated with it but grants, which is inconsistent. Generating code for it fixes this bug. Closes #4546
-
- 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>
-
Ilya Kosarev authored
CURLOPT_ACCEPT_ENCODING libcurl option is now supported. This option enables automatic decompression of HTTP responses. See https://curl.haxx.se/libcurl/c/CURLOPT_ACCEPT_ENCODING.html Closes #4232 Reviewed-by:
Alexander Turenko <alexander.turenko@tarantool.org> @TarantoolBot document Title: httpc: add curl accept_encoding option Update the documentation for client_object:request() parameters to reflect new accept_encoding option. It enables automatic decompression of HTTP responses by setting the contents of the Accept-Encoding header sent in a HTTP request and enabling decoding of a response when a Content-Encoding header is received. This is a request, not an order; the server may or may not do it. Servers might respond with Content-Encoding even without getting an Accept-Encoding in the request. Servers might respond with a different Content-Encoding than what was asked for in the request. @param accept_encoding specifies what encoding you'd like. This param can be an empty string which means Accept-Encoding header will contain all built-in supported encodings. This param can be comma-separated list of accepted encodings, like: "br, gzip, deflate". Bundled libcurl supports "identity", meaning non-compressed, "deflate" which requests the server to compress its response using the zlib algorithm and "gzip" which requests the gzip algorithm. System libcurl also possibly supports "br" which is brotli. See https://curl.haxx.se/libcurl/c/CURLOPT_ACCEPT_ENCODING.html
-
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>
-
- 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
-
Vladislav Shpilevoy authored
Isolated tuple update is an update by JSON path, which hasn't a common prefix with any other JSON update operation in the same set. For example, these JSON update operations are isolated: {'=', '[1][2][3]', 100}, {'+', '[2].b.c', 200} Their JSON paths has no a common prefix. But these operations are not isolated: {'=', '[1][2][3]', 100}, {'+', '[1].b.c', 200} They have a common prefix '[1]'. Isolated updates are a first part of fully functional JSON updates. Their feature is that their implementation is relatively simple and lightweight - an isolated JSON update does not store each part of the JSON path as a separate object. Isolated update stores just string with JSON and pointer to the MessagePack object to update. Such isolated updates are called 'bar update'. They are a basic brick of more complex JSON updates. Part of #1261
-
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
-
- Dec 17, 2019
-
-
Nikita Pettik authored
Some built-in functions can accept different number of arguments. Check of argument count for such functions takes place right before its execution. So it is possible that expression-list representing arguments for built-in function is NULL. On the other hand, in sql_expr_coll() (which returns collation of expression) it is assumed that if function features SQL_FUNC_DERIVEDCOLL flag (it implies that resulting collation depends on collation of arguments) then it has at least one argument. The last assumption is wrong considering for example SUBSTR() function: it may have 1 or 2 arguments, so check of argument count doesn't occur during compilation. Hence, if it is required to calculate collation for SUBSTR() function and there's no arguments, Tarantool crashes due to null-dereference. This patch fixes this bug with one additional check in sql_expr_coll().
-
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>
-
- 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
-
- 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
-
Mergen Imeev authored
This patch fixes a bug that prevented the conversion of real values that are greater than INT64_MAX and less than UINT64_MAX to INTEGER and UNSIGNED. Closes #4526
-
Mergen Imeev authored
The sqlVdbeMemIntegerify() function accepts the is_forced flag as one of the arguments. But this flag is actually useless, because regardless of whether it is TRUE or FALSE, the function will do the same. This patch removes the is_forced argument from the function. There will be no test, since the result of the function has not changed. Part of #4526
-
- Dec 10, 2019
-
-
Olga Arkhangelskaia authored
According to code coio_call does not take a timeout as an argument, however it was mentioned in the comment and usage example. This lead to error in documentation. The patch fixes it. Closes #4663
-
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
-
Vladislav Shpilevoy authored
There is a bug in XCode 11 which makes some standard C headers not self sufficient when compile with gcc. At least <stdlib.h> and <algorithm> are affected. When they are included first, compilation fails with creepy errors like this: In file included from /Applications/Xcode.app/Contents/Developer/ Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/ sys/wait.h:110, from /Applications/Xcode.app/Contents/Developer/ Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/ stdlib.h:66, from tarantool/third_party/zstd/lib/common/zstd_common.c:16: /Applications/Xcode.app/Content/Developer/ Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/ sys/resource.h: In function 'getiopolicy_np': /Applications/Xcode.app/Contents/Developer/ Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/ sys/resource.h:447:34: error: expected declaration specifiers before '__OSX_AVAILABLE_STARTING' 447 | int getiopolicy_np(int, int) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0); The patch workarounds the bug by deleting the buggy header includes where possible, and by changing include order in other cases. Also there was a second compilation problem. This was about different definitions of the same standard functions: via extern "C" and without. It looked like this: In file included from tarantool/src/trivia/util.h:36, from tarantool/src/tt_pthread.h:35, from tarantool/src/lib/core/fiber.h:38, from tarantool/src/lib/core/coio.h:33, from tarantool/src/lib/core/coio.cc:31: /usr/local/Cellar/gcc/9.2.0_1/lib/gcc/9/gcc/x86_64-apple-darwin18/9.2.0 include-fixed/stdio.h:222:7: error: conflicting declaration of 'char* ctermid(char*)' with 'C' linkage 222 | char *ctermid(char *); | ^~~~~~~ In file included from /Applications/Xcode.app/Contents/Developer/Platforms/ MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/unistd.h:525, from tarantool/src/lib/core/fiber.h:37, from tarantool/src/lib/core/coio.h:33, from tarantool/src/lib/core/coio.cc:31: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/ Developer/SDKs/MacOSX.sdk/usr/include/_ctermid.h:26:10: note: previous declaration with 'C++' linkage 26 | char *ctermid(char *); | ^~~~~~~ This bug is workarounded by deletion of the conflicting includes, because anyway they appeared to be not needed. Closes #4580 Conflicts: third_party/decNumber
-
Kirill Yukhin authored
New commit fixes build on XCode 11.
-
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
-
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
-
Chris Sosnin authored
Unicode_ci collation breaks the general rule for objects naming, so we remove it in version 2.3.1 Closes #4561
-
- Dec 06, 2019
-
-
Alexander V. Tikhonov authored
After the commit 77fa45bd ('lua: add fiber.top() listing fiber cpu consumption') the unit tests builds failed like: /opt/rh/devtoolset-6/root/usr/libexec/gcc/x86_64-redhat-linux/6.3.1/ld: ../../src/lib/core/libcore.a(fiber.c.o): undefined reference to symbol 'clock_gettime@@GLIBC_2.2.5' //lib64/librt.so.1: error adding symbols: DSO missing from command line collect2: error: ld returned 1 exit status test/unit/CMakeFiles/cbus.test.dir/build.make:108: recipe for target 'test/unit/cbus.test' failed make[2]: *** [test/unit/cbus.test] Error 1 Found that fiber.cc is using now clock_gettime(), which requires -lrt with glibc. To fix it added librt dependency for core library for glibc. Due to glibc requires for -lrt for clock_gettime() only for some versions, check 'man clock_gettime.2': 'Link with -lrt (only for glibc versions before 2.17).' the check whether is able to use clock_gettime() w/o librt library is added. Close #4639 (cherry picked from commit 99b0ef771135eab66ef3758371b1b5431e21cbff)
-
Chris Sosnin authored
It was requested to be raised from 32 to 128 Closes #4670
-
- 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>
-
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
-
Olga Arkhangelskaia authored
Turns on LUAJIT_ENABLE_PAIRSMM flag for tarantool build. Now __pairs/__ipairs metamethods are available. Closes #4650
-
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>
-
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.
-
- 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
-
- 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
-
Ilya Kosarev authored
There were some pass conditions in quorum test which could take some time to be satisfied. Now they are wrapped using test_run:wait_cond to make the test stable. Closes #4586
-
Ilya Kosarev authored
In replicaset_follow we iterate anon replicas list: list of replicas that haven't received an UUID. In case of successful connect replica link is being removed from anon list. If it happens immediately, without yield in applier, iteration breaks. Now it is fixed by rlist_foreach_entry_safe instead of common rlist_foreach_entry. Relevant test case is added. Part of #4586 Closes #4576 Closes #4440
-
Ilya Kosarev authored
During pruning of appliers some anon replicas might connect from replicaset_follow called in another fiber. Therefore we need to prune appliers of anon replicas first and, moreover, prune them one by one instead of iterating them, as far as any of them might connect while we are stopping the other one and it will break iteration. Part of #4586 Closes #4643
-
Ilya Kosarev authored
Stabilize tcp_connect in test_run:cmd() (tarantool/test-run#193)
-
- Nov 27, 2019
-
-
Ilya Kosarev authored
Triggers don't throw exceptions any more. Now they have return codes to report errors. Closes #4247
-
Ilya Kosarev authored
Since refactoring: clear privilege managing triggers from exceptions (977fca29) we are doing zero memset for trigger struct in txn_alter_trigger_new. This means we don't any more need to set any field of this struct to NULL explicitly. Part of #4247
-