Skip to content
Snippets Groups Projects
  1. Aug 19, 2021
  2. Aug 18, 2021
    • Egor Elchinov's avatar
      txm: rebind read trackers of rollbacked txns · 6c990a7b
      Egor Elchinov authored
      RW transactions used to commit without problems after rollback
      of transactions holding stories responsible to track their reads.
      That behaviour led to unserializable results.
      This patch fixes this problem.
      
      Closes #6325
      6c990a7b
    • mechanik20051988's avatar
      lua: fix several possibility crashes in lua triggers implementation. · f2f91129
      mechanik20051988 authored
      There are two cases in lua trigger implementation, which leads
      to access to freed memory: if trigger removes itself and if
      trigger yields and someone destroy it. These problems was fixed
      by remembering the necessary fields from the trigger structure
      in local variables before calling trigger function.
      
      Closes #6266
      f2f91129
    • Mergen Imeev's avatar
      sql: fix comparison with SCALAR value · bd320d3d
      Mergen Imeev authored
      After this patch, SCALAR values will be able to be compared with values
      of any other scalar type. The comparison will be done according to the
      SCALAR rules, which means boolean values < numeric values < string
      values < binary values < uuid values.
      
      Closes #6221
      
      @TarantoolBot document
      Title: SCALAR and NUMBER values in SQL
      
      SCALAR values can now be compared with values of any other scalar type,
      but cannot be implicitly cast to any other scalar type. This means that
      SCALAR values cannot participate in arithmetic, bitwise operations,
      concatenation, or functions that, by definition, do not accept SCALAR
      values.
      
      NUMBER values now also cannot be implicitly cast to any other numeric
      type, which means that NUMBER values cannot participate in arithmetic
      and bitwise operations, or in functions that, by definition, do not
      accept NUMBER values.
      bd320d3d
    • Mergen Imeev's avatar
      sql: disallow concatination for SCALAR · bb5183fe
      Mergen Imeev authored
      Part of #6221
      bb5183fe
    • Mergen Imeev's avatar
      sql: disallow bitwise for NUMBER and SCALAR · 6458b475
      Mergen Imeev authored
      Part of #6221
      6458b475
    • Mergen Imeev's avatar
      sql: disallow arithmetic for NUMBER and SCALAR · 16a61457
      Mergen Imeev authored
      This patch disallows arithmetic operations for SCALAR and NUMBER values.
      It also corrects the description of the error that is generated when an
      inappropriate value participates in an arithmetic operation.
      
      Part of #6221
      16a61457
    • Mergen Imeev's avatar
      sql: disallow implicit cast from NUMBER and SCALAR · 2d8f10fc
      Mergen Imeev authored
      This patch disallows implicit cast during INSERT and UPDATE from SCALAR
      to any other scalar types and from NUMBER to any other numeric types.
      
      Part of #6221
      2d8f10fc
    • Mergen Imeev's avatar
      sql: re-introduce NUMBER and SCALAR meta-types · 666cbe5d
      Mergen Imeev authored
      This patch re-introduces the NUMBER and SCALAR meta-types. They were
      introduced some time ago, however there were some problems with how they
      worked and some properties of these meta-types were not implemented.
      
      New properties of meta-type SCALAR in SQL:
      1) typeof() with SCALAR argument returns "scalar";
      2) Any value of any scalar type can be implicitly cast to SCALAR;
      3) SCALAR values can be compared with any value of any other scalar
         type;
      4) SCALAR values cannot be implicitly cast to any other scalar type;
      5) SCALAR values cannot participate in arithmetic or bitwise
         operations;
      6) SCALAR values cannot be concatenated with other values.
      
      New properties of meta-type NUMBER in SQL:
      1) typeof() with NUMBER argument returns "number";
      2) Any value of a numeric type can be implicitly cast to NUMBER;
      3) NUMBER values can be implicitly cast to SCALAR;
      4) NUMBER cannot be implicitly cast to any other numeric type;
      5) NUMBER values cannot participate in arithmetic or bitwise
         operations;
      
      This patch only applies 1) and 2) for both meta-types. All other
      properties will be presented in the next patches.
      
      Part of #6221
      666cbe5d
    • Mergen Imeev's avatar
      sql: remove enum field_type from struct Mem · 35e36b92
      Mergen Imeev authored
      This patch removes the enum field_type from the struct MEM since the
      only place where this field was used is in the typeof() function. After
      this patch, typeof() will return "NULL" if it receives NULL. Prior to
      this patch, the field type was returned if it was set, otherwise it was
      returned "boolean". Another reason for the removal was that field_type
      was quite volatile and could change in unexpected places.
      
      Also, this patch made another change: values of the field type NUMBER
      will now be processed by the typeof() as INTEGER or DOUBLE, depending
      on the storage type. However, this will be fixed in the next patch.
      
      Part of #5956
      Needed for #6221
      35e36b92
    • Mergen Imeev's avatar
      sql: define ephemeral space fields · d61f39a0
      Mergen Imeev authored
      Prior to this patch, most ephemeral space fields were defined using the
      SCALAR type. After this patch, almost all fields will be properly
      defined. However, there are still cases where SCALAR will be set by
      default. For example, in IN, where rules is still not defined (#4692).
      Another example is when a field is not resolved because of a too complex
      query.
      
      Part of #6213
      d61f39a0
    • Mergen Imeev's avatar
      sql: rename some sql_ephemeral_space_* functions · 6c181b60
      Mergen Imeev authored
      This patch renames sql_ephemeral_space_new() to sql_template_space_new()
      and sql_ephemeral_space_def_new() to sql_template_space_def_new(). The
      objects created by these functions are not really ephemeral space or
      space_def and have a single purpose - to create a "template" space that
      will be used later when creating real space.
      
      Needed for #6213
      6c181b60
    • Yaroslav Dynnikov's avatar
      lua: return back table.new() method · 8272a6c7
      Yaroslav Dynnikov authored
      Import of `table.new` module was removed as a part of net.box
      refactoring in commit 954194a1.
      The `table.new` method became unavailable in Tarantool.
      
      This commit returns it back and adds a corresponding regression test.
      
      Closes #6330
      8272a6c7
    • Aleksandr Lyapunov's avatar
      test: fix a typo in test · 09474a94
      Aleksandr Lyapunov authored
      Fix option argument in user.grant function
      09474a94
    • Nikita Pettik's avatar
      txm: abort only alive transactions on DDL preparation · 39f0c31f
      Nikita Pettik authored
      It makes sense to abort only in-progress transactions while we are going
      to abort all transactions on DDL TX preparation step. Already prepared,
      committed or aborted transactions turn out to be uninteresting for us.
      
      Follow-up #5998
      39f0c31f
    • Mons Anderson's avatar
      luarocks: Set FORCE_CONFIG=false in hardcoded config · 5bbe88cd
      Mons Anderson authored
      FORCE_CONFIG=true is preventing local .rocks/config-5.1.lua from loading.
      Local config is often used to populate rocks_servers with own rocks servers and with original luarocks
      
      This patch changes FORCE_CONFIG to true in generated luarocks.core.hardcoded to allow using
      project-side config-5.1.lua for luarocks configuration to avoid dirty and ugly hacks
      5bbe88cd
    • Egor Elchinov's avatar
      test: fix test for fiber.top under arm · 366ab263
      Egor Elchinov authored
      fiber.top testing used to be broken under arm platforms because of the
      assumption that fiber.top functionality must be enabled at build time.
      This patch modifies the test for this case.
      
      Follow-up #6272
      366ab263
    • Egor Elchinov's avatar
      build: disable backtraces on arm · 94925b53
      Egor Elchinov authored
      MacOS has its own libunwind which works not good with fibers
      under M1. Backtraces need to be enabled again after #6060 is fixed.
      Other arm backtraces are temporarily disabled too for #6222.
      
      Closes #6272
      94925b53
    • EvgenyMekhanik's avatar
      test: disable checking the complete requests processing. · 7eac5d20
      EvgenyMekhanik authored
      Currently, when calling 'close' method for connection,
      unsent requests are lost. Disable appropriate check until
      corresponding (#6338) issue will be resolved.
      7eac5d20
    • mechanik20051988's avatar
      memtx: implement unified interface for getting allocator statistics · 8f97c051
      mechanik20051988 authored
      Since tarantool can use different allocators, we need a single
      interface for getting statistics that is suitable for all allocators.
      Follow-up #5419
      8f97c051
    • mechanik20051988's avatar
      tests: add ability to run box/engine tests with different allocators · dcf6fdb3
      mechanik20051988 authored
      The ability to select an allocator for memtx has been added to
      tarantool. To test a new type of allocator, all tests must also
      be run with it. Implemented new option, which allows to set allocator
      for memtx. If you wan't to choose allocator type for tests, run test-run.py
      with --memtx-allocator="small" or --memtx-allocator="system". Allocator type
      is passed via MEMTX_ALLOCATOR environment variable to the test.
      dcf6fdb3
    • Nikita Pettik's avatar
      memtx: provide correct stats calculation for allocators · 279ca6fb
      Nikita Pettik authored
      Firstly, Allocator::stats() must accept callback function and its
      argument to fulfill small interfaces.
      Secondly, unify stats and store both system and small allocators
      statistics in the same structure in order to use ::stats() method in
      foreach_allocator() helper.
      
      Follow-up #5419
      279ca6fb
    • Nikita Pettik's avatar
      memtx: use MemtxAllocator in memtx engine · 6552cfab
      Nikita Pettik authored
      - Remove two delayed free lists from memtx_engine;
      - Use memtx_allocators_init/memtx_allocators_destroy to initialize and
        destroy memtx allocators;
      - Use memtx_allocators_set_mode() to set delayed free mode.
      
      Follow-up #5419
      6552cfab
    • Nikita Pettik's avatar
      memtx: introduce interfaces for MemtxAllocator · f9f7ff66
      Nikita Pettik authored
      That includes:
       - foreach_memtx_allocator() - for each basic allocator (Small and Sys
         so far) we declare corresponding MemtxAllocator. So to iterate over
         all allocators and invoke same function we are going to use this
         helper;
       - memtx_allocators_init() - invoke ::create() of each Allocator and
         corresponding MemtxAllocator;
       - memtx_allocators_destroy() - invoke ::destroy() of each Allocator
         and corresponding MemtxAllocator;
       - memtx_allocators_set_mode() - set given delayed free mode for each
         MemtxAllocator.
      
      Follow-up #5419
      f9f7ff66
    • Nikita Pettik's avatar
      memtx: introduce MemtxAllocator template class · ce2dcad5
      Nikita Pettik authored
      It is considered to be wrapper (MemtxAllocator is parameterized by
      ordinary allocator like Small or System) encapsulating allocator and
      providing its own delayed deletion strategy.
      
      Follow-up #5419
      ce2dcad5
    • Nikita Pettik's avatar
      memtx: introduce memtx_set_tuple_format_vtab() · 7417aed7
      Nikita Pettik authored
      This is helper to set proper tuple_format vtable depending on allocator
      symbolic name.
      
      Follow-up #5419
      7417aed7
    • Nikita Pettik's avatar
      memtx: move initialization of Small and Sys allocators to source file · 7104a533
      Nikita Pettik authored
      Let's initialize them in the dedicated allocator.cc source file
      
      Follow-up #5419
      7104a533
    • Nikita Pettik's avatar
      memtx: introduce foreach_allocator template walker · 446236e1
      Nikita Pettik authored
      It is supposed to generalize workflow with allocators so that apply the
      same function (like create()/destroy() etc) for each existing allocator.
      Newborn functions are not used yet since we are going to add more
      wrappers.
      
      Warning: dark template magic is involved, do not try what you're about
      to see at home.
      
      Follow-up #5419
      446236e1
Loading