- Mar 04, 2019
-
-
Nikita Pettik authored
This file contains unused functions and dead code. Let's remove them. Follow-up #3542
-
Ivan Koptelov authored
If utf-8 string is passed to built-in functions such as LIKE, LENGTH etc, and it contains '\0' symbol, then one is assumed to be end-of-string. This approach is considered to be inappropriate. Lets fix it: treat '\0' as another one utf-8 symbol and process strings containing it entirely. Consider examples: LENGTH(CHAR(65,00,65)) == 3 LIKE(CHAR(65,00,65), CHAR(65,00,66)) == False Also the patch changes the way we count length of utf-8 strings. Before we processed each byte of the string. Now we use the following algorithm. Starting from the first byte in string, we try to determine what kind of byte it is: first byte of 1,2,3 or 4 byte sequence. Then we skip corresponding amount of bytes and increment symbol length (e.g. 2 bytes for 2 byte sequence). If current byte is not a valid first byte of any sequence, when we skip it and increment symbol length. Note that new approach might increase performance of LENGTH(), INSTR() and TRIM(). Closes #3542 @TarantoolBot document Title: null-term is treated now as usual character in str funcs User-visible behavior of sql functions dealing with strings would change as it is described in the commit message.
-
- Mar 02, 2019
-
-
Cyrill Gorcunov authored
Suitable for those who is using quilt for development.
-
- Mar 01, 2019
-
-
Kirill Shcherbatov authored
Introduced a new JSON_TOKEN_ANY json token that makes possible to perform anonymous lookup in marked tree nodes. This feature is required to implement multikey indexes. Since the token entered into the parser becomes available to user, additional server-side check is introduced so that an error occurs when trying to create a multikey index. Needed for #1257
-
Vladimir Davydov authored
Follow-up 5993e149 vinyl: sanitize full/empty key stmt detection 4273ec52 box: introduce JSON Indexes
-
Vladimir Davydov authored
Historically, we use tuple_field_count to check whether a statement represents an empty key (match all) or a full key (point lookup): if the number of fields in a tuple is greater than or equal to the number of parts in a key definition, it can be used as a full key; if the number of fields is zero, then the statement represents an empty key. While this used to be correct not so long ago, appearance of JSON indexes changed the rules of the game: now a tuple can have nested indexed fields so that the same field number appears in the key definition multiple times. This means tuple_field_count can be less than the number of key parts and hence the full key check won't work for a statement representing a tuple. Actually, any tuple in vinyl can be used as a full key as it has all key parts by definition, there's no need to use tuple_field_count for such statements - we only need to do that for statements representing keys. Keeping that in mind, let's introduce helpers for checking whether a statement can be used as a full/empty key and use them throughout the code.
-
Alexander Turenko authored
Fix test_run:cmd('set variable ...') for string values (PR #146). It is needed for enabling the use_unix_sockets_iproto option.
-
Vladislav Shpilevoy authored
Mhash 'random' method is supposed to return a valid node id given an arbitrary integer, likely generated randomly. But on some values it was returning 'end' marker despite emptiness of the container. This was because of confusion in usage of mh_size() and mh_end(). Mh_size() means real number of objects, stored in the cache, while mh_end() means hash capacity, or 'number of buckets' as it is named. Generally capacity is bigger than size, and sometimes it led to a situation like this: size = 1 capacity = 4 rnd = 3 [0] [1] [2] [3] - - x - When code iterates only 'size' times, looking for an element starting from 'rnd' position, it will not find anything. It should iterate 'capacity' times instead.
-
Vladislav Shpilevoy authored
SWIM module API is going to provide a set of clear and pure functions with appropriately settled const qualifiers. And it wants to use sio_strfaddr() to provide to user an easy way to get a pointer to URI of a SWIM member stored in a const memory. It requires this two-line modification of sio module.
-
- Feb 28, 2019
-
-
Ilya Kosarev authored
Now there is new member in box.stat.net() called "CONNECTIONS" which is a number of active iproto connections. Closes #3905 @TarantoolBot document Title: box.stat.net Update the documentation for box.stat.net to reflect the addition of the field which reports iproto connections number.
-
Vladimir Davydov authored
The patch fixes the following test failure: | --- app/socket.result Mon Feb 25 17:32:49 2019 | +++ app/socket.reject Mon Feb 25 17:39:51 2019 | @@ -2827,7 +2827,7 @@ | ... | echo_fiber ~= nil | --- | -- true | +- false | ... | client:write('hello') | --- This happens, because we don't wait for echo_fiber to start. Use a channel to make sure it does. Also, increase read/write timeouts from 0.1 up to 5 seconds - it won't increase the test runtime, but it will make it more robust. Closes #4022
-
Vladimir Davydov authored
This patch fixes the following test failure: | --- box/iproto_stress.result Tue Dec 25 09:56:54 2018 | +++ box/iproto_stress.reject Tue Dec 25 10:12:22 2018 | @@ -80,7 +80,7 @@ | ... | n_workers -- 0 | --- | -- 0 | +- 340 | ... | n_errors -- 0 | --- | @@ -93,5 +93,3 @@ | --- | ... | box.cfg{net_msg_max = net_msg_max} | ---- | -... The problem is the test is quite cpu intensive so if the host is heavily loaded (as it is often the case when tests are run on Travis CI), it may take a few minutes to complete, while the timeout is set to 10 seconds. To fix it, let's - Increase the timeout up to 60 seconds and use test_run.wait_cond instead of a homebrew loop. - Decrease the number of fibers from 400 down to 100 and adjust box.cfg.net_msg_max respectively. Closes #3911
-
Konstantin Osipov authored
-
Vladimir Davydov authored
If a key is frequently updated, iteration to the next key stored in the memory level can take quite a while, because: - In case of GE/GT iterator, vy_mem_iterator_next_key will have to iterate the tree from left to right to skip older key versions. - In case of LE/LT iterator, vy_mem_iterator_find_lsn will have to iterate the tree from right to left to find the newest key version visible in the read view. To avoid that, let's fall back on key lookup if we failed to find an appropriate statement after one iteration, because in this case there's a good chance that there's more statements for this key. This should be fine since a lookup in a memory tree is pretty cheap.
-
Vladimir Davydov authored
- Don't pass iterator_type to vy_mem_iterator_seek and functions called by it. Instead pass only a key and jump to the first statement following the key according to the iterator search criteria. Turns out this is enough for memory iterator implementation. - Fold EQ check in vy_mem_iterator_seek to avoid code duplication. - Drop vy_mem_iterator_start and use vy_mem_iterator_seek directly.
-
Vladimir Davydov authored
This patch fixes the following test failure: | --- box/push.result Thu Jan 24 13:10:04 2019 | +++ var/001_box/push.result Thu Jan 24 13:13:08 2019 | @@ -536,17 +536,3 @@ | --- | ... | chan_disconnected:get() | ---- | -- true | -... | -chan_push:put(true) | ---- | -- true | -... | -chan_push:get() | ---- | -- Session is closed | -... | -box.schema.func.drop('do_long_and_push') | ---- | -... The problem occurs because the main fiber may close the connection before do_long_and_push sets the session.on_disconnect trigger, in which case chan_disconnected:get() will never return. Fix this by setting the trigger in the main fiber and adding another channel to wait for do_long_and_push function to start. Also, don't forget to clear the trigger once the test is complete. Fixes commit 43af2de2 ("session: outdate a session of a closed connection"). Closes #3947
-
Kirill Shcherbatov authored
Due to the fact that in the case of multikey indexes, the size of the field map may depend on a particular tuple, the tuple_int_field_map function has been reworked in such a way as to allocate the field map of the required size and return it. Needed for #1257
-
- Feb 27, 2019
-
-
Alexander Turenko authored
* Added basic luacov support. * Added use_unix_sockets_iproto option. * Fixed TARANTOOL_SRC_DIR on >=tarantool-2.1.1-322-g3f5f59bb5. - It is important for app-tap/http_client.test.lua, it fails now. * Renamed pre_cleanup to pretest_clean. * pretest_clean: clean up _cluster space.
-
Alexander Turenko authored
The bug was introduced in d735b6bf (move 'uri' lib to src/lib/).
-
Alexander Turenko authored
lcov reports the following warnings: Cannot open source file src/uri.rl Cannot open source file src/uri.c coveralls-lcov then fails with this message: coveralls-lcov --service-name travis-ci --service-job-id 498721113 --repo-token [FILTERED] coverage.info /var/lib/gems/2.3.0/gems/coveralls-lcov-1.5.1/lib/coveralls/lcov/converter.rb:63:in `initialize': No such file or directory @ rb_sysopen - /tarantool/src/lib/uri/CMakeFiles/uri.dir/src/uri.c (Errno::ENOENT) from /var/lib/gems/2.3.0/gems/coveralls-lcov-1.5.1/lib/coveralls/lcov/converter.rb:63:in `open' from /var/lib/gems/2.3.0/gems/coveralls-lcov-1.5.1/lib/coveralls/lcov/converter.rb:63:in `generate_source_file' from /var/lib/gems/2.3.0/gems/coveralls-lcov-1.5.1/lib/coveralls/lcov/converter.rb:16:in `block in convert' from /var/lib/gems/2.3.0/gems/coveralls-lcov-1.5.1/lib/coveralls/lcov/converter.rb:15:in `each' from /var/lib/gems/2.3.0/gems/coveralls-lcov-1.5.1/lib/coveralls/lcov/converter.rb:15:in `convert' from /var/lib/gems/2.3.0/gems/coveralls-lcov-1.5.1/lib/coveralls/lcov/runner.rb:68:in `run' from /var/lib/gems/2.3.0/gems/coveralls-lcov-1.5.1/bin/coveralls-lcov:5:in `<top (required)>' from /usr/local/bin/coveralls-lcov:22:in `load' from /usr/local/bin/coveralls-lcov:22:in `<main>' So coverage target in Travis-CI fails and a coverage does not reported to coveralls.io. The bug was introduced in d735b6bf (move 'uri' lib to src/lib/).
-
Vladislav Shpilevoy authored
'Info' is a header-only library consisting of one file. It is going to be used by SWIM, stored in src/lib, but src/lib can not depend on src/. This commit moves 'info' to lib/info. Needed for #3234
-
Vladislav Shpilevoy authored
Core is supposed to be the most basic library, providing only really common features used everywhere like fiber, diag, memory, logging. Which can't be said about collations - they are used only by high level things - SQL, Lua utf8, comparators. Collations are built now as 'lib/coll' library. The patch is not necessary for anything, but it is a right thing to do, while some activity is happening there.
-
Mergen Imeev authored
Error "syntax error after column name" does not make any sense. Let's remove it. Part of ...3965
-
Mergen Imeev authored
-
Mergen Imeev authored
Macros SQL_*_BKPT were used in debug mode to log errors that occurred during the execution of VDBE. They are not used now. This patch removes them. Part of #3965
-
Mergen Imeev authored
@TarantoolBot document Title: changes in EXPLAIN and PRAGMA The most important change is that the column names for the result of the "EXPLAIN ...", "EXPLAIN QUERY PLAN ..." and "PRAGMA ..." commands are now defined. Example: box.cfg{listen = 3302} cn = require('net.box').connect(box.cfg.listen) cn:execute('EXPLAIN SELECT 1;') In addition, the 'case_sensitive_like', 'parser_trace' and 'sql_default_engine' pragmas now return their values if they are executed without arguments. For the first two pragmas, this value is their state, and for the latter, the default engine currently set in SQL. Example: box.sql.execute('PRAGMA case_sensitive_like;') And the last change is that now the execution of the “PRAGMA” command without determining which pragma to execute returns status for all flag-type pragmas. Flag-type pragmas are pragmas that have TRUE or FALSE as status. Example: box.sql.execute('PRAGMA;')
-
Mergen Imeev authored
Currently, EXPLAIN and PRAGMA do not set the column types for the result. This is incorrect, since any returned row must have a column type. This patch defines the types for these columns. Closes #3832
-
Mergen Imeev authored
Currently box.sql.execute ('PRAGMA') returns nothing, but prints list of pragmas and their statuses to stdout. Such strategy is considered to be wrong since output of this command would be unavailable for users who redirect stdout, use net box connection etc. This patch makes the command to return result as the rest of SQL commands. The result contains only FLAG-type pragmas and their statuses.
-
Mergen Imeev authored
Currently PRAGMA case_sensitive_like returns nothing. This seems wrong, since other similar pragmas return their status. Fixed in the current patch.
-
Mergen Imeev authored
After this patch, "PRAGMA sql_default_engine" called without arguments will return currently set sql_default_engine.
-
Mergen Imeev authored
Currently PRAGMA parser_trace returns an empty table. This seems wrong, since other similar pragmas return their status. Fixed in the current patch.
-
Mergen Imeev authored
Some macros in pragma.c and pragma.h are obsolete because the values they are checking are no longer used or their usage makes no sense. Let's remove them.
-
- 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
-