Skip to content
Snippets Groups Projects
  1. Jul 28, 2017
    • Vladislav Shpilevoy's avatar
      sql: make sql_request decode similar to auth/call/dml_request · 1d82035a
      Vladislav Shpilevoy authored
      In the newest 1.7 the call/auth/dml_request decode the data
      directly from a struct xrow_header instead of MessagePack data.
      Make the same for sql_request.
      1d82035a
    • Vladislav Shpilevoy's avatar
      sql: use region_alloc/join for temporary sql iproto tuples · e5647fed
      Vladislav Shpilevoy authored
      obuf_alloc can not be used as a temporary buffer per sql row column,
      because each column can be allocated in different slabs. It makes
      impossible to allocate a port tuple from several intervals:
      [col1_begin, col1_end], [col2_begin, col2_end], ...
      
      Region has region_join method, which can realloc memory blocks from
      different slabs in monolite memory area - [begin, end].
      It allows to use tuple_alloc for port tuples.
      
      Closes #2602
      e5647fed
    • Vladislav Shpilevoy's avatar
      sql: fix sql_prepare_and_execute broken yield · 6740a6d1
      Vladislav Shpilevoy authored
      Closes #2601
      6740a6d1
    • Vladislav Shpilevoy's avatar
      Merge 1.7 into 1.8 · 2ada658e
      Vladislav Shpilevoy authored
      2ada658e
    • Vladislav Shpilevoy's avatar
      sql: account DDL changes as 0 or 1 · d25bb4ab
      Vladislav Shpilevoy authored
      The original SQLite doesn't account DDL changes at all. Such changes
      simply do not update the sqlite3_changes() return value. But iproto
      clients want to know a result of DDL operation, particularly for
      IF [NOT] EXISTS DDL operations.
      
      We cannot return real count of affected tuples, because it depends on
      the tarantool version. For example, now DROP TABLE deletes tuples from
      _space, _index, _truncate and _trigger. But in the future this set of
      system spaces can be changed.
      
      With considering the above remark, lets return always for all DDL
      operations either 0, if nothing happened, or 1, if something was
      created, deleted or modified.
      
      Closes #2617
      d25bb4ab
  2. Jul 25, 2017
    • Kirill Yukhin's avatar
      sql: Reformat box/sql/insert.c · 19a1c888
      Kirill Yukhin authored
      Reformatted according to Tarantool's coding style.
      
      Part of #2628
      19a1c888
    • Bulat Niatshin's avatar
      sql: test/unit/sql-bitvec - update and fix *.result · 3ef0bbfb
      Bulat Niatshin authored
      * test/unit/sql-bitvec.test.c - rename to test/unit/sql-bitvec.c
      * sql-bitvec.c - update from gh-2590-bitvec-test-convert
      * sql-bitvec.result - update from gh-2590-bitvec-test-convert
      
      Closes #2590
      3ef0bbfb
    • Kirill Yukhin's avatar
      sql: Support per-statement transactions · 2bc2286f
      Kirill Yukhin authored
      Introduce dedicated opcode OP_TTRansaction, which is
      responsible for initiation of Tarantool transaction.
      This opcode is only emitted if statement is generated
      directly by parser. That means that changes like insertions
      into system tables are not covered by Tarantool's transations.
      
      Tarantool's transaction is committed or rolled back during
      exectuin of `Halt` opcode. `CloseAllCursors` function was
      splitted into two: in order Tarantool's WAL to work need to
      preserve allocated memory until commit to WAL. Call this
      deallocation after Tarantool's commit.
      In future this will be re-worked since transaction can be
      either in statement or generic, and not all Halts should commit.
      
      Also, fix a bug: memory area passed to WAL were re-used. WAL itself
      doesn't do memcpy, so this state of affairs was lead to unpredictable
      errors during save/restore. Use region_alloc to reserve memory area
      for WAL in tarantoolSqlite3Insert and tarantoolSqlite3Delete.
      
      Closes #2599
      2bc2286f
  3. Jul 21, 2017
  4. Jul 20, 2017
  5. Jul 19, 2017
    • Vladimir Davydov's avatar
      vinyl: use LSN from WAL instead of index_opts->lsn in vylog · 26af611f
      Vladimir Davydov authored
      An index can be dropped and then recreated with the same space/index id.
      To discriminate between different incarnations of the same index during
      recovery, we use index LSN stored in index options, as it is supposed to
      be unique. However, the uniqueness property doesn't always hold:
      
       - If two indexes are created from different fibers, they might receive
         the same LSN.
      
       - If an index is created by inserting a record into _index system space
         directly, without using the public API, as it is the case in case of
         logical backup, its LSN might conflict with the LSN of an existing
         index or a previous incarnation of the same index stored in vylog.
      
      These exceptions can result in unrecoverable errors during local
      recovery, like this one:
      
        F> can't initialize storage: Invalid VYLOG file: Duplicate index id 3
      
      Besides, storing LSN in index options is ugly, because LSN isn't a
      user-defined option - it's a part of the implementation.
      
      To fix this issues, let's use the LSN passed to Index::commitCreate,
      i.e. the actual LSN received by the row that created the index. There's
      one problem though: snapshot rows don't store LSNs. However, it doesn't
      mean we can't find the index in vylog corresponding to a snapshot row:
      we just need to look up the index by space_id/index_id instead of LSN
      and then compare the snapshot LSN with the LSN of the last index
      incarnation stored in vylog - if the latter turns out to be less, then
      we need to load the index, otherwise the index is going to be dropped
      and we need to load a dummy index. For more details, see the comment to
      vy_recovery_load_index().
      
      Another issue that needs a clarification is backward compatibility. The
      thing is the LSN written to the index options lags behind the actual LSN
      assigned to the row that created the index by 1. So to preserve backward
      compatibility, we use LSN from index options for legacy indexes that
      have it, while for indexes created after this patch we don't store LSN
      in index options (set it to 0), neither do we use it on recovery (use
      row LSN instead).
      
      Closes #2536
      26af611f
    • Vladimir Davydov's avatar
      box: generate LSNs for rows received during initial join · 7d67ec8a
      Vladimir Davydov authored
      Currently, 0 is passed to Index::commitCreate as index LSN during
      initial join. To stop using index_opts->lsn for identifying indexes in
      Vinyl, we need a unique LSN. So let's install a dummy journal to assign
      fake unique LSNs for rows received on initial join.
      
      Needed for #2536
      7d67ec8a
    • Vladimir Davydov's avatar
      box: propagate LSN to Index:commitCreate · fd99d3ab
      Vladimir Davydov authored
      So that we could use it instead of index_opts::lsn.
      
      On initial recovery pass the snapshot LSN instead as we don't store LSNs
      in memtx snapshot.
      
      Needed for #2536
      fd99d3ab
    • Vladislav Shpilevoy's avatar
      test: fix fluky sql iproto test · af05c091
      Vladislav Shpilevoy authored
      Reload schema after DDL SQL operations.
      af05c091
    • Vladislav Shpilevoy's avatar
    • Vladislav Shpilevoy's avatar
    • Vladislav Shpilevoy's avatar
      iproto: remove IprotoMsgGuard · 699b14e9
      Vladislav Shpilevoy authored
      699b14e9
    • Vladislav Shpilevoy's avatar
      2ab97c01
    • Vladislav Shpilevoy's avatar
      tuple: introduce tuple_arena_create · a2db8f1d
      Vladislav Shpilevoy authored
      Implement tuple_arena_create method to initialize tuple arena and
      quota. This method further will be used to initialize both
      memtx and vinyl arenas.
      
      Write a test showing the limit of vinyl statements size.
      
      Part of #2569
      a2db8f1d
    • Alexandr Lyapunov's avatar
    • Alexandr Lyapunov's avatar
      Fix memleak in iproto port, clean and optimize the code · bd04983a
      Alexandr Lyapunov authored
      Now if an error happens during the first tuple push from port to
      obuf, the port is not actually destroyed - only the first tuple is
      unreferenced.
      
      I believe that port dump must not free any data at all, then once
      a user creates a port he must take the ownership and destroy it in
      the end of usage. That would simplify the user code, especially C++.
      
      Simplify port_dump function and destroy a port in the code that
      creates the port.
      bd04983a
  6. Jul 18, 2017
  7. Jul 17, 2017
Loading