Skip to content
Snippets Groups Projects
  1. Aug 22, 2019
    • Alexander Turenko's avatar
      gitlab-ci: fix building of Debian Buster image · 882068ee
      Alexander Turenko authored
      `apt-get update <...>` fails on Debian Buster on docker_bootstrap goal
      (see #4331 for the similar issue).
      
      Added a description how to change dependencies in .travis.mk.
      
      (cherry picked from commit 45c2576d)
      882068ee
    • Nikita Pettik's avatar
      txn: erase old savepoint in case of name collision · 03cbc365
      Nikita Pettik authored
      Name duplicates are allowed for savepoints (both in our SQL
      implementation and in ANSI specification). ANSI SQL states that previous
      savepoint should be deleted. What is more, our doc confirms this fact
      and says that "...it is released before the new savepoint is set."
      Unfortunately, it's not true - currently old savepoint remains in the
      list. For instance:
      
      SAVEPOINT t;
      SAVEPOINT t;
      RELEASE SAVEPOINT t;
      RELEASE SAVEPOINT t; -- no error is raised
      
      Let's fix this and remove old savepoint from the list.
      
      (cherry picked from commit 8b8b6895)
      03cbc365
    • Nikita Pettik's avatar
      sql: use struct txn_savepoint as anonymous savepoint · 12619335
      Nikita Pettik authored
      This allows us to completely remove SQL specific struct Savepoint and
      use instead original struct txn_savepoint.
      
      (cherry picked from commit 0a92ec7e)
      12619335
    • Nikita Pettik's avatar
      txn: merge struct sql_txn into struct txn · c9046042
      Nikita Pettik authored
      This procedure is processed in several steps. Firstly, we add name
      to struct txn_savepoint since we should be capable of operating on named
      savepoints (which in turn is SQL feature). Still, anonymous (in the sense
      of name absence) savepoints are also valid. Then, we add list (as
      implementation of stailq) of savepoints to struct txn: it allows us to
      find savepoint by its name. Finally, we patch rollback to/release
      savepoint routines: for rollback tail of the list containing savepoints
      is cut (but subject of rollback routine remains in the list); for
      release routine we cut tail including node being released.
      
      (cherry picked from commit 56096ff2)
      c9046042
    • Nikita Pettik's avatar
      txn: move fk_deferred_count from psql_txn to txn · 8b45c38d
      Nikita Pettik authored
      We are going to merge struct psql_txn with struct txn as a part of SQL
      integration into NoSQL, so let's move counter of deferred foreign key
      violations directly to struct txn.
      
      (cherry picked from commit 5259274d)
      8b45c38d
  2. Aug 21, 2019
    • Mergen Imeev's avatar
      build: link libcurl statically from a submodule · 5fcca9dd
      Mergen Imeev authored
      Hold libcurl-7.65.3. This version is not affected by the following
      issues:
      
      * #4180 ('httpc: redirects are broken with libcurl-7.30 and older');
      * #4389 ('libcurl memory leak');
      * #4397 ('HTTPS seem to be unstable').
      
      After this patch libcurl will be statically linked when
      ENABLE_BUNDLED_LIBCURL option is set. This option is set by default.
      
      Closes #4318
      
      @TarantoolBot document
      Title: Tarantool dependency list was changed
      
      * Added build dependencies: autoconf, automake, libtool, zlib-devel
        (zlib1g-dev on Debian).
      * Added runtime dependencies: zlib (zlib1g on Debian).
      * Removed build dependencies: libcurl-devel (libcurl4-openssl-dev on
        Debian).
      * Removed runtime dependencies: curl.
      
      The reason is that now we use compiled-in libcurl: so we don't depend on
      a system libcurl, but inherit its dependencies.
      
      (cherry picked from commit 7e51aebb)
      5fcca9dd
    • Alexander Turenko's avatar
      lua: workaround pwd.getpwall() issue on Fedora 29 · 5806c124
      Alexander Turenko authored
      This is a workaround for systemd-nss issue:
      https://github.com/systemd/systemd/issues/9585
      
      The following error is observed on app-tap/pwd.test.lua on Fedora 29
      (glibc-2.28-26.fc29, systemd-239-12.git8bca462.fc29) when tarantool is
      linked with libcurl w/o GSS-API support:
      
       | builtin/pwd.lua:169: getpwall failed [errno 2]: No such file or directory
      
      Such tarantool build lacks of libselinux.so.1 transitive dependency
      (tarantool -> libcurl.so.4 -> libgssapi_krb5.so.2 -> libkrb5support.so.0
      -> libselinux.so.1) and strace shows the following calls when
      pwd.getpwall() is invoked first time:
      
       | openat(AT_FDCWD, "/lib64/libselinux.so.1", O_RDONLY|O_CLOEXEC) = 7A
       | <...>
       | access("/etc/selinux/config", F_OK)     = -1 ENOENT (No such file or directory)
      
      It looks like a part of libselinux initialization code and is invoked
      during execution of a last ffi.C.getpwent() call that returns `nil` as a
      result and left errno set to ENOENT. Our pwd module set errno to zero
      before getpwent() call and expects that it will be preserved if no
      unrecoverable errors occur. It seems that this expectation is not meet
      due to the systemd-nss issue linked above.
      
      Second and next getpwall() calls will succeed, so the commit adds an
      extra getpwall() during pwd module load. This workaround is disabled on
      FreeBSD due to another issue: #4428 ('getpwall() hangs on FreeBSD 12').
      
      See also the previous related commit:
      efccac69 ('lua: fix error handling in
      getpwall and getgrall').
      
      Follows up #3766.
      Part of #4318.
      
      (cherry picked from commit f5d8331e)
      5806c124
    • Alexander V. Tikhonov's avatar
      gitlab-ci: add static build · 100e3028
      Alexander V. Tikhonov authored
      Added static build using Dockerfile on Centos 7 for release
      commit criteria only. Added the cleanup for cmake generating
      CMakeCache.txt files and CMakeFiles directories to avoid of
      cmake localy created setup failing inside the docker after
      the whole tarantool path was copied into it. Added testing
      into the static build, running only when RUN_TESTS environment
      variable set to non empty value, used in gitlab-ci job to run
      the testing after the build.
      
      Closes #3668
      
      (cherry picked from commit f7509186)
      100e3028
  3. Aug 19, 2019
  4. Aug 16, 2019
    • Konstantin Osipov's avatar
      gc: randomie the next checkpoint time also after a manual box.snapshot(). · f9950440
      Konstantin Osipov authored
      Before this patch, snapshot interval was set randomly within
      checkpoint_interval period. However, after box.snapshot(), the next
      snapshot was scheduled exactly checkpoint_interval from the current time.
      Many orchestration scripts snapshot entire cluster right after deployment,
      to take a backup. This kills randomness, since all instances begin to
      count the next checkpoint time from the current time.
      
      Randomize the next checkpoint time after a manual snapshot as well.
      
      Fixes gh-4432
      
      (cherry picked from commit 6277f48a)
      f9950440
    • Alexander Turenko's avatar
      test: update test-run · 9f1beecc
      Alexander Turenko authored
      pretest_clean: preserve GREATEST and LEAST built-in functions.
      
      Needed for #4405.
      
      (cherry picked from commit 05fb6faa)
      9f1beecc
    • Nikita Pettik's avatar
      Hotfix for b7d595ac · 94479e8d
      Nikita Pettik authored
      It was forgotten to update result file of sql/bind.test.lua
      in previous patch. Let's fix that and refresh sql/bind.result with
      up-to-date results.
      
      (cherry picked from commit 0894bec2)
      94479e8d
  5. Aug 15, 2019
  6. Aug 14, 2019
    • Alexander V. Tikhonov's avatar
      test: app/socket flaky fails at 1118 line · 109a304d
      Alexander V. Tikhonov authored
      Found that on high loaded hosts the test flaky fails at:
      
      [004] --- app/socket.result	Mon Jul 15 07:18:57 2019
      [004] +++ app/socket.reject	Tue Jul 16 16:37:35 2019
      [004] @@ -1118,7 +1118,7 @@
      [004]  ...
      [004]  ch:get(1)
      [004]  ---
      [004] -- true
      [004] +- null
      [004]  ...
      [004]  s:error()
      [004]  ---
      
      Found that the test in previous was used for testing the
      the channel get() function timeout and the error occurred
      on it, but later the checking error changed to:
      "builtin/socket.lua: attempt to use closed socket" and the
      test became not correct. Because for now it passes when the
      socket read function runs before the socket closing, but in
      this way read call doesn't wait. In the other way on high
      loaded hosts the close call may occure before read call and
      in this way read call halts and socket get call returns
      'null'. As seen both ways are not correct to check the error.
      Decided to remove this subtest.
      
      Check commit ba7a4fee ("Add tests for socket:close closes #360")
      
      Fixes #4354
      
      (cherry picked from commit 952d8d1d)
      109a304d
  7. Aug 13, 2019
    • Vladislav Shpilevoy's avatar
      json: detect a new invalid json path case · b70aae59
      Vladislav Shpilevoy authored
      JSON paths has no a strict standard, but definitely there is no
      an implementation, allowing to omit '.' after [], if a next token
      is a key. For example:
      
          [1]key
      
      is invalid. It should be written like that:
      
          [1].key
      
      Strangely, but we even had tests on the invalid case.
      
      Closes #4419
      
      (cherry picked from commit ef64ee51)
      b70aae59
  8. Aug 11, 2019
  9. Aug 02, 2019
    • Vladimir Davydov's avatar
      relay: stop relay on subscribe error · 878e2a42
      Vladimir Davydov authored
      In case an error occurs between relay_start() and cord_costart() in
      relay_subscribe(), the relay status won't be reset to STOPPED. As a
      result, any further attempt to re-subscribe will fail with ER_CFG:
      duplicate connection with the same replica UUID. This may happen, for
      example, if the WAL directory happens to be temporarily inaccessible on
      the master.
      
      Closes #4399
      
      (cherry picked from commit 35ef3320)
      878e2a42
    • Kirill Yukhin's avatar
      gitlab-ci: fix branch name · 249577e0
      Kirill Yukhin authored
      249577e0
    • Kirill Yukhin's avatar
      Update CI/CD with new branch name · 1208b4ed
      Kirill Yukhin authored
      1208b4ed
    • Cyrill Gorcunov's avatar
      box/console: Don't allow arguments in get_default_output · 4138645e
      Cyrill Gorcunov authored
      The function
      
       | require('console').get_default_output()
      
      requires no arguments. Make it explcicit and print
      an error otherwise.
      
      Part-of #3834
    • Cyrill Gorcunov's avatar
      box/console: Test for nil value in args directly · 69d4d53d
      Cyrill Gorcunov authored
      Instead of allocating a variable for optional args
      testing we should use dot notation instead. Otherwise
      it won't work for trivial test case as
      
      ```
      require('console').set_default_output('lua,block')
      require('decimal').new('1234.5678')
      ```
      
       | builtin/box/console.lua:47: expected decimal, number or string as 2 argument
      
      and program exits.
      
      Part-of #3834
      69d4d53d
    • Cyrill Gorcunov's avatar
      box/console: Drop redundant status parameter from return · df71cbdc
      Cyrill Gorcunov authored
      In output_verify_opts and output_parse we return status variable
      to point if function processed without error. This is redundant
      we can simply return either error or nil, which is enough.
      
      Part-of #3834
      df71cbdc
    • Nikita Pettik's avatar
      sql: make default type of NULL be boolean · ffccbbd8
      Nikita Pettik authored
      It was decided that null value in SQL by default should be of type
      boolean. Justification of such change is that according to ANSI boolean
      type in fact has three different values: true, false and unknown. The
      latter is basically an alias to null value.
      ffccbbd8
    • Nikita Pettik's avatar
      sql: make default constraint names be consistent · 45f61e0d
      Nikita Pettik authored
      If during creation of constraint its name is not specified, then it is
      generated automatically. Occasionally, default names for each type of
      constraint turn out to be different. This patch makes them follow the
      same pattern: "shortcut"_unnamed_"table_name"_"ordinal_numb". For
      instance: fk_unnamed_T1_1 or ck_unnamed_T1_3 etc
      45f61e0d
    • Nikita Pettik's avatar
      sql: don't mangle name of unique constraint · 1f783f26
      Nikita Pettik authored
      If UNIQUE constraint is specified in CREATE TABLE statement and it has
      given name, one is mangled with pattern "unique_%s_%d", where %s is
      original name of constraint and %d - current iid. For instance:
      
      CREATE TABLE t (id INT PRIMARY KEY, a INT CONSTRAINT i1 UNIQUE);
      
      This statement results in secondary index creation with name
      "unique_I1_1". Justification for mangling is that constraint namespace
      should be independent from index namespace. However, ALTER TABLE ADD
      CONSTRAINT UNIQUE which is alias to CREATE INDEX doesn't mangle name.
      What is more, users may wonder why name of index is different from
      name of created constraint. Hence, it has been decided to remove this
      mangling and create index exactly with specified constraint's name.
      1f783f26
    • Nikita Pettik's avatar
      sql: remove OP_IntCopy opcode · 931d58a3
      Nikita Pettik authored
      Its purpose is to copy integer value from one memory cell to another.
      In other words, it is particular case of OP_SCopy instruction. Since it
      is used only during creation of AUTOINCREMENT property, it seems to be
      reasonable to replace it with a bit general OP_SCopy and erase
      OP_IntCopy at all reducing size of SQL codebase.
      931d58a3
    • Nikita Pettik's avatar
      sql: remove OP_SoftNull opcode · ed8891e3
      Nikita Pettik authored
      It's not used anymore and can be removed to reduce size of codebase.
      ed8891e3
    • Mergen Imeev's avatar
      sql: return lookaside system · 2386ce6c
      Mergen Imeev authored
      After the removal of the LOOKASIDE system, it was found that the
      performance dropped. To restore performance, this patch partially
      returns the LOOKASIDE system in almost the same form as it was
      before the patch 4326ca7d.
      
      Closes #4319
      2386ce6c
    • Mergen Imeev's avatar
      sql: rework error handling in box.execute() · 98e29c0f
      Mergen Imeev authored
      In accordance with the Lua coding style in Tarantool, all errors
      returned in Lua should be returned using 'return nil, error'.
      However, box.execute() throws an exception in case of an error.
      This patch causes box.execute() to return an error, as described
      in the coding style.
      
      Closes #4390
      98e29c0f
    • Mergen Imeev's avatar
      lua: new function luaT_push_nil_and_error() · 7b357950
      Mergen Imeev authored
      Currently, if we have to return errors using the format
      'return nil, error', we must do it manually. Since this error
      return method is described in our Lua coding style, it makes sense
      to create a function that will return an error in this format.
      This patch creates mentioned function.
      
      Needed for #4390
      7b357950
  10. Aug 01, 2019
    • Nikita Pettik's avatar
      sql: remove sql_strlike_*() functions as unused · 6770d339
      Nikita Pettik authored
      Follow-up #3589
      6770d339
    • Roman Khabibov's avatar
      sql: make LIKE predicate dependent on collation · 37cd7a37
      Roman Khabibov authored
      According to ANSI, LIKE should match characters taking into
      account passed collation.
      
      ISO/IEC JTC 1/SC 32 2011, Part 2: Foundation, 8.5
      
      Closes #3589
      
      @TarantoolBot document
      Title: LIKE depends on collations
      
      Now <LIKE> operator depends on arguments' collations. Collation to be
      used is determined by common rules: if explicit collation or collations
      (and in case they are compatible) is specified, then it is used to
      process pattern matching; otherwise implicit collation of arguments are
      checked to be compatible and (in case they are) resulting collation is
      used. Moreover, it means that PRAGMA "case_sensitive_like" has been
      removed.
      37cd7a37
    • Roman Khabibov's avatar
      sql: remove "PRAGMA case_sensitive_like" · 85a24ac4
      Roman Khabibov authored
      According to ANSI, LIKE should match characters taking into account
      collations of arguments, and this is done in the next patch. In turn,
      this patch makes LIKE be always case sensitive and erases
      case_sensitive_like pragma. Alongside with it, code related to no-case
      LIKE optimization is removed as well.
      
      Part of #3589
      85a24ac4
    • Nikita Pettik's avatar
      sql: introduce VARBINARY column type · b4e61e1b
      Nikita Pettik authored
      Current patch introduces new type available in SQL:
       - VARBINARY now is reserved keyword;
       - Allow to specify VARBINARY column and CAST type;
       - All literals which start from 'x' are assumed to be of this type;
       - There's no available implicit or explicit conversions between
         VARBINARY and other types;
       - Under the hood all values of VARBINARY type are stored as MP_BIN
         msgpack format type.
      
      Closes #4206
      b4e61e1b
    • Nikita Pettik's avatar
      sql: fix default trim octet for binary strings · 406330e0
      Nikita Pettik authored
      According to ANSI specification, if TRIM function accepts binary string
      and trim octet is not specified, then it is implicitly set to X'00'.
      Before this patch trim octet was set to ' ' both for string and binary
      string arguments. In turn, ' ' is equal to X'20' in hex representation.
      Hence, TRIM function cut wrong characters:
      
      TRIM(X'004420') -> X‘0044'
      
      This patch sets default trim octet to X'00' for binary string arguments.
      
      Part of #4206
      406330e0
Loading