Skip to content
Snippets Groups Projects
  1. Nov 09, 2023
  2. Nov 08, 2023
    • godzie44's avatar
      test: fix null pointer dereference in `coio::test_getaddrinfo` · b69c76f4
      godzie44 authored
      unit test, in case when assertion failed
      
      NO_DOC=test
      NO_CHANGELOG=test
      b69c76f4
    • Ilya Verbin's avatar
      box: introduce space:stat() · 45f9759f
      Ilya Verbin authored
      See the doc bot request for the description.
      
      Benchmark results:
      
      NO_WRAP
      $ taskset 0x2 compare.py benchmarks ./memtx.perftest.old ./memtx.perftest.new \
        --benchmark_min_warmup_time=10 \
        --benchmark_repetitions=30 \
        --benchmark_report_aggregates_only=true \
        --benchmark_filter=TreeReplaceRandomExistingKeys
      [...]
      Comparing ./memtx.perftest.old to ./memtx.perftest.new
      Benchmark                                                           Time             CPU      Time Old      Time New       CPU Old       CPU New
      ------------------------------------------------------------------------------------------------------------------------------------------------
      MemtxFixture/TreeReplaceRandomExistingKeys_mean                  +0.0097         +0.0097          1073          1084          1073          1084
      MemtxFixture/TreeReplaceRandomExistingKeys_median                +0.0075         +0.0075          1062          1070          1062          1070
      MemtxFixture/TreeReplaceRandomExistingKeys_stddev                -0.1207         -0.1208            56            49            56            49
      MemtxFixture/TreeReplaceRandomExistingKeys_cv                    -0.1291         -0.1292             0             0             0             0
      NO_WRAP
      
      Closes #6762
      
      @TarantoolBot document
      Title: Document `space:stat()`
      Product: Tarantool
      Since: 3.0
      Root document: https://www.tarantool.io/en/doc/latest/reference/reference_lua/box_space/
      
      space_object:stat() - Get statistics on the memory usage
      
      Returns a table with the cumulative statistics on the memory usage by
      tuples in the space. The statistics is grouped by arena types: "memtx"
      or "malloc".
      For a detailed description of each field see `tuple_object:info()`.
      
      Note: The statistics is collected only for memtx storage engine. For other
      types of spaces, an empty table is returned.
      
      Example:
      
      ```
      tarantool> box.space.test:stat()
      ---
      - tuple:
          memtx:
            data_size: 5100699
            header_size: 96
            field_map_size: 40
            waste_size: 143093
          malloc:
            data_size: 18850077
            header_size: 70
            field_map_size: 28
            waste_size: 0
      ...
      ```
      45f9759f
    • Ilya Verbin's avatar
      box: introduce tuple:info() · ab24dfb6
      Ilya Verbin authored
      See the doc bot request for the description.
      
      Part of #6762
      
      NO_CHANGELOG=next commit
      
      @TarantoolBot document
      Title: Document `tuple:info()`
      Product: Tarantool
      Since: 3.0
      Root document: https://www.tarantool.io/en/doc/latest/reference/reference_lua/box_tuple/
      
      tuple_object:info() - Get information about the tuple
      
      Returns a table with the following fields:
      
       * data_size - Size of the MessagePack data in the tuple.
         This number equals to number returned by `tuple_object:bsize()`.
       * header_size - Size of the internal tuple header.
       * field_map_size - Size of the field map.
         Field map is used to speed up access to indexed fields of the tuple.
       * waste_size - The amount of excess memory used to store the tuple
         in mempool.
       * arena - Type of the arena where the tuple is allocated.
         Possible values are: "memtx", "malloc", "runtime".
      ab24dfb6
    • Ilya Verbin's avatar
      perf: add TreeReplaceRandomExistingKeys to memtx benchmark · 3a3890ed
      Ilya Verbin authored
      It is similar to TreeGetRandomExistingKeys, but performs box_replace()
      instead of box_index_get().
      
      Needed for #6762
      
      NO_DOC=benchmark
      NO_TEST=benchmark
      NO_CHANGELOG=benchmark
      3a3890ed
  3. Nov 07, 2023
    • Mergen Imeev's avatar
      sql: fix segmentation fault when JOIN uses USING · 4f85d27e
      Mergen Imeev authored
      Before this patch, nameInUsingClause() expected old_col to be non-NULL,
      but this may not be the case. This patch fixes this feature accordingly.
      
      Follow-up #4467
      
      NO_DOC=bugfix
      NO_CHANGELOG=feature was not released yet
      4f85d27e
    • Mergen Imeev's avatar
      sql: introduce function default values · 6cb86dc1
      Mergen Imeev authored
      This patch replaces the SQL mechanism for setting expression default
      values with the BOX mechanism.
      
      Closes #8793
      
      @TarantoolBot document
      Title: field default value in SQL
      
      SQL now uses the default mechanism for BOX fields. The main difference
      visible to the user is that now all NULL values explicitly inserted into
      a field with a default value will be replaced with a default value,
      which is different from the original SQL behavior. Additionally, default
      values are now inserted instead of NULL after the SQL BEFORE INSERT
      trigger but before the BOX BEFORE INSERT trigger. Previously,
      SQL default values were inserted before the SQL BEFORE INSERT trigger.
      6cb86dc1
    • Mergen Imeev's avatar
      sql: separate function creation code · 5efd52ae
      Mergen Imeev authored
      This patch moves the VDBE function creation code from
      vdbe_emit_ck_constraint_create() to the new function
      vdbe_emit_create_function(). Because of this, the error message changes
      slightly.
      
      NO_DOC=refactoring
      NO_TEST=refactoring
      NO_CHANGELOG=refactoring
      5efd52ae
    • Mergen Imeev's avatar
      sql: rework literal as default value in SQL · 2582b6ae
      Mergen Imeev authored
      This patch replaces the SQL mechanism for setting literal default values
      with the BOX mechanism.
      
      Part of #8793
      
      NO_DOC=will be added later
      NO_CHANGELOG=will be added later
      2582b6ae
    • Mergen Imeev's avatar
      sql: do not accept not numbers with +/- as default · 8063a4c9
      Mergen Imeev authored
      After this patch, non-numeric values will not be accepted by the
      parser as default values if they have '+' or '-' before them.
      
      NO_DOC=will be added later
      8063a4c9
    • Mergen Imeev's avatar
      box: allow SQL_EXPR functions in defaults · 695e9b4b
      Mergen Imeev authored
      After this patch SQL_EXPR functions will be allowed to set as default
      values.
      
      Part of #8793
      
      @TarantoolBot document
      Title: SQL_EXPR functions as default values
      
      SQL_EXPR functions can now be set as default values. Note that all
      arguments to the SQL_EXPR functions will be replaced by the space field
      'default' value. This only matters for the SQL_EXPR used as default from
      Lua, since in SQL it is not allowed to have arguments in the default
      expression.
      695e9b4b
    • Mergen Imeev's avatar
      sql: drop support of DEFAULT in SHOW CREATE TABLE · 5fa406be
      Mergen Imeev authored
      This patch removes support for default values in SHOW CREATE TABLE,
      since it is not always possible to set the described default value in
      SQL. Support for literals and SQL_EXPR functions with zero arguments is
      potentially possible, and this support may be introduced later.
      
      Part of #8793
      
      NO_DOC=will be introduced later
      5fa406be
    • Mergen Imeev's avatar
      sql: do not lose defaults during ALTER TABLE · 937b2173
      Mergen Imeev authored
      Prior to this patch it was possible to lose BOX field default values
      after ALTER TABLE ADD COLUMN.
      
      NO_DOC=bugfix
      937b2173
  4. Nov 03, 2023
    • Igor Munkin's avatar
      luajit: bump new version · 10372d0d
      Igor Munkin authored
      * Revert "Update cur_L on exceptional path (arm)"
      * Revert "arm64: fix cur_L restoration on error throw"
      * Revert "Update cur_L on exceptional path"
      * Revert "Fix cur_L tracking on exceptional path"
      * Restore cur_L for specific Lua/C API use case.
      * Fix Clang build.
      
      Closes #6323
      Part of #9145
      
      NO_DOC=LuaJIT submodule bump
      NO_TEST=LuaJIT submodule bump
      10372d0d
    • Alexander Turenko's avatar
      config: support replicaset/group name templates · f059973d
      Alexander Turenko authored
      See the documentation request below for details about the feature.
      
      The template variables are substituted in three different places.
      
      * On deducing configuration of the current instance from the cluster
        configuration.
      * On calculation of URIs of replicaset peers to form
        `box.cfg({replication = <...>})` value.
      * On calculation of URIs of all cluster members for generation of
        `vshard.{router,storage}.cfg()` configuration.
      
      That's why we need a lot of testing code around this small feature.
      
      Part of #8862
      
      @TarantoolBot document
      Title: config: support {{ replicaset_name }} and {{ group_name }}
      
      The declarative configuration supports `{{ instance_name }}` template
      variable from the beginning.
      
      Now, two more ones were added: `{{ replicaset_name }}` and
      `{{ group_name }}`.
      
      All the template variables are set according to the
      instance/replicaset/group topology from the given configuration.
      
      Example:
      
      NO_WRAP
      ```yaml
      console:
        socket: '{{ group_name }}/{{ replicaset_name }}/{{ instance_name }}.admin'
      
      groups:
        g:
          replicasets:
            r:
              instances:
                i: {}
      ```
      NO_WRAP
      
      The admin console will be at `g/r/i.admin` for instance `i`.
      f059973d
    • Alexander Turenko's avatar
      main: fix typo in the help message · 8c9e099b
      Alexander Turenko authored
      Follows up commit d5c874e1 ("main: rewrite help message").
      
      Thanks to Mergen Imeev (@ImeevMA) for pointing it out!
      
      Part of #8862
      
      NO_DOC=The documentation request is present in d5c874e1.
      NO_CHANGELOG=same as NO_DOC
      8c9e099b
  5. Nov 02, 2023
    • Alexander Turenko's avatar
      main: rewrite help message · d5c874e1
      Alexander Turenko authored
      This commit aims several goals.
      
      First, we're going to recommend `tt` as a tool to run and manage
      tarantool instances. The tool is going to replace `tarantoolctl` and it
      seems valuable to sync recipes across different parts of the
      documentation (including this help message).
      
      Second, the action options and modifier options are separated now. At
      least one action option should be specified. I hope, it is more obvious
      from the help message now.
      
      Third, single line descriptions are replaced with a bit more extended
      ones to give a user basic context to understand an influence of an
      option.
      
      Updated the man page accordingly: synchronized the options, removed
      `tarantoolctl`.
      
      Part of #8862
      
      NO_TEST=the help message is not an API for a developer
      NO_CHANGELOG=nothing new here, just better wording here and there
      
      @TarantoolBot document
      Title: Update CLI options documentation
      
      https://www.tarantool.io/en/doc/latest/reference/configuration/#command-options
      seems to need an update. See the linked commit for details and updated
      `tarantool --help` message.
      d5c874e1
    • Astronomax's avatar
      test: cover box_wait_limbo_acked · 7fce5bec
      Astronomax authored
      Prior to this patch, there were many possible code execution options
      that were not covered by tests. After this commit, any assert(false)
      inside box_wait_limbo_acked cause a crash.
      
      Closes #7318
      
      NO_DOC=test
      NO_CHANGELOG=test
      7fce5bec
    • Georgiy Lebedev's avatar
      test: fix number to string conversion in tuple format map test · 2b3aff86
      Georgiy Lebedev authored
      Though the range of values of the number being converted to string in the
      tuple format map test never exceeds 10, GCC 12 issues warnings about the
      size of the buffer to which the string version of the number is written:
      
      NO_WRAP
      ```
      test/unit/tuple_format_map.c:256:53: error: ‘%zu’ directive output may be truncated writing between 1 and 19 bytes into a region of size 4 [-Werror=format-
      truncation=]
        256 |                 snprintf(name, lengthof(name), "test%zu", i);
            |                                                     ^~~
      test/unit/tuple_format_map.c:256:48: note: directive argument in the range [0, 9223372036854775807]
        256 |                 snprintf(name, lengthof(name), "test%zu", i);
            |                                                ^~~~~~~~~
      test/unit/tuple_format_map.c:256:17: note: ‘snprintf’ output between 6 and 24 bytes into a destination of size 8
        256 |                 snprintf(name, lengthof(name), "test%zu", i);
            |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      ```
      NO_WRAP
      
      Let's make GCC happy and increase all the buffer sizes to 32.
      
      NO_CHANGELOG=<build fix>
      NO_DOC=<build fix>
      NO_TEST=<build fix>
      2b3aff86
  6. Nov 01, 2023
  7. Oct 31, 2023
    • Vladimir Davydov's avatar
      lua: add helpers for encoding/decoding IPROTO packets · 22580990
      Vladimir Davydov authored
      Closes #8054
      
      @TarantoolBot document
      Title: Document Lua helpers for encoding/decoding IPROTO packets
      
      The following new constants and functions were added to the `box.iproto`
      namespace:
      
       - `GREETING_SIZE`: Size of a Tarantool greeting message
      
       - `GREETING_PROTOCOL_LEN_MAX`: Max length of a protocol string that can
         be encoded in a Tarantool greeting message.
      
       - `GREETING_SALT_LEN_MAX`: Max length of a salt string that can be
         encoded in a Tarantool greeting message.
      
       - `box.iproto.encode_greeting({version = x, uuid = x, salt = x})`:
         Encodes a Tarantool greeting message. Takes a table. Returns a
         string. Raises on error. The protocol is set to "Binary" (IPROTO).
      
       - `box.iproto.decode_greeting(string)`: Decodes a Tarantool greeting
         message. Takes a string. Returns a table with the following fields:
         `protocol`, `version`, `uuid`, `salt`. Raises on error. The input
         string must be exactly `GREETING_SIZE` bytes long.
      
       - `box.iproto.encode_packet(header[, body])`: Encodes an IPROTO packet.
         Takes a packet header and optionally a body given as a table or a
         string. A table argument will be encoded in MsgPack. A string
         argument will be copied as is (it's supposed to contain valid MsgPack
         but it isn't enforced). Returns a string. Raises on error.
      
       - `box.iproto.decode_packet(string[, pos])`: Decodes an IPROTO packet.
         Takes a string containing one or more encoded IPROTO packets and
         optionally a position in the string to start decoding from. If the
         position is omitted, the function will start decoding from the
         beginning of the string. On success returns the decoded packet
         header, body, and the position in the string where decoding stopped.
         Both header and body are returned as `msgpack.object`. The body may
         be absent (set to nil). If the input is truncated, returns nil and
         the min number of bytes required to decode the packet. On failure,
         raises an error.
      
      For examples, see [`test/app-luatest/iproto_encoder_test.lua`][1].
      
      [1]: https://github.com/tarantool/tarantool/blob/master/test/app-luatest/iproto_encoder_test.lua
      22580990
    • Mergen Imeev's avatar
      sql: second lookup for constraint names · a9d07e90
      Mergen Imeev authored
      This patch add second lookup for constraint name in the DROP CONSTRAINT
      statement.
      
      Part of #4467
      
      @TarantoolBot document
      Title: Second lookup for names in SQL
      
      Since all names are now case sensitive, a second lookup is now supported
      to maintain backward compatibility. A second lookup by name will be
      performed if the object was not found by name in the first lookup and if
      the name is not enclosed in double quotation marks. The name for the
      second lookup is normalized using old rules.
      a9d07e90
    • Mergen Imeev's avatar
      sql: second lookup for index names · 69fc9e0b
      Mergen Imeev authored
      This patch add second lookup for index name in the following cases:
      - index in INDEXED BY clause;
      - index in DROP INDEX statement;
      - index in PRAGMA statement.
      
      Part of #4467
      
      NO_DOC=will be added later
      NO_CHANGELOG=will be added later
      69fc9e0b
    • Mergen Imeev's avatar
      sql: second lookup for function names · ba5df3f2
      Mergen Imeev authored
      This patch adds second lookup for function names in expressions.
      
      Part of #4467
      
      NO_DOC=will be added later
      NO_CHANGELOG=will be added later
      ba5df3f2
    • Mergen Imeev's avatar
      sql: second lookup for column names · 44a055d7
      Mergen Imeev authored
      This patch add second lookup for column name in the following cases:
      - columns in tuple foreign key creation clause;
      - columns in field foreign key creation clause;
      - columns in primary key creation clause;
      - columns in unique constraint creation clause;
      - columns in expressions;
      - columns in UPDATE TABLE statement;
      - columns in INSERT INTO statement;
      - columns in CREATE INDEX statement;
      
      Also, second lookup for table name in expressions also now supported.
      
      Part of #4467
      
      NO_DOC=will be added later
      NO_CHANGELOG=will be added later
      44a055d7
    • Mergen Imeev's avatar
      sql: second lookup for space names · 66234c63
      Mergen Imeev authored
      This patch add second lookup for space name in the following cases:
      - foreign table in tuple foreign key creation clause;
      - foreign table in field foreign key creation clause;
      - table in DROP TABLE statement;
      - view in DROP VIEW statement;
      - table in SELECT FROM statement;
      - table in DELETE FROM statement;
      - table in TRUNCATE TABLE statement;
      - table in UPDATE TABLE statement;
      - table in INSERT INTO statement;
      - table in CREATE INDEX statement;
      - table in DROP INDEX statement;
      - table in PRAGMA statement;
      - table in SHOW CREATE TABLE statement;
      - table in CREATE TRIGGER statement;
      - table in ALTER TABLE statements;
      
      Table names in expressions will be supported in subsequent commits.
      
      Part of #4467
      
      NO_DOC=will be added later
      NO_CHANGELOG=will be added later
      66234c63
    • Mergen Imeev's avatar
      sql: second lookup for collation names · 2b164f62
      Mergen Imeev authored
      Part of #4467
      
      NO_DOC=will be added later
      NO_CHANGELOG=will be added later
      2b164f62
    • Mergen Imeev's avatar
      sql: second lookup for savepoint names · ca271f86
      Mergen Imeev authored
      This patch introduces a second lookup for the savepoint name in the
      "RELEASE savepoint_name" and "ROLLBACK TO savepoint_name" statements.
      
      Part of #4467
      
      NO_DOC=will be added later
      NO_CHANGELOG=will be added later
      ca271f86
    • Mergen Imeev's avatar
      sql: make SQL case-sensitive · aa68c46a
      Mergen Imeev authored
      This patch makes identifiers in SQL case sensitive. Prior to this patch,
      these identifiers were normalized unless they were enclosed in double
      quotes.
      
      Part of #4467
      
      NO_DOC=will be added later
      NO_CHANGELOG=will be added later
      aa68c46a
    • Mergen Imeev's avatar
      sql: introduce sql_coll_id_by_expr() · a6104077
      Mergen Imeev authored
      This patch introduces the sql_coll_id_by_expr() function. This function
      is used to search for a collation based on a given expression.
      
      Needed for #4467
      
      NO_DOC=refactoring
      NO_TEST=refactoring
      NO_CHANGELOG=refactoring
      a6104077
    • Mergen Imeev's avatar
      sql: introduce sql_coll_id_by_token() · cca8dfad
      Mergen Imeev authored
      This patch introduces the sql_coll_id_by_token() function. This function
      is used to search for a collation based on a given token.
      
      Needed for #4467
      
      NO_DOC=refactoring
      NO_TEST=refactoring
      NO_CHANGELOG=refactoring
      cca8dfad
    • Mergen Imeev's avatar
      sql: introduce sql_fieldno_by_item() · 0c4315f0
      Mergen Imeev authored
      This patch introduces the sql_fieldno_by_item() function. This function
      is used to search for a space field based on a given element of the
      struct ExprList.
      
      Needed for #4467
      
      NO_DOC=refactoring
      NO_TEST=refactoring
      NO_CHANGELOG=refactoring
      0c4315f0
    • Mergen Imeev's avatar
      sql: introduce sql_fieldno_by_expr() · 66e62448
      Mergen Imeev authored
      This patch introduces the sql_fieldno_by_expr() function. This function
      is used to search for a space field based on a given expression.
      
      Needed for #4467
      
      NO_DOC=refactoring
      NO_TEST=refactoring
      NO_CHANGELOG=refactoring
      66e62448
    • Mergen Imeev's avatar
      sql: introduce sql_fieldno_by_id() · 51c4cce3
      Mergen Imeev authored
      This patch introduces the sql_fieldno_by_id() function. This function is
      used to search for a space field based on a given element of the
      struct IdList.
      
      Needed for #4467
      
      NO_DOC=refactoring
      NO_TEST=refactoring
      NO_CHANGELOG=refactoring
      51c4cce3
    • Mergen Imeev's avatar
      sql: introduce sql_index_id_by_src() · a887a1f4
      Mergen Imeev authored
      This patch introduces the sql_index_id_by_src() function. This function
      is used to search for an index based on a given element of the
      struct SrcList.
      
      Needed for #4467
      
      NO_DOC=refactoring
      NO_TEST=refactoring
      NO_CHANGELOG=refactoring
      a887a1f4
    • Mergen Imeev's avatar
      sql: introduce sql_space_by_src() · 45ca4a3a
      Mergen Imeev authored
      This patch introduces the sql_space_by_src() function. This function is
      used to search for a space based on a given element of the
      struct SrcList. The main purpose of this function is to introduce a
      second lookup for spaces, so this function is not used where a second
      lookup is not required.
      
      Needed for #4467
      
      NO_DOC=refactoring
      NO_TEST=refactoring
      NO_CHANGELOG=refactoring
      45ca4a3a
    • Mergen Imeev's avatar
      sql: check space for SHOW CREATE TABLE · b3377ccf
      Mergen Imeev authored
      Before this patch, the existence of an space for a
      "SHOW CREATE TABLE table_name" statement was checked at runtime. This is
      quite inconvenient for #4467, so this will now be checked when creating
      the VDBE.
      
      Needed for #4467
      
      NO_DOC=no user-visible changes
      NO_TEST=no user-visible changes
      NO_CHANGELOG=no user-visible changes
      b3377ccf
    • Mergen Imeev's avatar
      sql: check index for DROP INDEX before runtime · fa0de2bf
      Mergen Imeev authored
      Before this patch, the existence of an index for a DROP INDEX statement
      was checked at runtime. This is quite inconvenient for #4467, so this
      will now be checked when creating the VDBE.
      
      Needed for #4467
      
      NO_DOC=no user-visible changes
      NO_TEST=no user-visible changes
      NO_CHANGELOG=no user-visible changes
      fa0de2bf
    • Mergen Imeev's avatar
      sql: refactor pragma.c · b44fc36f
      Mergen Imeev authored
      This patch refactors functions in pragma.c and fixes an issue with
      incorrectly ordered arguments in sql_pragma_index_info().
      
      NO_DOC=refactoring
      NO_TEST=refactoring
      NO_CHANGELOG=refactoring
      b44fc36f
    • Mergen Imeev's avatar
      sql: remove unused struct Expr flags · b88ce35e
      Mergen Imeev authored
      This patch removes the EP_InfixFunc, EP_DblQuoted and EP_Alias flags as
      they are not used.
      
      NO_DOC=refactoring
      NO_TEST=refactoring
      NO_CHANGELOG=refactoring
      b88ce35e
Loading