Skip to content
Snippets Groups Projects
  1. Feb 27, 2023
    • Vladimir Davydov's avatar
      vinyl: fix use after free on key alloc error in iterator constructor · 074e4eb8
      Vladimir Davydov authored
      Error labes got mixed up. Fix the order and add a test.
      
      Fixes commit 3f026339 ("vinyl: implement iterator pagination").
      
      Closes #8372
      
      NO_DOC=bug fix
      NO_CHANGELOG=fix for unreleased feature
      074e4eb8
    • Mergen Imeev's avatar
      sql: refactor sqlAddPrimaryKey() · 2ba2c637
      Mergen Imeev authored
      This patch fixes the deprecated behavior of sqlAddPrimaryKey() when the
      only field in the PRIMARY KEY is of type INTEGER.
      
      NO_DOC=refactoring
      NO_TEST=refactoring
      NO_CHANGELOG=refactoring
      2ba2c637
    • Mergen Imeev's avatar
      sql: check column name in index definition · 7935d2c8
      Mergen Imeev authored
      After this patch, the column name will be checked for being an ID before
      resolution, not after.
      
      Closes #8365
      
      NO_DOC=bugfix in debug
      NO_CHANGELOG=bugfix in debug
      7935d2c8
    • Mergen Imeev's avatar
      sql: drop struct sql_stmt · 7201fa1f
      Mergen Imeev authored
      This structure is used as another name for the struct Vdbe. Because of
      this, there is some confusion about when one structure or another is
      used. To avoid such confusion, we must remove the sql_stmt structure.
      
      In addition, this patch removes several unused functions or non-existent
      function definitions.
      
      NO_DOC=refactoring
      NO_TEST=refactoring
      NO_CHANGELOG=refactoring
      7201fa1f
    • Mergen Imeev's avatar
      sql: drop unused functions · dbad19ef
      Mergen Imeev authored
      These functions are not used and should be removed. Most likely these
      are not all unused functions, but they all use struct stmt, which will
      be removed in the next commit.
      
      Also, this patch removes the aCounter field from the struct Vdbe, since
      the only function that uses this field is removed in this commit.
      
      NO_DOC=refactoring
      NO_TEST=refactoring
      NO_CHANGELOG=refactoring
      dbad19ef
    • Mergen Imeev's avatar
      sql: remove type uptr · fa46d16b
      Mergen Imeev authored
      This type is not used and now dropped.
      
      NO_DOC=refactoring
      NO_TEST=refactoring
      NO_CHANGELOG=refactoring
      fa46d16b
    • Mergen Imeev's avatar
      sql: remove macro to convert int to pointer · bbff6158
      Mergen Imeev authored
      This patch removes macros that were used to convert int to pointer and
      vice versa. These macros have been removed as they are no longer needed.
      
      NO_DOC=refactoring
      NO_TEST=refactoring
      NO_CHANGELOG=refactoring
      bbff6158
  2. Feb 22, 2023
    • Kirill Yukhin's avatar
      Cleanup changelog/unreleased · 5d658e7e
      Kirill Yukhin authored
      Remove changelog entries related to 2.11.
      
      NO_DOC=no code changes
      NO_CHANGELOG=see NO_DOC
      NO_TEST=see NO_DOC
      5d658e7e
    • Alexander Turenko's avatar
      Add 2.11.0-rc issue template · 5dce5b60
      Alexander Turenko authored
      We want to explicitly collect feedback that regards 2.11 release
      candidates.
      
      The template automatically adds `2.11.0-rc` label to the new issue, so
      it'll be easier to filter issues relevant for the release candidates.
      
      NO_DOC=no code changes
      NO_CHANGELOG=see NO_DOC
      NO_TEST=see NO_DOC
      5dce5b60
    • Nikolay Shirokovskiy's avatar
      net_box: don't use integer implementation defined · baba38e6
      Nikolay Shirokovskiy authored
      When calculating `rows_index` in `netbox_decode_execute` etc we use
      implementation defined behavior of compiler. `i < mapsize` and this is
      fine according to standard as unsigned arithmetic is well defined on
      overflows. But then we cast the result to int and this is implementation
      defined as the result can not be represented by int.
      
      Closes https://github.com/tarantool/security/issues/98
      
      NO_DOC=minor
      NO_TEST=minor
      NO_CHANGELOG=minor
      baba38e6
  3. Feb 21, 2023
  4. Feb 20, 2023
    • Kirill Yukhin's avatar
    • Pavel Semyonov's avatar
      doc: proofread 2.11.0-rc changelogs, part 3 · 77be138d
      Pavel Semyonov authored
      Proofread changelogs for 2.11.0-rc, part 3
      Fix grammar, punctuation, and wording
      
      NO_CHANGELOG=changelog
      NO_DOC=changelog
      NO_TEST=changelog
      77be138d
    • Alexander Turenko's avatar
      changelog: drop changelogs from 2.10 changes · 65f3bb78
      Alexander Turenko authored
      There is no sense to add description of changes that will be present as
      part of 2.10.5 into 2.11.0-rc1 release notes. Let's base the changes
      list on current 2.10 (future 2.10.5).
      
      Follows up commit 4d95d1e2 ("Cleanup released changelogs").
      
      NO_DOC=no code changes, just changelogs
      NO_TEST=see NO_DOC
      65f3bb78
    • Vladimir Davydov's avatar
      test: fix app-luatest/console_debugger_session_test for EE · 2bf0ceb9
      Vladimir Davydov authored
      In Tarantool EE the version string is "Tarantool Enterprise", not just
      "Tarantool".
      
      Fixes commit a984fc0d ("debugger: use option -d for debugger
      activation")
      
      NO_DOC=test
      NO_CHANGELOG=test
      2bf0ceb9
    • Vladimir Davydov's avatar
      lua/fiber: add compat option for default slice · 6fa6e212
      Vladimir Davydov authored
      The new compat option 'fiber_slice_default' is added to control
      the default value of the max fiber slice. The old default is no limit
      (both warning and error slice equals TIMEOUT_INFINITY). The new default
      is {warn = 0.5, err = 1.0}.
      
      Follow-up #6085
      
      NO_DOC=tarantool/doc#3057
      NO_CHANGELOG=unreleased
      6fa6e212
    • Vladimir Davydov's avatar
      lua/fiber: add max slice to fiber info · 448c3a05
      Vladimir Davydov authored
      This commit adds the new field 'max_slice' to fiber.info() that reports
      the max slice applied to the given fiber. The value is a table with two
      fields: 'err' for error slice and 'warn' for warning slice. Values
      greater than or equal to TIMEOUT_INFINITY aren't reported.
      
      Follow-up #6085
      
      NO_DOC=tarantool/doc#3057
      NO_CHANGELOG=unreleased
      448c3a05
    • Vladimir Davydov's avatar
      lua/fiber: improve error message raised on invalid slice · 3ad578d4
      Vladimir Davydov authored
      Error messages raised when an invalid slice is specified are confusing:
      
        tarantool> fiber = require('fiber')
        ---
        ...
      
        tarantool> fiber.set_max_slice('foo')
        ---
        - error: slice must be a table or a number
        ...
      
        tarantool> fiber.set_max_slice({})
        ---
        - error: 'bad argument #3 to ''?'' (number expected, got nil)'
        ...
      
      Let's change the error message to "slice must be a number or a table
      {warn = <number>, err = <number>}".
      
      Follow-up #6085
      
      NO_DOC=undocumented
      NO_CHANGELOG=unreleased
      3ad578d4
    • Vladimir Davydov's avatar
      gdb: fix printing binary strings encoded in MsgPack · 4719d70b
      Vladimir Davydov authored
      One may encode a non-printable string under the MsgPack type MP_STR.
      In fact, there's no way to encode binary data as MP_BIN from Lua so
      users often do that, which breaks our gdb extension. Let's encode a
      string in base64 if unicode() raises an error, like we do with MP_BIN.
      
      While we are at it,
       - escape double quotes in printable strings;
       - fix MP_BIN encoding (b64encode takes and returns bytes).
       - don't use YAML !!binary prefix before base64 data - use bin: and str:
         instead.
      
      Here's what it looks like:
      
      ```
      (gdb) p *box_tuple_last
        <...>
        data = ["\"тест\\foo\"", str:/w==, bin:/w==]}
      ```
      
      The tuple was created with the following command:
      
      ```
      tarantool> msgpack = require('msgpack')
      ---
      ...
      
      tarantool> box.tuple.new(
               >   msgpack.object_from_raw('\xae"тест\\foo"'), -- MP_STR unicode
               >   msgpack.object_from_raw('\xa1\xff'),        -- MP_STR binary
               >   msgpack.object_from_raw('\xc4\x01\xff'))    -- MP_BIN
      ---
      - ['"тест\foo"', !!binary /w==, !!binary /w==]
      ...
      ```
      
      Follow-up commit 08a171a4 ("gdb: support unicode in MP_STR type of
      MsgPack").
      
      NO_DOC=gdb extension
      NO_TEST=gdb extension
      NO_CHANGELOG=gdb extension
      4719d70b
    • Vladimir Davydov's avatar
      Move tarantool-gdb.py to tools · f01e68b0
      Vladimir Davydov authored
      It doesn't belong to Tarantool sources. The tools directory looks like
      the right place for it.
      
      NO_DOC=code cleanup
      NO_TEST=code cleanup
      NO_CHANGELOG=code cleanup
      f01e68b0
    • Mergen Imeev's avatar
      box: support downgrading of tuple constraints · 436b1b17
      Mergen Imeev authored
      This patch allows to downgrade tuple foreign keys to SQL foreign keys
      and some tuple check constraints to SQL check constraints. The only
      tuple check constraints that can be downgraded are those using functions
      with the SQL_EXPR language.
      
      Closes #7718
      
      NO_DOC=already introduced
      NO_CHANGELOG=already introduced
      436b1b17
    • Timur Safin's avatar
      debugger: use option -d for debugger activation · a984fc0d
      Timur Safin authored
      Added `-d` option for activation of debugger shell:
      - it calls debugger shell in `luadebug.lua` instead of
        a standard interactive shell from `console.lua`;
      - that option complements original way for starting a
        debugging shell via `require 'luadebug'()`, but is a
        little bit easier.
      
      NB! At the moment when we enter debugging mode instead of
      a standard Tarantool console, we change banner to:
      ```
      Tarantool debugger 2.11.0-entrypoint-852-g9e6ed28ae
      type 'help' for interactive help
      ```
      
      Part of #7456
      
      @TarantoolBot document
      Title: Command-line option `-d` for console debugger.
      
      Please see third_party/lua/README-luadebug.md for a full description
      of different ways to activate debugging shell.
      a984fc0d
    • Igor Munkin's avatar
      luajit: bump new version · 5c8dd500
      Igor Munkin authored
      * ci: add LUAJIT_ENABLE_CHECKHOOK for exotic matrix
      * ci: add ARM64 architecture to exotic testing
      * ci: update action/checkout to v3
      * Fix os.date() for wider libc strftime() compatibility.
      * x86/x64: Fix loop realignment.
      * ci: introduce workflow for exotic builds
      * sysprof: fix interval parsing in dual-number mode
      * test: add test for `string.format('%c', 0)`
      * ci: drop obsolete arguments for LuaJIT integration
      
      Part of #8069
      
      NO_DOC=LuaJIT submodule bump
      NO_TEST=LuaJIT submodule bump
      5c8dd500
    • Nikolay Shirokovskiy's avatar
      upgrade: add "2.10.5" to box.schema.downgrade_versions(). · 6fcce8e8
      Nikolay Shirokovskiy authored
      2.10.5 version is going to be released at the same time as 2.11.0 thus
      let's add it to the box.schema.downgrade_versions().
      
      NO_DOC=internal
      NO_CHANGELOG=internal
      NO_TEST=internal
      6fcce8e8
    • Ilya Verbin's avatar
      log: allow "tarantool" as module name in box.cfg{log_modules = ...} · facd04c2
      Ilya Verbin authored
      Currently it's possible to set the log level for a particular Lua module,
      or to change the default log level, however there is no way to change it
      only for Tarantool system messages. This patch introduces a fake module
      name "tarantool" for this purpose.
      
      Closes #8320
      
      NO_CHANGELOG=Unreleased feature
      NO_DOC=Will update tarantool/doc#3264
      facd04c2
    • Timur Safin's avatar
      debugger: match paths suffixes in breakpoints · 8a2ba411
      Timur Safin authored
      We used to "normalize" breakpoint filename paths
      down to their basic name, which worked fine for
      unique file names, but is getting annoying when
      you need to debug a code in one of many `init.lua`
      modules, i.e.
      
          break init.lua:5
      
      Will stop at _every_ `init.lua` file we will run
      at the debugging session.
      
      So we add machinery for partial paths lookup, to
      make possible to set breakpoints using (unique-enough)
      path suffixes, e.g. if we have multiple `init.lua` in
      the application, i.e.
          ./init.lua
          ./A/init.lua
          ./B/init.lua
      
      Then we could use syntax:
      
          break A/init.lua:5
      
      To activate debugger breakpoint only in the particular
      module, and not trigger it elsewhere.
      
      Current suffix trees limitations and peculiarities
      --------------------------------------------------
      
      Please keep in mind that suffix-tree algorithm, used for
      partial paths lookup, uses `$ref` and `$f` node names
      for their own purposes. That means that it would not handle
      well breakpoints with paths containing `$f` and `$ref`.
      That's not a big problem given that majority of filesystems
      we are running on do not usually allow `$` as part of
      file name.
      
      Also, due to suffix tree lookup behavior, if we would
      activate multiple breakpoints:
          break init.lua:10
          break A/init.lua:10
      
      Then _least specific_ `init.lua:10` breakpoint will trigger.
      From users' prospective it makes no much difference, as we
      need to stop in debugger shell in this line, but this is
      the way how suffix tree is working.
      
      Dot files treatment
      -------------------
      
      There is a special mechanism for `.` and `..` treatment
      if they are at the header of a path provided. I.e.
      
          break ./main.lua:10
          break ../a/b/c/least.lua:15
      
      For these cases `.` and `..` will be converted to the
      full path to the given file location.
      
      NO_TEST=hard to implement tests. Postponed till step.5
      
      @TarantoolBot document
      Title: Breakpoints in console debugger for Lua
      
      Match partial path patterns in breakpoints
      ==========================================
      
      Please see `third_party/lua/README-luadebug.md` for
      a fuller description of partial path syntax one could use
      in a breakpoints definition.
      8a2ba411
    • Timur Safin's avatar
      debugger: match paths suffixes in breakpoints · c5c2b6aa
      Timur Safin authored
      We used to "normalize" breakpoint filename paths
      down to their basic name, which worked fine for
      unique file names, but is getting annoying when
      you need to debug a code in one of many `init.lua`
      modules, i.e.
      
          break init.lua:5
      
      Will stop at _every_ `init.lua` file we will run
      at the debugging session.
      
      So we add machinery for partial paths lookup, to
      make possible to set breakpoints using (unique-enough)
      path suffixes, e.g. if we have multiple `init.lua` in
      the application, i.e.
          ./init.lua
          ./A/init.lua
          ./B/init.lua
      
      Then we could use syntax:
      
          break A/init.lua:5
      
      To activate debugger breakpoint only in the particular
      module, and not trigger it elsewhere.
      
      NB! If we will activate multiple breakpoints:
          break init.lua:10
          break A/init.lua:10
      
      Then _least specific_ `init.lua:10` breakpoint will trigger.
      From users' prospective it makes no much difference, as we
      need to stop in debugger shell in this line, but this is
      the way how suffix tree is working.
      
      NO_TEST=hard to implement tests. Postponed till step.5
      
      @TarantoolBot document
      Title: Breakpoints in console debugger for Lua
      
      Match partial path patterns in breakpoints
      ==========================================
      
      Please see `third_party/lua/README-luadebug.md` for
      a fuller description of partial path syntax one could use
      in a breakpoints definition.
      c5c2b6aa
    • Timur Safin's avatar
      debugger: changelog and readme updated · cc1163a9
      Timur Safin authored
      * Added breakpoints support in debugger;
      
      NO_TEST=documentation added
      
      @TarantoolBot document
      Title: Breakpoints in console debugger for Lua
      
      Breakpoints support
      ===================
      
      Please see `third_party/lua/README-luadebug.md` for
      a description of breakpoints support introduced to the
      builtin console debugger in `luadebug.lua`.
      cc1163a9
    • Timur Safin's avatar
      debugger: refactor auto listing · e3c73d5b
      Timur Safin authored
      Commonize mechanism activated by `dbg.cfg.auto_where` and an
      automatic code listing we show for breakpoint context.
      
      Make sure we do not show redundant listing, i.e. after
      commands `where #`, or `up`, or `down` we do not output
      automatic listing, as there was already shown some different
      context.
      
      NO_DOC=see later
      NO_CHANGELOG=internal
      NO_TEST=internal
      e3c73d5b
    • Timur Safin's avatar
      debugger: better help message · f5366146
      Timur Safin authored
      Make message, which is shown for a `help` command,
      to be more readable.
      
      NO_DOC=see later commit
      NO_CHANGELOG=internal
      NO_TEST=internal
      f5366146
    • Timur Safin's avatar
      debugger: introduce dbg_write_error, dbg_write_warn · ae3653a7
      Timur Safin authored
      Introduced `dbg_write_error` to centralize the way
      how errors reported in debugger shell.
      
      Similarly `dbg_write_warn` is used for reporting of
      highlighted non-fatal warnings.
      
      NO_DOC=internal
      NO_CHANGELOG=internal
      ae3653a7
    • Timur Safin's avatar
      debugger: uncolor variables · 466edbbf
      Timur Safin authored
      We may use "caret" or "arrow" symbols either in
      colored or uncolored contexts. To reduce further
      confusion we get rid of colored prefixes.
      
      NO_DOC=internal
      NO_CHANGELOG=internal
      NO_TEST=internal
      466edbbf
    • Timur Safin's avatar
      debugger: trim generated size of debug.info · 91900411
      Timur Safin authored
      In many cases we do not need to use all "Snl"
      parameters in `debug.getinfo()`: so try to trim wherever
      possible "n", which is calculating `name` and `namewhat`,
      and "S" which is generating `source`, `short_src` and others.
      
      NO_DOC=internal
      NO_CHANGELOG=internal
      NO_TEST=internal
      91900411
    • Timur Safin's avatar
      debugger: better annotated listing · 49f419ce
      Timur Safin authored
      Visualize properly locations with breakpoints
      saved there. In addition to current line visualization
      (using green '=>') we annotate corresponding line with
      red "●".
      
      NO_TEST=see the later commit
      NO_DOC=internals
      NO_CHANGELOG=internals
      49f419ce
    • Timur Safin's avatar
      debugger: handle breakpoints · 80460557
      Timur Safin authored
      Introduced few new commands to handle breakpoints:
      - `b file:NNN` to set new breakpoint;
      - `bd file:NNN` to remove breakpoint;
      - 'bl` to list all active breakpoints.
      
      There is partial breakpoint notation supported when
      for `b :N` or `b +N` breakpoint will be set to the
      asked line in the _currently_ debugged file.
      
      Changed `c` (continue) to stop on breakpoints, if there any active
      one asssigned by user. Otherwise it still run in full speed, without
      any hook check.
      
      NO_DOC=see the later commit
      NO_CHANGELOG=see the later commit
      80460557
    • Timur Safin's avatar
      debugger: swap cmd_up and cmd_down commands · 89cb9ad3
      Timur Safin authored
      Historically luadebug.lua used `up` and `down` in
      a strange order which was inherited from original
      debugger.lua implementation. But that was counter
      intuitive, and is confusing.
      
      Swap their meaning to be more compatible with
      that we accustomed in `gdb`/`lldb`.
      
      NO_DOC=internal
      89cb9ad3
    • Oleg Jukovec's avatar
      httpc: introduce stream input/output interface · 417c6cb7
      Oleg Jukovec authored
      Add a streaming data input/output object for http.client. The
      input/output object can be created using the same methods and the
      same options as a normal request, but with a new option
      {chunked = true}.
      
      Closes #7845
      
      @TarantoolBot document
      Title: Stream input/output interface for http.client
      
      An uncompleted io object has only headers and cookies fields. A
      completed io object has the same fields as a normal request, but
      without the `body` field.
      
      The io object interface looks like the socket object interface
      and should have the same description:
      
      ```
      io_object:read(chunk[, timeout])
      io_object:read(delimiter[, timeout])
      io_object:read({chunk = chunk, delimiter = delimiter}[, timeout])
      io_object:write(data[, timeout])
      ```
      
      The difference is in the method `finish`. Unlike socket:close()
      it has an optional parameter `timeout`:
      
      ```
      io_object:finish([timeout])
      ```
      
      Be careful, the call may yield a fiber. The idea is to wait
      until a HTTP connection is finished by the server-side or
      force finish the connection from client-time after a timeout
      value.
      
      The default timeout value is 10 seconds for all methods.
      
      Usage example:
      
      ```lua
      local io = httpc:post(url, nil, {chunked = true})
      
      local write_chan = fiber.channel()
      fiber.new(function()
          fiber.name("write to " .. url)
          while true do
              local data = write_chan:get()
              if data == nil then
                  break
              end
              io:write(data, 1)
          end
      end)
      
      local recvdata
      while recvdata = io:read('\r\n', 1) do
          local decoded = json.decode(recvdata)
          if condition(decoded) then
              write_chan:put(data)
          end
          if condition(decoded) then
              io:finish(1)
          end
      end
      write_chan:close()
      ```
      
      See also:
      * https://www.tarantool.io/en/doc/latest/reference/reference_lua/socket/#lua-function.socket_object.read
      * https://github.com/tarantool/tarantool/issues/7845#issuecomment-1298538412
      * https://github.com/tarantool/tarantool/issues/7845#issuecomment-1298821779
      417c6cb7
  5. Feb 19, 2023
    • Ilya Verbin's avatar
      lua/utils: use index2adr() instead of index arithmetic · a635765f
      Ilya Verbin authored
      We have a code that performs calculations to obtain the address from the
      given index, the address is then passed to cdataV() to get cdata value from
      the stack. But this doesn't work for pseudo-indexes (e.g. upvalue indexes).
      This patch brings index2adr() from luajit/src/lj_api.c, which accepts all
      kinds of indexes, so that the calculations are no longer needed. Also the
      helper function luaL_tocpointer() is introduced.
      
      Closes #8249
      
      NO_DOC=bugfix
      a635765f
    • Alexander Turenko's avatar
      lua: panic on suspicious built-in modules manipulations · 0fb64e5a
      Alexander Turenko authored
      The built-in module registration process performs several assertions:
      
      - luaT_newmodule() checks for attempts to register an already registered
        module.
      - luaT_setmodule() does the same, but it allows the same value be
        'registered' several times.
      
      Attempt to register different values as the same built-in module is
      definitely an error. Once a module is registered, it may be required and
      captured. If its value is changed afterwards, different parts of
      tarantool's code will capture different values for the same built-in
      module. It is very unlikely that such effect may be intended.
      
      Anyway, tarantool's code doesn't do this. However, now, after
      implementing the override modules feature, it is possible to influence
      tarantool's initialization from a user provided code.
      
      It means that we can't assume the situations described above as
      impossible ones. A developer of an override module should receive an
      error if the code of the module leads to such a situation.
      
      `assert()` works only in Debug build, but most of user's code is tested
      on RelWithDebInfo builds. So incorrect override module may be
      implemented and distributed. It is undesirable.
      
      Let's replace `assert()` with explicit `panic()`.
      
      Adjusted testing helpers:
      
      * `treegen` now allows to just write given script into given directory
        without using templates. Sometimes it is more convenient.
      * `justrun` can return pure stdout (without JSONL decoding) and can
        return stderr if requested.
      
      `nojson` option in `justrun` may look unneeded for given test cases, but
      it provides better diagnostics if something going wrong and one of the
      test cases fails (say, if tarantool runs successfully instead of going
      to panic).
      
      Follows up #7774
      
      NO_DOC=The override modules feature is not released yet.
      NO_CHANGELOG=see NO_DOC
      0fb64e5a
    • Alexander Turenko's avatar
      lua: allow to refuse caching in package.loaded · d688c50d
      Alexander Turenko authored
      Use case: an override module is designed to replace a built-in module
      only when the module is required from an application, not from the
      platform itself.
      
      Now it is possible:
      
      ```lua
      -- override/fio.lua
      local loaders = require('internal.loaders')
      
      if loaders.initializing then
          loaders.no_package_loaded.fio = true
          return loaders.builtin.fio
      end
      
      return {
          whoami = 'override.fio',
      }
      ```
      
      Follows up #7774
      
      NO_DOC=Planned as an internal API. See the previous commit.
      NO_CHANGELOG=see NO_DOC
      d688c50d
Loading