- Mar 27, 2019
-
-
Kirill Shcherbatov authored
Refactored sqlSrcListAppend routine as sql_src_list_append and reworked it to use diag_set in case of memory allocation error. This change is necessary because the sql_src_list_append body has a sqlNameFromToken call that will be changed in subsequent patches. This patch refers to a series of preparatory patches that provide the use of Tarantool errors in the call tree that includes sqlNormalizeName, since this call can later return errors. This patch is not self-sufficient, its sqlNameFromToken call remained to be non-Tarantool (for now). It means, that if sqlNameFromToken fails in sql_src_list_append there is no diag message created. Part of #3931
-
Kirill Shcherbatov authored
Refactored sqlSrcListEnlarge routine as sql_src_list_enlarge and reworked to use diag_set in case of memory allocation error. This will ensure that the sqlSrcListAppend function throws an error using diag in subsequent patches. This patch refers to a series of preparatory patches that provide the use of Tarantool errors in the call tree that includes sqlNormalizeName, since this call can later return errors. This patch is not self-sufficient, its usage in sqlSrcListAppend remained to be non-Tarantool (for now). It means, that if sql_src_list_enlarge fails in sqlSrcListAppend the diag will never be thrown. Part of #3931
-
Kirill Shcherbatov authored
Refactored sqlAllocSrcList routine as sql_src_list_new and reworked it to use diag_set in case of memory allocation error. This will ensure that the sqlSrcListAppend function throws an error using diag in subsequent patches. This patch refers to a series of preparatory patches that provide the use of Tarantool errors in the call tree that includes sqlNormalizeName, since this call can later return errors. This patch is not self-sufficient, its usage in sqlSrcListAppend remained to be non-Tarantool (for now). It means, that if sql_src_list_new fails in sqlSrcListAppend and sets a diag, it is never thrown to a user (now). Part of #3931
-
Vladimir Davydov authored
We call it after each invocation of space_cache_replace() so better fold it. Panic on error running triggers as space_cache_replace() isn't supposed to fail. Remove empty on_create_space_commit() while we are at it. Follow-up commit 082cffca ("Synchronize lua schema update with space cache").
-
Kirill Shcherbatov authored
In some cases(like foreign keys) the SQL code used 32-bit bit mask, while 64-bit bit masks will perform better column optimizations. There was refactored code to work with 64b bitmasks where required. The 32b bitmasks are still used to specify constant OP_Function arguments because this change would require changing the P1 type of the VDBE p1 argument, which is not desirable. Moreover, the 64 function's arguments is an explicit overkill. The ticket was created in connection with the introduction of foreign keys and their use of 32-bit bit masks. In the rest of the scripts in SQL already use 64 bit masks, and the "smart" bit of the mask is not applicable. Closes #3571
-
Konstantin Osipov authored
-
Georgy Kirichenko authored
Allow single statement transactions within begin/commit in case of an ddl operation instead of auto commit requirements. This is essential for a transactional applier. Needed for: #2798
-
Alexander Turenko authored
The documentation [1] says this field is optional. I don't know which commit lead to the regression, only that 2.1.1-7-gd381a45b6 is good. [1]: https://tarantool.io/en/doc/2.1/dev_guide/internals/sql_protocol/ Fixes #4077.
-
- Mar 26, 2019
-
-
Mergen Imeev authored
This patch completely replaces sqlErrorMsg() with diag_set() and removes sqlErrorMsg(). Closes #3965 Closes #3036
-
Mergen Imeev authored
This patch reworks some of SQL semantic errors. Part of #3965
-
Alexander Turenko authored
Stop a file processing loop only when it is guaranteed that we will not find a record that match user-provided filters later in this file. If --replica R is provided one time and we're meet a record from R with a LSN equal or above of a --to value, we'll stop the loop. Otherwise (no --replica, several --replica arguments) a file will be read until an end even if --to is provided. Fixes #3827.
-
Alexander Turenko authored
Exposed this unified code (filter_xlog() function) and wrote a unit test. Allow to run app-tap/tarantoolctl.test.lua w/o test-run. Needed for #3827.
-
Georgy Kirichenko authored
Update lua schema as soon as space cache replace was done instead of doing this while on_commit trigger executes. In opposite then case schema changes would not be visible until commit was finished. Needed for: #2798
-
Roman Khabibov authored
It's OK to use json format with the boot logger. As for syslog, let's add a check to Lua's log_format() so that it fails gracefully rather than raising an assertion. Closes #3946
-
Georgy Kirichenko authored
Abort a new index creation if truncate couldn't be finished because of rollback or an error. Without this vinyl fails because of internal scheduler assertion. Needed for: 2798
-
Kirill Shcherbatov authored
We must to enshure that hints don't broke tuple comparison. As different field_types use different routines to calculate hint, we must to ensure that the calculated values are compatible with each other. Also tested the corner cases for large double numbers, due to the fact that there may be additional difficulties in hint construction. Follow-up 9fba29ab memtx: introduce tuple compare hint
-
Kirill Shcherbatov authored
Allow to call box.session.exists() and box.session.fd() without any arguments. In such case, current session is used. The box.session.peer() already support such feature, so we need it to be consistent. Closes #4021
-
Serge Petrenko authored
The test used to write big rows (20 mb in size), so when run in parallel mode, it put high load on the disk and processor, which made appliers time out multiple times during read, and caused the test to fail occasionally. So, instead of writing huge rows in test, introduce a new error injection restricting sio from reading more than a couple of bytes per request. This ensures that the test is still relevant and makes it a lot more lightweight. Closes #4062
-
Kirill Shcherbatov authored
Tarantool could not start from the snapshot created by version 2.1.0 because the new version 2.1.1 does not support the index.opts.sql index opt and stops the execution. Introduced a special state OPT_DEF_LEGACY macro to ignore legacy options and introduced migration code in upgrade.lua.
-
Mergen Imeev authored
At this point, an ANALYZE statement can lead to many problems. It was decided to temporarily ban this statement. Closes #4069
-
Vladislav Shpilevoy authored
Close #4050
-
- Mar 25, 2019
-
-
Alexander Turenko authored
Debian Wheezy is EOL since 31st May 2018, mirrors are disabled now.
-
Kirill Yukhin authored
-
- Mar 22, 2019
-
-
Kirill Yukhin authored
Development branch is now named master, so update conditions for extended extended checks on Travis. Also, set new repo name.
-
- Mar 21, 2019
-
-
Vladimir Davydov authored
There's a bug in the code building index hash on recovery: we replace a dropped index with any newer index, even incomplete one. Apparently, this is wrong, because a dropped index may have been dropped during final recovery and hence is still needed for initial recovery. If we replace it with an incomplete index in the index hash, initial recovery will fail with ER_INVALID_VYLOG_FILE: Invalid VYLOG file: LSM tree 512/1 not found (see vy_lsm_recover()). Fix this problem by checking create_lsn of the index that is going to replace a dropped one - if it's negative, we must link it to the dropped index via vy_lsm_recovery_info->prepared instead of inserting it into the hash directly. Closes #4066
-
Georgy Kirichenko authored
Perform a log rotation instead of a termination according to the documentation. Fix regression caused by 9f99bc62 Follow up for: 9f99bc62 Closes: #4063
-
Kirill Shcherbatov authored
Previously, all tuples created with frommap() used default format table_format_runtime, and therefore the created data tuples were not checked for the ability to be inserted into the target space. Moreover frommap(...):tomap(...) procedures sequence also did not work because tomap(..) routine assumes that the tuple has format with field names. Closes #4045
-
- Mar 20, 2019
-
-
Kirill Shcherbatov authored
Implement functions for retrieving tuple hints for a particular key_def. Hint is an integer that can be used for tuple comparison optimization: if a hint of one tuple is less than a hint of another then the first tuple is definitely less than the second; only if hints are equal tuple_compare must be called for getting comparison result. Hints are calculated using only the first part of key_def. @locker: - Rework key_def_set_hint_func. - Refactor functions calculating hints. - Drop has_collation template argument (we don't use templates for collations anywhere else). - Add part_count argument to key_hint (it's conventional to pass part_count along with decoded key). - Improve comments, rename a few functions, and cleanup code. Close #3961
-
Vladimir Davydov authored
- Fold key_def/cmp_def selection logic (memtx_tree_index_cmp_def). There are only a couple places that use it so it isn't going to hurt readability. - Add memtx_tree_cmp_def helper that returns the definition currently used by a memtx tree. In contrast to removed memtx_tree_index_cmp_def this one doesn't check index_def. Instead it returns memtx_tree arg. We will use it to compute key/tuple hints.
-
Nikita Pettik authored
During creation of VIEW space, string containing its definition (i.e. "SELECT ...") is parsed to fetch names of referenced spaces. By those names real struct space objects are found using schema_find_id(). This function processes lookup in _space using its secondary index. On the other hand, secondary indexes of _space are unavailable during this stage of recovery, so this lookup fails and whole recovery process aborts. It is worth mentioning that now we can fetch space directly from in-memory cache using its name (originally, when view reference counter was introduced, we couldn't do this due to absence of name-cache). So, to fix this issue, let's use space_by_name() instead of schema_find_id() Closes #3814
-
Nikita Pettik authored
Our SQL codebase was inherited from SQLite, where each table must have at least one index - primary (if no explicit PK declared, one based on rowid is implicitly created). In Tarantool spaces can exists without indexes. The only existing restriction is that they can't contain any data. Hence, even very basic queries fail with assertion/seagfault if they are applied to spaces with no indexes. Situation when space turns out to remain without PK is quite common due to the absence of transactional DDL: for instance, space drop procedure consists of several steps including dropping all indexes; space itself is dropped at the very end. Thus, if a sequence of queries is interrupted by drop space procedure and one is not finished, the rest of queries will operate on space with no indexes. As a solution to this problem (at least temporary) now we disallow query processing involving spaces without PK except for views. Closes #3780
-
- Mar 19, 2019
-
-
Vladimir Davydov authored
We're planning to introduce tuple comparison hints soon. Let's rename those helper function so as not to mix them.
-
Vladimir Davydov authored
Over time key_def virtual func setter code has turned into a complete mess: now it's an incomprehensible mix of if-else blocks, linear array search, and devious array indexing. What is worse, it's duplicated by tuple_compare_create and tuple_compare_with_key_create. Adding yet another parameter to key_def templates, which is needed to implement multi-key indexes, is literally impossible. This patch attempts to alleviate the situation by splitting code paths for pre-compiled, plain, and json indexes plus merging tuple_compare and tuple_compare_with_key setters.
-
Mergen Imeev authored
Three errors of "unsupported" type were reworked in this patch. Part of ...3965
-
Mergen Imeev authored
At the moment, the only purpose of the field nErr of struct Parse is to show whether the field is_aborted of the same struct is true or false. Let's remove it. Part of ...3965
-
Nikita Pettik authored
It is obvious that BLOB (that is value encoded in msgpack with MP_BIN format) values must be bound as BLOBs, not as strings. Unfortunately, they were bound as strings, which lead to wrong resulting type calculations after execution of SQL statement.
-
Mergen Imeev authored
Currently, field representing return code in struct Parse can take only two values: SQL_OK (successfully finished parsing) and SQL_TARANTOOL_ERROR (in case of any errors occurred). Therefore, it can be replaced with a boolean field. Patch provides straightforward refactoring. Part of #3965
-
Mergen Imeev authored
This argument has practically no functionality, but deleting it allows us to replace the rc field of the Parse structure with a new bool field. Part of #3965
-
Alexander Turenko authored
Fixes #4027.
-
Alexander Turenko authored
SHA-0 is considered weak for years and was removed in OpenSSL since 1.1.0. These Lua functions did not work since 15ed10e4, but give 'Digest method "sha" is not supported' error for any input. Removed them to don't confuse a user with a Tab completion. Follow up #1722. Fixes #4028.
-