Skip to content
Snippets Groups Projects
  1. Nov 02, 2018
  2. Nov 01, 2018
    • Nikita Pettik's avatar
      sql: make DROP TABLE delete entry from _sequence_data · 0cccd5bd
      Nikita Pettik authored
      Before this patch, _sequence_data system space wasn't taken into
      consideration when space was dropped. However, entries in this space
      may appear after recovery. For example:
      
      CREATE TABLE t (id INT PRIMARY KEY AUTOINCREMENT);
      INSERT INTO t VALUES (NULL);
      box.snapshot()
      os.exit()
      ...
      box.cfg{}
      DROP TABLE t;
      
      Last DROP statement didn't generate VDBE code to delete entry from
      _sequence_data, but it had to do so. This patch simply modifies code
      generation to remove entry from _sequence_data space before space is
      dropped.
      
      Closes #3712
      0cccd5bd
    • Nikita Pettik's avatar
      sql: remove nKey from struct BtCursor · aab97195
      Nikita Pettik authored
      nKey member (indicating number of parts in key) now is used only for
      COUNT routine. On the other hand, it is always equal to 0 (as well as
      key is really NULL), since functions which are relied on this argument
      (tarantoolSqlite3Count and tarantoolSqlite3EphemeralCount) are called to
      perform OP_Count opcode. In its turn, OP_Count is emitted only for
      queries like <SELECT COUNT(*) FROM tab>, i.e. simple queries without
      filter conditions. Hence, nothing prevents us from removing this field
      at all.
      aab97195
    • Mergen Imeev's avatar
      sql: assertion in autoincrement column · fc16a650
      Mergen Imeev authored
      If query is like "INSERT INTO table SELECT ..." then it is
      completely fine that the result of SELECT isn't integer. These
      values wouldn’t be checked properly if it was inserted in
      column with autoincrement. This patch fixes mentioned check.
      
      Closes #3670
      fc16a650
    • Mergen Imeev's avatar
      sql: clean-up on failed CREATE TABLE · 77d73e72
      Mergen Imeev authored
      In case statement "CREATE TABLE ..." fails it can left some
      records in system spaces that shouldn't be there. These records
      won't be left behind after this patch.
      
      @TarantoolBot document
      Title: Clean up after failure of CREATE TABLE
      Usually CREATE TABLE creates no less than two objects which are
      space and index. If creation of index (or any object after space)
      failed, created space (and other created objects) won't be deleted
      though operation failed. Now these objects will be deleted
      properly.
      
      Closes #3592
      77d73e72
    • Serge Petrenko's avatar
      Introduce a function to reencode scramble · bc43ffb0
      Serge Petrenko authored
      Introduce a new function, scramble_reencode(), which allows one cluster
      instance to reencode a scramble received from  a client using the salt
      from another cluster instance. This is needed for proxy to mimic client
      connections when connecting to remote instances.
      
      Needed for #2625
      bc43ffb0
  3. Oct 30, 2018
    • Serge Petrenko's avatar
      box: autogrant CREATE,ALTER,DROP to users with READ+WRITE · 269e36d8
      Serge Petrenko authored
      This patch adds an upgrade script to grant CREATE, ALTER, DROP
      privileges to users which have READ+WRITE on respective objects.
      This is needed after removing 1.7 compatibility mode for privileges.
      
      Closes #3539
      269e36d8
    • Serge Petrenko's avatar
      box: remove compatibility mode for privileges · 3e7d3070
      Serge Petrenko authored
      Before version 1.7.7 there were no CREATE or ALTER privileges.
      READ+WRITE permitted object creation and altering.
      In 1.10 CREATE and ALTER privileges were introduced together with a
      compatibility mode in access_check_ddl() which assumed user had CREATE
      and ALTER if it had READ and WRITE on a respective object.
      Now its time for us to remove this compatibility mode.
      
      Part of #3539
      3e7d3070
  4. Oct 26, 2018
    • Kirill Yukhin's avatar
      sql: check read access while executing SQL query · e5834e43
      Kirill Yukhin authored
      Since SQL front-end is not using box API,
      no checkes for read access are performed by VDBE engine.
      Add check to IteratorOpen op-code to make sure that read
      privilege exists for given space.
      Note, that there's is no need to perform DML/DDL checkes as
      they're performed by Tarantool's core.
      
      @TarantoolBot document
      Title: Document behaviour of SQL in presence of
      read access restrictions. Need to clarify, that
      if there's no read access to the space, then not
      only SELECT statements will fail, but also those DML
      which implies reading from spaces indirectly, e.g.:
        UPDATE t1 SET a=2 WHERE b=3;
      
      Closes #2362
      e5834e43
    • Kirill Yukhin's avatar
      sql: use space_by_name in SQL · 5b7cc294
      Kirill Yukhin authored
      Since hash, which maps space name to space pointer was introduced in
      previous patch, use it in SQL front-end as it is heavily needed.
      
      @locker: removed a couple of useless assertions and variable renames
      5b7cc294
    • Kirill Yukhin's avatar
      schema: add space name cache · 030d28f5
      Kirill Yukhin authored
      Since SQL is heavily using name -> space mapping, introduce (instead of
      scanning _space space) dedicated cache, which maps space name to space
      pointer.
      
      @locker: code cleanup
      030d28f5
    • Vladimir Davydov's avatar
      alter: install space commit/rollback triggers before preparing sql view · d792fd26
      Vladimir Davydov authored
      sql_compile_view() may fail, in which case the space will never be
      deleted from (in case of space creation) or inserted back into (in case
      of space drop) the space cache, because commit/rollback triggers, which
      are supposed to do the job, are only installed after preparing a view.
      Fix this by installing triggers before sql_compile_view().
      
      No need to write a test as without this commit sql/view test will
      crash after applying the next commit (the one that introduces space
      name cache).
      
      Fixes commit dc358cb0 ("sql: rework VIEW internals").
      d792fd26
    • Vladimir Davydov's avatar
      Merge branch '1.10-features' into 2.1 · 9975ed06
      Vladimir Davydov authored
      9975ed06
    • Vladimir Davydov's avatar
      Merge branch '1.10' into 1.10-features · 9dcc7849
      Vladimir Davydov authored
      9dcc7849
    • Georgy Kirichenko's avatar
      lua: fix tuple cdata collecting · 022a3c50
      Georgy Kirichenko authored
      In some cases luajit does not collect cdata objects which were
      transformed with ffi.cast as tuple_bless does. In consequence, internal
      table with gc callback overflows and then lua crashes. There might be an
      internal luajit issue because it fires only for jitted code. But assigning
      a gc callback before transformation fixes the problem.
      
      Closes #3751
      022a3c50
    • Vladimir Davydov's avatar
      vinyl: do not account bloom filters to runtime quota · e4338cc5
      Vladimir Davydov authored
      Back when bloom filters were introduced, neither box.info.memory() nor
      box.stat.vinyl().memory didn't exist so bloom filters were accounted to
      box.runtime.info().used for lack of a better place. Now, there's no
      point to account them there. In fact, it's confusing, because bloom
      filters are allocated with malloc(), not from the runtime arena, so
      let's drop it.
      e4338cc5
    • Vladimir Davydov's avatar
      vinyl: fix memory leak in slice stream · 0066457c
      Vladimir Davydov authored
      If a tuple read from a run by a slice stream happens to be out of the
      slice bounds, it will never be freed. Fix it.
      
      The leak was introduced by commit c174c985 ("vinyl: implement new
      simple write iterator").
      0066457c
    • AKhatskevich's avatar
      sql: fix fk set null clause · 9c6c4483
      AKhatskevich authored
      After changing behavior of the `IS` operator (#b3a3ddb5),
      `SET NULL` was rewritten to use `EQ` instead. Which doesn't respect
      NULLs.
      
      This commit fixes the null related behavior by emitting logical
      constructions equivalent for this case to old `IS`.
      The new expression works differently than old `IS` for nulls, however
      the difference doesn't change anything, because matched rows are then
      searched in a child table with `EQ` expression which do not match nulls.
      Before:
      `oldval` old_is `newval`
      Now:
      `oldval` is_null or (`newval` is_not_null and `oldval` eq `newval`)
      
      Closes #3645
      9c6c4483
  5. Oct 25, 2018
  6. Oct 24, 2018
Loading