- Aug 20, 2019
-
-
Kirill Shcherbatov authored
The SQL_FUNC_SLOCHNG flag was useful for datetime function that are currently not supported. So it could be removed. Needed for #2200, #4113, #2233
-
Kirill Shcherbatov authored
Renamed OP_Function opcode to OP_BuiltinFunction to introduce a new OP_Function operation in a new meaning: a new OP_Function would call Tarantool's function with new port-based API while legacy OP_BuiltinFunction is an efficient implementation of SQL Builtins functions. Needed for #2200, #4113, #2233
-
Kirill Shcherbatov authored
Tarantool's SQL engine generates a different VDBE bytecode for ..COUNT(*).. and ..COUNT(fieldname).. operations: the first one produces a lightweight OP_Count operation that uses native mechanism to report the count of record in index while the second one pessimistically opens a space read iterator and uses Count aggregate function. A helper routine is_simple_count decides whether such optimisation is correct. It used to use SQL_FUNC_COUNT flag to mark a dummy (non-functional) function entry with 0 arguments. This patch changes SQL_FUNC_COUNT semantics: now it is a marker of any COUNT function, while is_simple_count relies on count of arguments to distinguish aggregate and non-aggregate functions. Needed for #2200, #4113, #2233
-
Kirill Shcherbatov authored
A new dispatcher function trim_func calls corresponding trim_ function implementation in relation with number of argc - a count of arguments. This is an important step to get rid of function's name overloading required for replace FuncDef cache with Tarantool's function cache. Needed for #2200, #4113, #2233
-
Kirill Shcherbatov authored
This patch does two things: renames existing scalar min/max functions and reserves names for them in NoSQL cache. Moreover it is an important step to get rid of function's name overloading required for replace FuncDef cache with Tarantool's function cache. Closes #4405 Needed for #2200, #4113, #2233 @TarantoolBot document Title: Scalar functions MIN/MAX are renamed to LEAST/GREATEST The MIN/MAX functions are typically used only as aggregate functions in other RDBMS(MSSQL, Postgress, MySQL, Oracle) while Tarantool's SQLite legacy code use them also in meaning GREATEST/LEAST scalar function. Now it fixed.
-
Kirill Shcherbatov authored
The SQL_PreferBuiltin flag is redundant (because builtin names are forbidden for UDFs) so we may to remove it. Needed for #4113, #2200, #2233
-
Kirill Shcherbatov authored
Vdbe field ref is a dynamic index over tuple fields storing offsets to each field and filling the offset array on demand. It is highly used in SQL, because it strongly relies on fast and repetitive access to any field, not only indexed. There is an optimisation for the case when a requested field fieldno is indexed, and the tuple itself stores offset to the field in its own small field map, used by indexes. vdbe_field_ref then uses that map to retrieve offset value without decoding anything. But when SQL requests any field > fieldno, then vdbe_field_ref decodes the tuple from the beginning in the worst case. Even having previously accessed fieldno. But it could start decoding from the latter. An updated vdbe_field_ref fetcher class uses a bitmask of initialized slots to use pre-calculated offsets when possible. This speed-ups SQL in some corner case and doesn't damage performance in general scenarios. Closes #4267
-
- Aug 19, 2019
-
-
Mons Anderson authored
-
- Aug 16, 2019
-
-
Konstantin Osipov authored
Before this patch, snapshot interval was set randomly within checkpoint_interval period. However, after box.snapshot(), the next snapshot was scheduled exactly checkpoint_interval from the current time. Many orchestration scripts snapshot entire cluster right after deployment, to take a backup. This kills randomness, since all instances begin to count the next checkpoint time from the current time. Randomize the next checkpoint time after a manual snapshot as well. Fixes gh-4432
-
Alexander Turenko authored
pretest_clean: preserve GREATEST and LEAST built-in functions. Needed for #4405.
-
Roman Khabibov authored
Originally, mask in struct Keyword served to reduce set of reserved keywords for build-dependent features. For instance, it was allowed to disable triggers as a compilation option, and in this case TRIGGER wouldn't be reserved word. Nowadays, our build always comprises all features, so there's no need in this option anymore. Hence, we can remove mask alongside with related to it macros. Closes #4155
-
Nikita Pettik authored
It was forgotten to update result file of sql/bind.test.lua in previous patch. Let's fix that and refresh sql/bind.result with up-to-date results.
-
- Aug 15, 2019
-
-
Nikita Pettik authored
It was decided that for all integer literals we would return "INTEGER" type, not "UNSIGNED". Accidentally, after substitution of unsigned binding value type was set to "UNSIGNED". Let's fix that and set "INTEGER" type.
-
Kirill Yukhin authored
-
Kirill Yukhin authored
-
- Aug 14, 2019
-
-
Vladimir Davydov authored
wal_sync() simply flushes the tx<->wal request queue, it doesn't guarantee that all pending writes are successfully committed to disk. This works for now, but in order to implement replica join off the current read view, we need to make sure that all pending writes have been persisted and won't be rolled back before we can use memtx snapshot iterators. So this patch adds a return code to wal_sync(): since now on it returns -1 if rollback is in progress and hence some in-memory changes are going to be rolled back. We will use this method after opening memtx snapshot iterators used for feeding a consistent read view a newly joined replica so as to ensure that changes frozen by the iterators have made it to the disk.
-
Alexander V. Tikhonov authored
Found that on high loaded hosts the test flaky fails at: [004] --- app/socket.result Mon Jul 15 07:18:57 2019 [004] +++ app/socket.reject Tue Jul 16 16:37:35 2019 [004] @@ -1118,7 +1118,7 @@ [004] ... [004] ch:get(1) [004] --- [004] -- true [004] +- null [004] ... [004] s:error() [004] --- Found that the test in previous was used for testing the the channel get() function timeout and the error occurred on it, but later the checking error changed to: "builtin/socket.lua: attempt to use closed socket" and the test became not correct. Because for now it passes when the socket read function runs before the socket closing, but in this way read call doesn't wait. In the other way on high loaded hosts the close call may occure before read call and in this way read call halts and socket get call returns 'null'. As seen both ways are not correct to check the error. Decided to remove this subtest. Check commit ba7a4fee ("Add tests for socket:close closes #360") Fixes #4354
-
Vladimir Davydov authored
We will reuse it to relay a snapshot to a newly joined replica.
-
Vladimir Davydov authored
Memtx iterators never fail, that's why the snapshot iterator interface doesn't support failures. However, once we introduce snapshot iterator support for vinyl, we will need a way to handle errors in the API.
-
Vladimir Davydov authored
It's pointless as we can always access the index via iterator->index.
-
Vladimir Davydov authored
Now, as vy_lsm and index are basically the same object, we can implement reference counting right in struct index. This will allow us to prevent an index from destruction when a space object it belongs to is freed anywhere in the code, not just in vinyl.
-
Vladimir Davydov authored
There's no point in having vinyl_engine and vinyl_index wrapper structs to bind vy_env and vy_lsm to struct engine and index. Instead we can simply embed engine and index in vy_env and vy_lsm. This will simplify further development, e.g. this will allow us to move reference counting from vy_lsm up to struct index so that it can be used in the generic code.
-
Vladimir Davydov authored
There's no point in having vinyl_engine and vinyl_index wrapper structs to bind vy_env and vy_lsm to struct engine and index. Instead we can simply embed engine and index in vy_env and vy_lsm. This will simplify further development, e.g. this will allow us to move reference counting from vy_lsm up to struct index so that it can be used in the generic code.
-
Serge Petrenko authored
Part of #4403 @TarantoolBol document Title: Document decimal modulo operator There is now a modulo operator for decimal numbers: ``` a = decimal.new(172.51) a % 1 --- - '0.51' ... a % 0.3 --- - '0.01' ... a % 13.27 --- - '0.00' ... a % 173 --- - '172.51' ... a % 72 --- - '28.51' ... 720 % a --- - '29.96' ... ```
-
- Aug 13, 2019
-
-
Vladislav Shpilevoy authored
JSON paths has no a strict standard, but definitely there is no an implementation, allowing to omit '.' after [], if a next token is a key. For example: [1]key is invalid. It should be written like that: [1].key Strangely, but we even had tests on the invalid case. Closes #4419
-
- Aug 11, 2019
-
-
Alexander Turenko authored
Disable a check whether yaml responses are well-formed for 'core = tarantool' tests in test-run. The check was unable to handle complex (dictionary / list) keys in a dictionary, because pyyaml does not support them. See also https://github.com/yaml/pyyaml/issues/88 Fixes #4421.
-
- Aug 09, 2019
-
-
Vladislav Shpilevoy authored
In one place that test sends a packet and expects that it has arrived two lines below. Under high load it may take more time. The patch makes the test explicitly wait for the packet arrival. Closes #4392
-
- Aug 08, 2019
-
-
Yaroslav Dynnikov authored
There is compile time option PACKAGE in cmake to define current build distribution info. By default it's "Tarantool" for the community version and "Tarantool Enterprise" for the enterprise version. It's displayed in console greeting and in `box.info().package`, but, unfortunately, it can't be accessed from Lua before `box.cfg`. This patch exposes `require('tarantool').package`. Close #4408 @TarantoolBot document Title: Extend module "tarantool" with the field "package" Beside from build info and version, module "tarantool" now provides "package" field. By default it equals string "Tarantool", but can differ for other distributions like "Tarantool Enterprise". Example: ```console tarantool> require('tarantool') --- - version: 2.3.0-3-g302bb3241 build: target: Linux-x86_64-RelWithDebInfo options: cmake . -DCMAKE_INSTALL_PREFIX=/opt/tarantool-install -DENABLE_BACKTRACE=ON mod_format: so flags: ' -fexceptions -funwind-tables -fno-omit-frame-pointer -fno-stack-protector -fno-common -fopenmp -msse2 -std=c11 -Wall -Wextra -Wno-strict-aliasing -Wno-char-subscripts -Wno-format-truncation -fno-gnu89-inline -Wno-cast-function-type' compiler: /usr/bin/cc /usr/bin/c++ pid: 'function: 0x40016cd0' package: Tarantool uptime: 'function: 0x40016cb0' ... ```
-
- Aug 06, 2019
-
-
Kirill Shcherbatov authored
The _func_index space trigger used to reject an insertion of a tuple that defines an invalid functional index. As insertion in _index space had been completed before, a garbage is kept in _index space in such case. We need to do something with the yelding _func_index trigger(that rebuilds an index) to wrap all index creation operation in DDL transaction in further patches (because only the first DDL operation may yeld now). This problem could be trivially solved with preparatory initialization of index_def function ponter: the memtx_tree index construction would perform all required job in such case. Therefore the following index rebuild in _func_index trigger becomes redundant and should be omitted. In other words, a trivial prefetch operation makes possible a transactional index creation (with space:create_index operation). As for index construction during recovery (a lack of function cache during recovery was the main motivation to introduce _func_index space), it's workflow is kept unchanged. Follow up #1250 Needed for #4348 Closes #4401
-
Vladimir Davydov authored
As per request by Kostja, commit an RFC document with a brief history of the vinyl metadata log infrastructure, issues it was intended to solve, problems we are facing now, and possible ways to solve them.
-
- Aug 02, 2019
-
-
Vladimir Davydov authored
In case an error occurs between relay_start() and cord_costart() in relay_subscribe(), the relay status won't be reset to STOPPED. As a result, any further attempt to re-subscribe will fail with ER_CFG: duplicate connection with the same replica UUID. This may happen, for example, if the WAL directory happens to be temporarily inaccessible on the master. Closes #4399
-
Cyrill Gorcunov authored
The function | require('console').get_default_output() requires no arguments. Make it explcicit and print an error otherwise. Part-of #3834
-
Cyrill Gorcunov authored
Instead of allocating a variable for optional args testing we should use dot notation instead. Otherwise it won't work for trivial test case as ``` require('console').set_default_output('lua,block') require('decimal').new('1234.5678') ``` | builtin/box/console.lua:47: expected decimal, number or string as 2 argument and program exits. Part-of #3834
-
Cyrill Gorcunov authored
In output_verify_opts and output_parse we return status variable to point if function processed without error. This is redundant we can simply return either error or nil, which is enough. Part-of #3834
-
Nikita Pettik authored
It was decided that null value in SQL by default should be of type boolean. Justification of such change is that according to ANSI boolean type in fact has three different values: true, false and unknown. The latter is basically an alias to null value.
-
Nikita Pettik authored
If during creation of constraint its name is not specified, then it is generated automatically. Occasionally, default names for each type of constraint turn out to be different. This patch makes them follow the same pattern: "shortcut"_unnamed_"table_name"_"ordinal_numb". For instance: fk_unnamed_T1_1 or ck_unnamed_T1_3 etc
-
Nikita Pettik authored
If UNIQUE constraint is specified in CREATE TABLE statement and it has given name, one is mangled with pattern "unique_%s_%d", where %s is original name of constraint and %d - current iid. For instance: CREATE TABLE t (id INT PRIMARY KEY, a INT CONSTRAINT i1 UNIQUE); This statement results in secondary index creation with name "unique_I1_1". Justification for mangling is that constraint namespace should be independent from index namespace. However, ALTER TABLE ADD CONSTRAINT UNIQUE which is alias to CREATE INDEX doesn't mangle name. What is more, users may wonder why name of index is different from name of created constraint. Hence, it has been decided to remove this mangling and create index exactly with specified constraint's name.
-