Skip to content
Snippets Groups Projects
  1. Oct 06, 2017
    • Vladimir Davydov's avatar
      box: schema: fix typo in object_name() · b76199ad
      Vladimir Davydov authored
      The typo caused the following box.schema.user.info() failure if the user
      was granted a permission to use a sequence:
      
        tarantool> box.schema.user.info()
        ---
        - error: 'builtin/box/schema.lua:1542: assign to undeclared variable ''seq'''
        ---
      b76199ad
    • Vladimir Davydov's avatar
      Turn class Handler into struct space_vtab · 9a880ae6
      Vladimir Davydov authored
      Class Handler contains only function pointers so we can easily convert
      it to a C struct. This is needed to introduce internal C API to perfrom
      DML requests on spaces which is required by SQL.
      
      Needed for #2776
      9a880ae6
    • Vladimir Davydov's avatar
      Store engine data in struct space instead of Handler · e5a14c83
      Vladimir Davydov authored
       - Engines should inherit struct space if they need to store engine
         specific data per space.
       - Engine::createSpace() now returns struct space instead of Handler.
       - Engines should overwrite Handler::destroy() to implement struct space
         destructor.
      
      This is a step towards converting class Handler to struct space_vtab.
      
      Needed for #2776
      e5a14c83
    • Vladimir Davydov's avatar
      Store tuple format in struct space · 790798dc
      Vladimir Davydov authored
      Currently, the format is stored in Handler and can be retrieved with
      Handler::format(). The only reason for such a layer of indirection is
      that the format should be created by an Engine method and currently it
      is created by Engine::createSpace(). Let's introduce a separate method
      for create a space format, Engine::createFormat(), and move the format
      back to where it belongs, i.e. to struct space.
      
      This is a step towards converting class Handler to struct space_vtab.
      
      Needed for #2776
      790798dc
    • Vladimir Davydov's avatar
      memtx: fold MemtxSpace::prepare* methods · e4c32d19
      Vladimir Davydov authored
      We gain no benefit from having them separated from corresponding
      MemtxSpace::execute* methods.
      
      This is a step towards converting class Handler to struct space_vtab.
      
      Needed for #2776
      e4c32d19
    • Vladimir Davydov's avatar
      Move Handler->engine to struct space · 29ed9210
      Vladimir Davydov authored
      space->handler->engine->... looks ugly. Since all Handler methods
      receive space as an argument anyway, let's move engine to struct space.
      
      This is a step towards converting class Handler to struct space_vtab.
      
      Needed for #2776
      29ed9210
    • Alexandr Lyapunov's avatar
      Use of collation comparison in indexes · e260c2e3
      Alexandr Lyapunov authored
      Make new option in index part - collation - where user can pass
      a name of a collation that he wants to use for comparison of the
      field.
      
      Fix #2649
      e260c2e3
    • Alexandr Lyapunov's avatar
      Introduce collation space and collation cache · 45091c1f
      Alexandr Lyapunov authored
      Add a new space that contains collation definitions for future
      index collation and more.
      
      Add a collation cache for fast retrieving a collation object by
      its name.
      
      Needed for #2649
      45091c1f
    • Alexandr Lyapunov's avatar
      Introduce collation infrastructure · ae1c8459
      Alexandr Lyapunov authored
      Introduce coll object that allows to compare strings.
      Add coll_def structure and functions for its setup.
      Add unit test.
      
      Needed for #2649
      ae1c8459
    • Alexandr Lyapunov's avatar
      Add ICU library · cb0fa6ad
      Alexandr Lyapunov authored
      cb0fa6ad
  2. Oct 05, 2017
  3. Oct 04, 2017
  4. Oct 03, 2017
    • Vladislav Shpilevoy's avatar
      vinyl: introduce a function to validate vy_index formats · 69da8060
      Vladislav Shpilevoy authored
      vy_index_validate_formats() check consistency of vy_index formats.
      For example, all formats must have the same value of index_field_count
      and mem_format must be equal to disk_format for the primary index.
      
      Update disk_format for the primary key in the case when ALTER adds
      a new space:format() field.
      69da8060
  5. Oct 02, 2017
    • Vladislav Shpilevoy's avatar
      Refactor field_def · dcc5963a
      Vladislav Shpilevoy authored
      Extract struct tuple_field from field_def. Store field_def in space_def
      and tuple_field in tuple_format.
      It allows to do not store field names in tuple_format and do not
      store binary offsets and internal flags in field definition
      (specified by an user).
      dcc5963a
    • Vladislav Shpilevoy's avatar
      vinyl: reference iterator keys · be8ee29a
      Vladislav Shpilevoy authored
      Make all iterators keys not const and reference them. Actually
      they were not const before, because they had been casted to
      (struct tuple *) explicitly by vy_tx_track().
      
      Also it is needed for #1557, where iterators must be able to store
      key, not stored in a read iterator.
      be8ee29a
    • Vladislav Shpilevoy's avatar
      tuple: optimize mp_compare_integer · 9e273a99
      Vladislav Shpilevoy authored
      Mp_compare_integer can be called from mp_compare_number. Both of
      them calls mp_typeof() for their arguments. But mp_typeof() makes
      lookup in a big table in msgpuck.h. Lets pass already decoded types
      from mp_compare_number to mp_compare_integer.
      
      Introduce similar functions with hint for other comparators.
      9e273a99
  6. Sep 30, 2017
  7. Sep 28, 2017
    • Vladislav Shpilevoy's avatar
      vinyl: do not check types of not indexed surrogate fields · 223c6265
      Vladislav Shpilevoy authored
      Vinyl surrogate tuple can be constructed using a key and filling
      not indexed fields with NULL values. But not indexed field can be
      formatted using space:format. Such fields can not store NULLs and
      tuple_init_field_map raises an error on it.
      
      But vinyl actually does not use not indexed fields in surrogate
      tuples so we can store NULLs in surrogate not indexed formatted
      fields.
      
      Besides, we can not use field->type != FIELD_TYPE_ANY as a flag
      that a field is not indexed and is not formatted. Now ANY field
      type is available for users. To check if a field can be nullified
      in a surrogate tuple we must use key_def.
      
      The same problem is actual for construction a surrogate tuple from
      a normal tuple - we can not anymore use type != FIELD_TYPE_ANY to
      define a field is not indexed. Moreover in such a case we also can
      skip fields not used by an index and placed after the last field
      used by an index.
      For this optimization introduce tuple_format.index_field_count and
      field_def.is_key_part.
      
      Closes #2784
      223c6265
  8. Sep 26, 2017
    • Vladimir Davydov's avatar
      box: implement auto increment · d121e7c4
      Vladimir Davydov authored
      The value returned by space.auto_increment() is not guaranteed to be
      monotonically growing, because this method uses max+1 for the next
      generated value, which can be less than a value generated before in case
      the max key is deleted. Besides, calling max() may be expensive, e.g. it
      requires a disk access in case of Vinyl. So this patch implements auto
      increment based on persistent sequences.
      
      To be used for auto increment, a sequence needs to be attached to a
      space. To attach an existing sequence to a space, pass 'sequence=ID' in
      index options when creating or modifying the primary key. Here ID is the
      name or the numeric identifier of the sequence to attach. Note,
      sequences can be attached only to spaces with integer primary key.
      After a sequence is attached, it will be used for auto increment when
      the user passes 'nil' for the primary key value. If the user passes a
      value different from 'nil', the value will be used to update the
      attached sequence.
      
      To detach a sequence from the space it was attached to, either drop the
      primary key of the space or alter the primary key with 'sequence=false'.
      
      It is not necessary to pre-create a sequence to use it for auto
      increment - a sequence can be automatically generated. To generate a
      sequence automatically, pass 'sequence=true' in index options.
      Automatically generated sequences are named '_auto_ID', where ID is the
      space id, and removed when the space is dropped or the sequence is
      detached.
      
      A sequence cannot be dropped as long as it is attached to any spaces.
      
      Closes #389
      d121e7c4
    • Konstantin Osipov's avatar
      sequence: speed up allocation of sequence data tuple during checkpoint · c0a30d17
      Konstantin Osipov authored
      No need to allocate a tuple buffer for every sequence value.
      c0a30d17
Loading