Skip to content
Snippets Groups Projects
Commit f7a3eff7 authored by Mergen Imeev's avatar Mergen Imeev Committed by Kirill Yukhin
Browse files

sql: rework vdbe_decode_msgpack_into_mem()

The original vdbe_decode_msgpack_into_mem() returns a MEM that contains
string and binary values as ephemeral. This patch renames this function
to mem_from_mp_ephemeral() and introduces new function mem_from_mp(),
which returns a MEM that contains string and binary values in newly
allocated memory.

This patch changes behavior for this query:

CREATE TABLE t1(m VARBINARY primary key);
INSERT INTO t1 VALUES(x'6178'), (x'6278'), (x'6379');
SELECT count(*), substr(m,2,1) AS mx FROM t1 GROUP BY mx;

Before this patch:

tarantool> SELECT count(*), substr(m,2,1) AS mx FROM t1 GROUP BY mx;
---
- metadata:
  - name: COLUMN_1
    type: integer
  - name: MX
    type: string
  rows:
  - [2, 'y']
  - [1, 'y']
...

After this patch.

tarantool> SELECT count(*), substr(m,2,1) AS mx FROM t1 GROUP BY mx;
---
- metadata:
  - name: COLUMN_1
    type: integer
  - name: MX
    type: string
  rows:
  - [2, 'x']
  - [1, 'y']
...

Part of #5818
Closes #5890
parent 1d24bef8
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment