Skip to content
Snippets Groups Projects
  1. Aug 04, 2022
    • Alexander Turenko's avatar
      decimal: include decimal.h as core/decimal.h · 62906a9c
      Alexander Turenko authored
      It is preparatory commit to add box/decimal.h header, which will hold
      module API for decimals.
      
      Part of #7228
      
      NO_DOC=no user-visible changes
      NO_TEST=no behavior changes
      NO_CHANGELOG=no user-visible changes
      62906a9c
  2. Apr 25, 2022
  3. Mar 14, 2022
  4. Nov 16, 2021
    • Vladislav Shpilevoy's avatar
      uuid: move into libcore · 1a812213
      Vladislav Shpilevoy authored
      libuuid used to be a separate library since
      de11d68a ("CMake: refactor
      dependencies of internal libraries").
      
      Unclear what was it done for. The commit says "fir unit tests".
      But they perfectly fine can depend on libcore like many of them
      do already.
      
      Because of libuuid being a separate library, libcore can't use
      tt_uuid, because that would be a cyclic dependency. And that won't
      allow to introduce tt_uuid-dependent API in a next patch.
      
      Hence libuuid is merged into libcore.
      
      Needed for #5568
      1a812213
  5. Sep 01, 2021
  6. Jul 20, 2021
  7. Jul 24, 2019
    • Nikita Pettik's avatar
      sql: introduce extended range for INTEGER type · 41477ada
      Nikita Pettik authored
      This patch allows to operate on integer values in range [2^63, 2^64 - 1]
      It means that:
       - One can use literals from 9223372036854775808 to 18446744073709551615
       - One can pass values from mentioned range to bindings
       - One can insert and select values from mentioned range
      
      Support of built-in functions and operators has been introduced in
      previous patches.
      
      Closes #3810
      Part of #4015
      41477ada
  8. Apr 26, 2019
  9. Apr 25, 2019
    • Nikita Pettik's avatar
      sql: use msgpack types instead of custom ones · 56e7b657
      Nikita Pettik authored
      This patch provides straightforward refactoring replacing enum sql_type
      with enum mp_type. Note that we use msgpack format instead of field_type
      since it is more suitable when dealing with NULLs.
      56e7b657
  10. Apr 02, 2019
    • Kirill Shcherbatov's avatar
      sql: export sql_bind structure and API · 18d4d37b
      Kirill Shcherbatov authored
      Exported sql_bind structure, sql_bind_decode, sql_bind_column
      and sql_bind routines in separate module bind.h. We need SQL
      bindings in further pathes with check constraints. Also, bind
      encapsulated in execute.c prevent us from implementation of a Lua
      part of forthcoming box.execute().
      
      Needed for #3691, #3505
      18d4d37b
    • Mergen Imeev's avatar
      iproto: create port_sql · fc1df2c5
      Mergen Imeev authored
      This patch creates port_sql implementation for the port. This will
      allow us to dump sql responses to obuf or to Lua. Also this patch
      defines methods dump_msgpack() and destroy() of port_sql.
      
      Part of #3505
      fc1df2c5
  11. Feb 27, 2019
  12. Feb 13, 2019
  13. Jan 29, 2019
    • Mergen Imeev's avatar
      iproto: move map creation to sql_response_dump() · 7609069c
      Mergen Imeev authored
      Currently, function sql_response_dump() puts data into an already
      created map. Moving the map creation to sql_response_dump()
      simplifies the code and allows us to use sql_response_dump() as
      one of the port_sql methods.
      
      Needed for #3505
      7609069c
  14. Dec 18, 2018
    • Vladislav Shpilevoy's avatar
      sql: move sql_request and xrow_decode_sql to xrow lib · 16744224
      Vladislav Shpilevoy authored
      All binary struct *_request are stored in xrow.h/.c
      together with their decoders. The only reason why
      xrow_decode_sql was implemented in execute.c was a
      dependency on struct sql_bind. Now xrow_decode_sql
      and struct sql_request operate only by MessagePack and
      some iproto constants and are moved to their true
      home.
      
      Follow up #3828
      16744224
    • Vladislav Shpilevoy's avatar
      sql: decode bind parameters in TX thread · 55f22ec2
      Vladislav Shpilevoy authored
      Before this patch bind parameters were decoded in
      iproto thread in an attempt to save some TX thread
      time. But they were stored in an array allocated on
      iproto thread memory. Lack of iproto_msg destructor
      lead to leak of this array.
      
      This patch makes sql_request store only raw undecoded
      MessagePack and moves decoding to TX thread where in
      a single function the parameters are decoded, applied
      and freed.
      
      There were a couple of alternatives allowing to keep
      decoding in iproto thread and to move even more
      decoding there, for example, parameters from
      IPROTO_UPDATE:
      
      * decode on malloc and add a virtual destructor to
        struct iproto_msg;
      
      * decode on malloc and add a virtual destructor to
        struct cmsg. By the way, it could allow to reuse
        this destructor for struct cbus_call_msg and
        struct relay_gc_msg.
      
      The way how is it solved by this patch has been chosen
      thanks to its simplicity.
      
      Closes #3828
      55f22ec2
    • Vladislav Shpilevoy's avatar
      Revert "box: store sql text and length in sql_request" · 388452ae
      Vladislav Shpilevoy authored
      This reverts commit bc9e41e9.
      
      This is one step forward to make sql_request store raw
      MessagePack.
      
      Part of #3828
      388452ae
    • Vladislav Shpilevoy's avatar
      sql: remove sync from sql_request/response · a33f778e
      Vladislav Shpilevoy authored
      sql_request is now decoded entirely in iproto thread
      in iproto_msg_decode unlike other similar requests
      like CALL or UPDATE which could be decoded in iproto
      too.
      
      But iproto thread pays for this optimization with a
      leak - sql_request.bind array is allocated on iproto
      thread region and never freed.
      
      A fix is to decode, apply and free bind array in tx
      thread in one place: tx_process_sql. For this
      sql_request should look like other requests: do not
      decode arrays, do not store sync, store fields as
      raw MsgPack.
      
      First step - remove sync.
      
      Part of #3828
      a33f778e
  15. Nov 29, 2018
    • Mergen Imeev's avatar
      iproto: remove iproto functions from execute.c · 474bdf36
      Mergen Imeev authored
      To make functions in execute.h more universal we should reduce
      their dependence on IPROTO. This patch removes IPROTO functions
      from execute.c.
      
      Needed for #3505
      474bdf36
    • Kirill Shcherbatov's avatar
      box: store sql text and length in sql_request · bc9e41e9
      Kirill Shcherbatov authored
      Refactored sql_request structure to store pointer to sql string
      data and it's length instead of pointer to msgpack
      representation.
      This is required to use this structure in sql.c where the query
      has a different semantics and can be obtained from stack as a C
      string.
      
      Needed for #3505.
      bc9e41e9
  16. Nov 09, 2018
    • Mergen Imeev's avatar
      sql: return all generated ids via IPROTO · ef67de41
      Mergen Imeev authored
      According to documentation some JDBC functions have an ability to
      return all ids that were generated in executed INSERT statement.
      This patch gives a way to implement such functionality. After
      this patch all ids autogenerated during VDBE execution will be
      saved and returned through IPROTO.
      
      Closes #2618
      ef67de41
  17. Apr 13, 2018
    • Vladislav Shpilevoy's avatar
      sql: get obuf for iproto response dump after execute() · 268304e0
      Vladislav Shpilevoy authored
      The #3255 fix was not applied to SQL after merge into
      2.0. This is the fix.
      
      The SQL execution must be separated from response encoding. At
      first, only after execution the obuf to write to is known. At
      second, in the future one SQL request will produce multiple
      SQL responses.
      
      Closes #3326
      268304e0
  18. Mar 30, 2018
  19. 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
  20. Jul 11, 2017
Loading