Skip to content
Snippets Groups Projects
  1. Dec 11, 2024
    • Egor Ivkov's avatar
      feat: report actual error in console.connect · 11c1f3a8
      Egor Ivkov authored and Dmitry Ivanov's avatar Dmitry Ivanov committed
      NO_DOC=internal
      NO_TEST=internal
      NO_CHANGELOG=internal
      11c1f3a8
    • godzie44's avatar
      feat: add exports for log format functions · 5a27fdfe
      godzie44 authored and Dmitry Ivanov's avatar Dmitry Ivanov committed
      - Add `log_default_logger` to get a default logger.
      - Add exports for `log_set_format`, `log_set_level` and `log_default_logger` functions.
      - Add `current_cord_name` function to get a name of the current cord,
      - add `cord_is_main_dont_create` function.
      - Add exports for `cord_is_main`, `cord_is_main_dont_create` and
      - `current_cord_name` functions.
      
      NO_DOC=internal
      NO_TEST=internal
      NO_CHANGELOG=internal
      5a27fdfe
    • Dmitry Rodionov's avatar
      refactor: rename schema_object_type to box_schema_object_type · f452ba18
      Dmitry Rodionov authored and Dmitry Ivanov's avatar Dmitry Ivanov committed
      This patch makes schema_object_type to be exported.
      
      NO_DOC=picodata internal patch
      NO_CHANGELOG=picodata internal patch
      NO_TEST=picodata internal patch
      f452ba18
    • Dmitry Rodionov's avatar
      feat: export box_access_check_ddl · 89cf3837
      Dmitry Rodionov authored and Dmitry Ivanov's avatar Dmitry Ivanov committed
      NO_DOC=picodata internal patch
      NO_CHANGELOG=picodata internal patch
      NO_TEST=picodata internal patch
      89cf3837
    • Georgy Moshkin's avatar
      box: fix memory leak when dropping temporary spaces · 75794401
      Georgy Moshkin authored and Dmitry Ivanov's avatar Dmitry Ivanov committed
      NO_CHANGELOG=bug fix for unreleased feature
      NO_DOC=bug fix for unreleased feature
      75794401
    • Dmitry Ivanov's avatar
      feat: Add new methods to `say` for FFI use cases · eeb39d32
      Dmitry Ivanov authored and Dmitry Ivanov's avatar Dmitry Ivanov committed
      This patch helps us create and write to non-default
      loggers provided by `say.h`. We'll use this mainly
      for audit log in picodata.
      
      NO_DOC=internal
      NO_TEST=internal
      NO_CHANGELOG=internal
      eeb39d32
    • Kurdakov Alexander's avatar
      feat: support of overriding sql executor · 6ef85168
      Kurdakov Alexander authored and Dmitry Ivanov's avatar Dmitry Ivanov committed
      Add to console lua api function that overrides sql executor
      
      NO_DOC=picodata internal patch
      NO_CHANGELOG=picodata internal patch
      NO_TEST=picodata internal patch
      6ef85168
    • Feodor Alexandrov's avatar
      rename: crypto to tcrypto · 26a3c1eb
      Feodor Alexandrov authored and Dmitry Ivanov's avatar Dmitry Ivanov committed
      Picodata is built statically, and name crypto clashes between
      `src/lib/crypto` and libcrypto from `openssl`. To resolve the
      ambiguity this patch renames tarantool library to `tcrypto`.
      
      NO_DOC=picodata internal patch
      NO_CHANGELOG=picodata internal patch
      NO_TEST=picodata internal patch
      26a3c1eb
    • Maksim Kaitmazian's avatar
      build: add `tarantool` executable target · 8d86d3f6
      Maksim Kaitmazian authored and Dmitry Ivanov's avatar Dmitry Ivanov committed
      In the picodata-support branch, the tarantool.a library is built
      instead of a tarantool executable. So tests cannot be launched because
      of the lack of the executable. This commit adds this executable.
      
      NO_DOC=just an executable is added
      NO_TEST=just an executable is added
      NO_CHANGELOG=just an executable is added
      8d86d3f6
    • Georgy Moshkin's avatar
      iproto: request handlers set the fiber name to proc name · 7ee8aee5
      Georgy Moshkin authored and Dmitry Ivanov's avatar Dmitry Ivanov committed
      NO_DOC=picodata internal patch
      NO_CHANGELOG=picodata internal patch
      NO_TEST=picodata internal patch
      7ee8aee5
    • Georgy Moshkin's avatar
      fix(picodata): fix graceful stopping · b993e052
      Georgy Moshkin authored and Dmitry Ivanov's avatar Dmitry Ivanov committed
      Was broken because `tarantool_free` checks if the current process is the
      main one and not the child, which was forked at some point (at what
      point?). This check was implemented by saving the original process's id
      in the static variable master_pid, which got set when the code got
      loaded the first time into memory.
      
      So we broke this when we started forking the process in picodata, which
      resulted in `master_pid` being set to the pid of the picodata's
      "supervisor" process, which doesn't even enter tarantool runtime.
      
      The fix is simple - save master_pid first thing when running
      tarantool_main.
      b993e052
    • Georgy Moshkin's avatar
      build: apply security patches to vendored dependencies · d7348a72
      Georgy Moshkin authored and Dmitry Ivanov's avatar Dmitry Ivanov committed
      d7348a72
    • Georgy Moshkin's avatar
      build: remove some unneeded build steps for ncurses · 5d365835
      Georgy Moshkin authored and Dmitry Ivanov's avatar Dmitry Ivanov committed
      5d365835
    • Dmitry Ivanov's avatar
      fix(build): update libldap to 2.6.7 (mostly to satisfy gcc 14) · e8dc6bc9
      Dmitry Ivanov authored
      NO_DOC=internal
      NO_TEST=internal
      NO_CHANGELOG=internal
      
      This patch fixes the following problem at build time:
      
      checking for regex.h... yes
      checking for library containing regfree... none required
      checking for compatible POSIX regex... no
      configure: error: broken POSIX regex!
      e8dc6bc9
    • Denis Smirnov's avatar
      fix: ldap library lookup on macos · 8e470ed8
      Denis Smirnov authored and Dmitry Ivanov's avatar Dmitry Ivanov committed
      NO_DOC=internal
      NO_TEST=internal
      NO_CHANGELOG=internal
      8e470ed8
    • Dmitry Ivanov's avatar
      feat: vendor cyrus-sasl & openldap · 3d6b7ad2
      Dmitry Ivanov authored
      NO_DOC=picodata internal patch
      NO_CHANGELOG=picodata internal patch
      NO_TEST=picodata internal patch
      
      fix(build): Prevent sasl's makefile rules from staining vendor
      
      Turns out Cyrus SASL doesn't use AM_MAINTAINER_MODE or anything to
      prevent autotools from re-configuring the project at build time.
      This patch "fixes" that by maiming autotools' paths in Makefile.
      
      NO_DOC=internal
      NO_TEST=internal
      NO_CHANGELOG=internal
      
      fix(build): add missing headers to libsasl
      
      NO_DOC=internal
      NO_TEST=internal
      NO_CHANGELOG=internal
      
      This patch fixes the following problem at build time:
      
      ```
      cyrus-sasl-2.1.28/lib/saslutil.c:280:3: error: implicit declaration of function 'time' [-Wimplicit-function-declaration]
      280 |   time(&now);
          |   ^~~~
      cyrus-sasl-2.1.28/lib/saslutil.c:66:1: note: 'time' is defined in header '<time.h>'; this is probably fixable by adding '#include <time.h>'
       65 | #include "saslint.h"
      +++ |+#include <time.h>
       66 | #include <saslutil.h>
      cyrus-sasl-2.1.28/lib/saslutil.c: In function 'getranddata':
      cyrus-sasl-2.1.28/lib/saslutil.c:364:41: error: implicit declaration of function 'clock' [-Wimplicit-function-declaration]
      364 |             ret[1] ^= (unsigned short) (clock() & 0xFFFF);
          |                                         ^~~~~
      cyrus-sasl-2.1.28/lib/saslutil.c:364:41: note: 'clock' is defined in header '<time.h>'; this is probably fixable by adding '#include <time.h>'
      cyrus-sasl-2.1.28/lib/saslutil.c: In function 'get_fqhostname':
      cyrus-sasl-2.1.28/lib/saslutil.c:563:42: warning: comparison of integer expressions of different signedness: 'size_t' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
      563 |         || strlen (result->ai_canonname) > namelen -1) {
          |                                          ^
      make[9]: *** [Makefile:643: saslutil.lo] Error 1
      ```
      3d6b7ad2
    • Georgy Moshkin's avatar
      build: vendor the dependencies · 0eee1256
      Georgy Moshkin authored and Dmitry Ivanov's avatar Dmitry Ivanov committed
      0eee1256
    • Georgy Moshkin's avatar
      feat: add support for static stored procedures using ".foo" syntax · d6fdfe0c
      Georgy Moshkin authored and Dmitry Ivanov's avatar Dmitry Ivanov committed
      d6fdfe0c
    • Georgy Moshkin's avatar
      feat: make tarantool callable over ffi with a c callback for setup · 1f54696e
      Georgy Moshkin authored and Dmitry Ivanov's avatar Dmitry Ivanov committed
      - tarantool is now a static library
      - main(argc, argv) -> tarantool_main(argc, argv, cb, cb_data)
      - callback is called before running lua script
      1f54696e
    • Georgy Moshkin's avatar
      fiber: basic api exports · c3733d86
      Georgy Moshkin authored and Dmitry Ivanov's avatar Dmitry Ivanov committed
      Closes #9237
      
      Add exports for fiber_set_name_n, fiber_name, fiber_id, fiber_csw &
      fiber_find.
      
      Also make fiber_set_joinable, fiber_set_ctx & fiber_get_ctx interpret
      NULL as the current fiber.
      
      @TarantoolBot document
      Title: add basic fiber api to ffi exports.
      
      5 basic functions can now be used via ffi api, which were previously
      only accessible via lua api: fiber_set_name_n, fiber_name, fiber_id,
      fiber_csw & fiber_find.
      
      fiber_set_joinable now interprets NULL as current fiber.
      c3733d86
    • Georgy Moshkin's avatar
      core: change bug report destination to picodata related one · 9611d8d0
      Georgy Moshkin authored and Dmitry Ivanov's avatar Dmitry Ivanov committed
      NO_DOC=internal change
      NO_TEST=internal change
      9611d8d0
    • Dmitry Rodionov's avatar
      refactor: rename priv_type to box_privilege_type and expose it · a9069652
      Dmitry Rodionov authored and Dmitry Ivanov's avatar Dmitry Ivanov committed
      Rename the members as well. Keep uint16_t in box_check_acess_space
      as it is for other exported functions
      
      NO_DOC=picodata internal patch
      NO_CHANGELOG=picodata internal patch
      NO_TEST=picodata internal patch
      a9069652
    • Dmitry Rodionov's avatar
      feat: export box_access_check_space · 1d6d76f8
      Dmitry Rodionov authored and Dmitry Ivanov's avatar Dmitry Ivanov committed
      
      NO_DOC=picodata internal patch
      NO_CHANGELOG=picodata internal patch
      NO_TEST=picodata internal patch
      
      Co-authored-by: default avatarYaroslav Dynnikov <yaroslav.dynnikov@gmail.com>
      1d6d76f8
    • Georgy Moshkin's avatar
      box: introduce box_read_view_* ffi API functions · c098944a
      Georgy Moshkin authored and Dmitry Ivanov's avatar Dmitry Ivanov committed
      Introduce API for opening a read view over the specified spaces and
      indexes and creating iterators over the index read views.
      
      NO_DOC=picodata patch
      c098944a
    • Дмитрий Кибирев's avatar
      feat: add package for ROSA linux · b8fddcc0
      Дмитрий Кибирев authored and Dmitry Ivanov's avatar Dmitry Ivanov committed
      b8fddcc0
    • Dmitry Ivanov's avatar
      fix(tests): Fix gh_7860_syslog_json_test broken due to memtx_sort_threads · 137cac20
      Dmitry Ivanov authored
      test-run.py sets OMP_NUM_THREADS which causes this test to misbehave:
      it doesn't expect to see a warning regarding the use of this env var
      as the first log line.
      
      Alternatively, we could update test-run's submodule, but in practice
      this breaks other tests e.g. replication-luatest/linearizable_test.lua.
      
      NO_DOC=internal
      NO_TEST=internal
      NO_CHANGELOG=internal
      137cac20
    • Ilya Verbin's avatar
      build: remove dependencies on libgomp · a4a00d16
      Ilya Verbin authored and Dmitry Ivanov's avatar Dmitry Ivanov committed
      OpenMP is no longer used since commit 4f617b70 ("box: introduce
      memtx_sort_threads config parameter"). All dependencies on libgomp
      should be removed.
      
      Follow-up #7689
      
      NO_DOC=build
      NO_TEST=build
      a4a00d16
    • Nikolay Shirokovskiy's avatar
      box: introduce memtx_sort_threads config parameter · 0137bb35
      Nikolay Shirokovskiy authored and Dmitry Ivanov's avatar Dmitry Ivanov committed
      Closes #3389
      Closes #7689
      Closes #4646
      
      @TarantoolBot document
      Title: new box.cfg parameter memtx_sort_threads
      
      The parameter sets the number of threads used to sort keys of secondary
      indexes on loading memtx database. The parameter cannot be changed
      dynamically (as it does not make sense).
      
      Maximum value is 256, minimum is 1. Default is to use all available cores.
      
      Usage example:
      ```
      box.cfg{memtx_sort_threads=4}
      ```
      0137bb35
    • Nikolay Shirokovskiy's avatar
      core: introduce sample sort algorithm · 34cfeeb7
      Nikolay Shirokovskiy authored and Dmitry Ivanov's avatar Dmitry Ivanov committed
      The algorithm runs sort in multiple threads and does not use OpenMP. It
      has better threads utilization right from the beginning but probably
      a worse constant than parallel qsort. See details in code comments.
      
      Besides sort is not performed in calling thread but instead in spawned
      worker threads. Calling thread yields waiting for worker threads to
      finish. Exception is small data size, in this case sorting is executed
      in calling thread saving time on spawning a thread. This should speed up
      test execution. This is existing behaviour of qsort_arg but data size
      threshold is reduced from 128000 to 1024.
      
      Part of #3389
      
      NO_CHANGELOG=internal
      NO_DOC=internal
      34cfeeb7
    • Georgy Moshkin's avatar
      box: fully temporary spaces · 910d2bb0
      Georgy Moshkin authored and Dmitry Ivanov's avatar Dmitry Ivanov committed
      Introduce fully temporary spaces: same as data-temporary space but with
      temporary metadata. Basically temporary spaces now do not exist on
      restart and do not exist on replicas. They can also be created, altered
      and deleted when box.cfg.read_only = true.
      
      To avoid conflicts with spaces created on replicas, the temporary
      space ids by default start in a special range starting at
      BOX_SPACE_ID_TEMPORARY_MIN.
      
      Temporary spaces currently do not support several features e.g.
      foreign key references (to and from), functional indexes, sql sequences,
      sql triggers, etc. This may change in the future.
      
      Implementing temporary spaces requires temporary tuples to be
      inserted into system spaces: tuples which are neither replicated or
      persisted. This mostly done in on_replace_dd_* triggers by dropping the
      txn->stmt->row.
      
      Closes #8323
      
      @TarantoolBot document
      Title: Introduce fully temporary spaces with temporary metadata
      
      Temporary spaces are now data-temporary spaces with temporary metadata.
      Created by specifying { type = "temporary" } in the options.
      Temporary spaces will not exist upon server restart and will not
      exist on replicas. They can also be created in read-only mode.
      910d2bb0
    • Georgy Moshkin's avatar
      box: factor out new_tuple def construction · d0ca64a2
      Georgy Moshkin authored and Dmitry Ivanov's avatar Dmitry Ivanov committed
      A tiny preparatory commit for meta-temporary spaces
      
      NO_DOC=refactoring
      NO_TEST=refactoring
      NO_CHANGELOG=refactoring
      d0ca64a2
    • Georgy Moshkin's avatar
      box: extract txn_update_row_counts function · bd96ecee
      Georgy Moshkin authored and Dmitry Ivanov's avatar Dmitry Ivanov committed
      Move code that handles txn row counters into a separate function in
      preparation of meta-temporary spaces introduction.
      
      NO_DOC=refactoring
      NO_TEST=refactoring
      NO_CHANGELOG=refactoring
      bd96ecee
    • Georgy Moshkin's avatar
      core: rename temporary spaces to data-temporary · c11e7a10
      Georgy Moshkin authored and Dmitry Ivanov's avatar Dmitry Ivanov committed
      Everywhere where we refer to temporary spaces we now say data-temporary.
      This is because temporary spaces were never truly temporary because
      their definitions would still be persisted and replicated and they
      couldn't be created on read-only replicas. In a following commit we will
      introduce a new fully temporary type of spaces, which will be just
      called 'temporary', so this commit signifies this terminology change.
      
      NO_DOC=renaming
      NO_CHANGELOG=renaming
      NO_TEST=renaming
      c11e7a10
    • Georgy Moshkin's avatar
      box: introduce space type · bbd533ef
      Georgy Moshkin authored and Dmitry Ivanov's avatar Dmitry Ivanov committed
      Introduces a new field `type` to the space definition. Currently it can
      only be "normal" or "data-temporary". It is backwards compatible with
      temporary=true.
      
      @TarantoolBot document
      Title: Introduce space field type
      
      A new space definition field "type" can now be used to specify the type
      of the space. Usage: box.schema.create_space("s", { type = "normal" }).
      Currently only 2 types are supported: "normal" & "data-temporary", which
      is equivalent to { temporary = true }. Old-style { temporary = true } is
      still supported, but only one option either 'temporary' or 'type' may be
      specified at the same time.
      
      Space type "temporary" will be introduced in a later commit.
      In the future options "local", "synchronous", etc. may also be
      supported.
      
      NO_TEST=will be tested in the following commit
      bbd533ef
    • Aleksandr Lyapunov's avatar
      sql: refactor update_view_references a bit · f6c88e6b
      Aleksandr Lyapunov authored and Dmitry Ivanov's avatar Dmitry Ivanov committed
      The function update_view_references is called when an SQL view
      is created or dropped. The goal of this function is to modify
      (increment or decrement) view_ref_count member of spaces that
      the view references.
      
      There were a several issues that deserves to be refactored:
      * By design in case of error it left the job partially done, so
        some space references were modified while some other - not.
        Although there was no bug since special steps were made in case
        of error, this pattern is inconvenient and should be avoided.
      * In case of error the failing space name was returned via special
        argument which is not flexible and even requires allocation.
      * Another argument - suppress_error - has actually never
        suppressed any error because the only case when an error could
        occur is creation of a view, which used suppress_error = false.
      * Fail of that function was not actually covered with tests.
      
      So this commit:
      * Makes the function to do all or nothing.
      * Forces the function to set diag by itself in case of error.
      * Removes suppress_error argument while adding several asserts.\
      * Adds a small test that fulfills coverage.
      
      NO_DOC=refactoring
      NO_CHANGELOG=reafactoring
      f6c88e6b
    • Aleksandr Lyapunov's avatar
      sql: don't store the first NULL element in list · e173f491
      Aleksandr Lyapunov authored and Dmitry Ivanov's avatar Dmitry Ivanov committed
      By design a newly created SrcList object contains one element
      with NULL name. That was confusing and led to strange NULL checks
      in a list that could not contain NULL names.
      
      Fix it by clearing the list before usage.
      
      NO_DOC=refactoring
      NO_CHANGELOG=reafactoring
      NO_TEST=refactoring
      e173f491
    • Aleksandr Lyapunov's avatar
      sql: don't catch OOM in sql_select_expand_from_tables · 65ab1d1b
      Aleksandr Lyapunov authored and Dmitry Ivanov's avatar Dmitry Ivanov committed
      Since we panic on OOM now, no OOM error handling is needed now.
      Fix both internals of the function and how it is used in alter.
      
      NO_DOC=refactoring
      NO_CHANGELOG=reafactoring
      NO_TEST=refactoring
      65ab1d1b
    • Ilya Verbin's avatar
      box: support default field values in the space format · b2f58221
      Ilya Verbin authored and Dmitry Ivanov's avatar Dmitry Ivanov committed
      Now a field can be assigned a default value in the space format. When a new
      tuple is inserted into a space, and some of the fields contain null values,
      those fields will be filled with their respective default values.
      
      Closes #8157
      
      @TarantoolBot document
      Title: Document default field values
      Product: Tarantool
      Since: 3.0
      Root document: https://www.tarantool.io/en/doc/latest/reference/reference_lua/box_space/format/
      
      The format clause contains, for each field, a definition within braces:
      `{name='...',type='...'[,is_nullable=...][,default=...]}`, where:
      
      * the optional `default` value contains a default value for the field.
        Its type must be compatible with the field type. If default value is set,
        it is applied regardless of whether `is_nullable` is true or false.
      
      Example:
      
      ```lua
      tarantool> box.space.tester:format{
               > {name = 'id', type = 'unsigned'},
               > {name = 'name', type = 'string', default = 'Noname'},
               > {name = 'pass', type = 'string'},
               > {name = 'shell', type = 'string', default = '/bin/sh'}}
      ---
      ...
      
      tarantool> box.space.tester:insert{1000, nil, 'qwerty'}
      ---
      - [1000, 'Noname', 'qwerty', '/bin/sh']
      ...
      ```
      b2f58221
    • Ilya Verbin's avatar
      box: introduce tuple_builder class · a9a20579
      Ilya Verbin authored and Dmitry Ivanov's avatar Dmitry Ivanov committed
      It encapsulates the logic that helps to build a new MsgPack array by
      concatenating tuple fields from various locations. The idea is to
      postpone memory allocation and copying until the finalization.
      
      Needed for #8157
      
      NO_DOC=internal
      NO_CHANGELOG=internal
      a9a20579
    • Ilya Verbin's avatar
      sql: rename field_def::default_value to field_def::sql_default_value · 2cf79575
      Ilya Verbin authored and Dmitry Ivanov's avatar Dmitry Ivanov committed
      In order to avoid collision with the upcoming core default_value.
      
      Also rename tuple_field::default_value_expr to
      tuple_field::sql_default_value_expr.
      
      Part of #8157
      
      NO_DOC=refactoring
      NO_TEST=refactoring
      NO_CHANGELOG=refactoring
      2cf79575
Loading