Skip to content
Snippets Groups Projects
  1. Nov 11, 2021
    • Mergen Imeev's avatar
      sql: refactor SOUNDEX() function · 9d5c18bc
      Mergen Imeev authored
      Part of #4145
      9d5c18bc
    • Mergen Imeev's avatar
      sql: refactor UNICODE() function · 7a39cd74
      Mergen Imeev authored
      Part of #4145
      7a39cd74
    • Mergen Imeev's avatar
      sql: refactor VERSION() function · 6231417b
      Mergen Imeev authored
      Part of #4145
      6231417b
    • Mergen Imeev's avatar
      sql: rework UUID() function · adbafbf6
      Mergen Imeev authored
      This patch refactors UUID() function. Also, UUID(NULL) now returns NULL.
      
      Part of #4145
      adbafbf6
    • Mergen Imeev's avatar
      sql: refactor ROW_COUNT() function · 2e9a687b
      Mergen Imeev authored
      Part of #4145
      2e9a687b
    • Mergen Imeev's avatar
      sql: refactor ROUND() function · 7c7dfa8c
      Mergen Imeev authored
      Part of #4145
      7c7dfa8c
    • Mergen Imeev's avatar
      sql: refactor TYPEOF() function · 58f24643
      Mergen Imeev authored
      Part of #4145
      58f24643
    • Mergen Imeev's avatar
      sql: refactor ZEROBLOB() function · 1fd34910
      Mergen Imeev authored
      Part of #4145
      1fd34910
    • Mergen Imeev's avatar
      sql: rework RANDOMBLOB() function · 6d3af755
      Mergen Imeev authored
      This patch refactors RANDOMBLOB() function. Also, RANDOMBLOB(0) now
      returns empty string.
      
      part of #4145
      6d3af755
    • Mergen Imeev's avatar
      sql: refactor RANDOM() function · bd8dda5d
      Mergen Imeev authored
      Part of #4145
      bd8dda5d
    • Mergen Imeev's avatar
      sql: refactor PRINTF() function · 64ba5f7e
      Mergen Imeev authored
      Part of #4145
      64ba5f7e
    • Mergen Imeev's avatar
      sql: refactor LENGTH() function · 5aaca568
      Mergen Imeev authored
      Part of #4145
      5aaca568
    • Mergen Imeev's avatar
      sql: refactor HEX() function · 738db982
      Mergen Imeev authored
      Part of #4145
      738db982
    • Mergen Imeev's avatar
      sql: refactor GREATEST() and LEAST() functions · ce80ccf4
      Mergen Imeev authored
      Part of #4145
      ce80ccf4
    • Mergen Imeev's avatar
      sql: rework CHAR() function · f57c661d
      Mergen Imeev authored
      The CHAR() function now uses the ICU macro to get characters.
      
      Part of #4145
      f57c661d
    • Mergen Imeev's avatar
      sql: refactor LIKE() function · 02bbaa95
      Mergen Imeev authored
      Part of #4145
      02bbaa95
    • Mergen Imeev's avatar
      sql: rework SUBSTR() function · e01a8ff2
      Mergen Imeev authored
      This patch makes SUBSTR() work according to ANSI rules for SUBSTRING()
      function. Also, SUBSTR() can now work correctly with large INTEGER
      values. The SUBSTR() syntax has not changed.
      
      Part of #4145
      
      @TarantoolBot document
      Title: SUBSTR() function
      
      SUBSTR() now works according to the ANSI rules for SUBSTRING().
      
      Rules for SUBSTR() with 2 arguments:
      1) let the first argument be VALUE, and the second argument be START;
      2) VALUE should be STRING or VARBINARY, START should be INTEGER;
      3) if any of arguments is NULL, NULL is returned;
      4) let POS be MAX(START - 1, 0), END be length of the VALUE;
      5) if POS >= END, the result is empty string;
      6) if POS < END, the result will be substring of VALUE, starting from
         the position POS to the position END.
      
      Rules for SUBSTR() with 3 arguments:
      1) let the first argument be VALUE, the second argument be START, and
         the third argument be LENGTH;
      2) VALUE should be STRING or VARBINARY, START and LENGTH should be
         INTEGERs;
      3) if any of arguments is NULL, NULL is returned;
      4) if LENGTH < 0, an error is thrown;
      5) let POS be MAX(START - 1, 0), END be START + LENGTH - 1;
      6) if POS >= END, the result is empty string;
      7) if POS < END, the result will be substring of VALUE, starting from
         the position POS to the position END.
      e01a8ff2
    • Mergen Imeev's avatar
      sql: rework POSITION() function · 3ec6042f
      Mergen Imeev authored
      This patch is a refactoring of POSITION(). In addition, VARBINARY
      arguments can now be used in this function. In addition, POSITION() now
      uses ICU functions instead of self-created.
      
      Part of #4145
      3ec6042f
    • Mergen Imeev's avatar
      sql: rework TRIM() function · a18389b2
      Mergen Imeev authored
      This patch refactoring TRIM() and fixes an issue with incorrect trimming
      of some VARBINARY values. Also, TRIM() now use ICU functions instead of
      self-created.
      
      Part of #4415
      a18389b2
    • Mergen Imeev's avatar
      sql: refactor NULLIF() function · d8b35e15
      Mergen Imeev authored
      Part of #4145
      d8b35e15
    • Mergen Imeev's avatar
      sql: refactor UPPER() and LOWER() functions · 196ad6e2
      Mergen Imeev authored
      Part of #4145
      196ad6e2
    • Mergen Imeev's avatar
      sql: rework CHAR_LENGTH() function · c98e8531
      Mergen Imeev authored
      The CHAR_LENGTH() and CHARACTER_LENGTH() functions now use ICU functions
      to determine the length of a string.
      
      Part of #4145
      
      @TarantoolBot document
      Title: Invalid UTF-8 values and ICU
      
      Invalid UTF-8 values may be handled differently depending on the ICU
      version. For example, for this request:
      ```
      SELECT CHAR_LENGTH(CAST(x'f0808080' AS STRING));
      ```
      
      On `centos 7` with `libicu-devel-50.2-4.el7_7.x86_64` the result will
      be:
      ```
      tarantool> box.execute([[SELECT CHAR_LENGTH(CAST(x'f0808080' AS STRING));]])
      ---
      - metadata:
        - name: COLUMN_1
          type: integer
        rows:
        - [1]
      ...
      ```
      
      On `ubuntu 20.04` with `libicu-dev` version `66.1-2ubuntu2` the result
      will be:
      ```
      tarantool> box.execute([[SELECT CHAR_LENGTH(CAST(x'f0808080' AS STRING));]])
      ---
      - metadata:
        - name: COLUMN_1
          type: integer
        rows:
        - [4]
      ...
      ```
      c98e8531
    • Mergen Imeev's avatar
      sql: refactor ABS() funcion · 066b05db
      Mergen Imeev authored
      Part of #4145
      066b05db
    • Yaroslav Lobankov's avatar
      ci: add integration check for tarantool-php/client · 916ba7fa
      Yaroslav Lobankov authored
      This patch extends the 'integration.yml' workflow and adds a new
      workflow call for running tests to verify integration between tarantool
      and the tarantool-php/client connector.
      
      Part of #5265
      Part of #6056
      Closes #6594
      916ba7fa
    • Yaroslav Lobankov's avatar
      ci: add check for tarantool-python connector · 03bdb5ff
      Yaroslav Lobankov authored
      This patch extends the 'integration.yml' workflow and adds a new
      workflow call for running tests to verify integration between tarantool
      and tarantool-python connector.
      
      Part of #5265
      Part of #6056
      Closes #6584
      03bdb5ff
    • Vladimir Davydov's avatar
      5ee36161
    • Vladimir Davydov's avatar
      1adc7743
    • Vladimir Davydov's avatar
      iproto: use iostream abstraction · 9b4ab9fe
      Vladimir Davydov authored
      Instead of writing to the socket fd directly using sio, we wrap it in
      iostream. This will allow us to use complex communication protocols in
      iproto.
      
      One thing that should be noted about this patch is how we handle
      ev_io_start when we need to wait for the socket to become readable or
      writable. Since iostream_write can block because it wants to read from
      the socket and iostream_read can block because it wants to write to the
      socket, we might need to update input/output events before ev_io_start.
      Since ev_io events can't be updated while ev_io is active, we need to
      stop ev_io for this.
      9b4ab9fe
    • Vladimir Davydov's avatar
      iproto: add helpers to signal input and output · 91166ca8
      Vladimir Davydov authored
      It's better than using ev_feed_event and ev_is_active directly.
      
      Also, let's use EV_CUSTOM instead EV_READ/EV_WRITE for signaling,
      to emphasize that this is an artificial event, which has nothing
      to do with fd read/write readiness. It's okay, because input/output
      callbacks don't use events at all.
      91166ca8
    • Vladimir Davydov's avatar
      iproto: add iproto_connection_name helper · 61f7a316
      Vladimir Davydov authored
      It's better than using sio_socketname directly.
      61f7a316
    • Vladimir Davydov's avatar
      iproto: check connection state instead of fd · 94e39696
      Vladimir Davydov authored
      iproto_connection->input.fd != -1 iff state != IPROTO_CONNECTION_ALIVE.
      Let's check the state instead of input.fd or output.fd, because it's
      easier for understanding.
      
      While we are at it, drop the stale comment to iproto_connection_is_idle:
      the function doesn't use evio_has_fd at all.
      94e39696
    • Vladimir Davydov's avatar
      replication: do not create iostream for relay · 981f230a
      Vladimir Davydov authored
      It's not needed - we can use the iostream created in iproto
      (just like a raw fd).
      981f230a
    • Vladimir Davydov's avatar
      replication: do not create iostream for applier writer and relay reader · a8fb66d9
      Vladimir Davydov authored
      It's not needed - we can use the applier/relay io directly
      (just like a raw fd).
      a8fb66d9
    • Vladimir Davydov's avatar
      coio: drop coio_write_fd_timeout · b39cf283
      Vladimir Davydov authored
      Use coio_write_timeout_noxc instead.
      b39cf283
    • Vladimir Davydov's avatar
      fde45b50
    • Vladimir Davydov's avatar
      Introduce iostream wrapper for socket I/O · 4f84859d
      Vladimir Davydov authored
      Reading/writing fd directly doesn't let us add any data processing
      transparently to the users. To overcome this limitation, let's wrap fd
      in struct iostream. The new struct exposes virtual read/write methods,
      which should be defined by a concrete implementation. It also allows to
      access the associated fd, which is needed to poll the stream via libev.
      For now, there's the only iostream implementation - plain iostream
      without any processing - but we may add other implementations in future.
      
      Apart from introducing the iostream struct, this patch also makes coio
      helpers use it. From now on, coio read/write methods take iostream
      instead of ev_io and create ev_io internally (in coio_wait). This is
      fine, because creation of a new ev_io on stack is cheap.
      
      Basically, this patch updates all coio users so that they call
      iostream_create and iostream_close instead of coio_create and
      coio_close_io. Plus, it adds a call to iostream_destroy, because in
      contrast to ev_io, iostream must be destroyed explicitly.
      4f84859d
    • Vladimir Davydov's avatar
      Rename local variables coio -> io · f35c647a
      Vladimir Davydov authored
      We are going to wrap fd in iostream struct and pass it to all coio
      methods. When we do that, the name 'coio' won't make any sense. Let's
      switch to 'io'. We do renaming in a separate patch to reduce the blast
      radius of the main patch.
      f35c647a
    • Vladimir Davydov's avatar
      coio: pass fd to coio_service callback · 4f73a2e4
      Vladimir Davydov authored
      Currently, we create and pass a new ev_io object wrapping the accepted
      socket fd. Let's pass fd directly instead.
      
      This is a step towards hiding all ev_io manipulations in coio internals
      so that coio users don't have to deal with ev_io directly.
      4f73a2e4
    • Vladimir Davydov's avatar
      coio: pass fd to coio_accept · 577a640a
      Vladimir Davydov authored
      coio_accept uses fd from ev_io passed to it. Let's pass fd explicitly
      and use coio_wait for waiting for the socket to become ready.
      
      This is a step towards hiding all ev_io manipulations in coio internals
      so that coio users don't have to deal with ev_io directly.
      
      Drop unused coio_bind declaration while we are at it (there's no
      function definition).
      577a640a
    • Vladimir Davydov's avatar
      coio: return fd from coio_connect · 2db0741b
      Vladimir Davydov authored
      coio_connect sets fd in ev_io passed to it. Let's return fd explicitly
      and remove the ev_io argument (we can use coio_wait, which creates a
      temporary ev_io object, inside coio_connect - it's cheap).
      
      This is a step towards hiding all ev_io manipulations in coio internals
      so that coio users don't have to deal with ev_io directly.
      2db0741b
Loading