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
Showing
- src/box/sql/mem.c 14 additions, 1 deletionsrc/box/sql/mem.c
- src/box/sql/mem.h 16 additions, 2 deletionssrc/box/sql/mem.h
- src/box/sql/vdbe.c 1 addition, 19 deletionssrc/box/sql/vdbe.c
- src/box/sql/vdbeaux.c 1 addition, 1 deletionsrc/box/sql/vdbeaux.c
- src/box/sql/vdbemem.c 1 addition, 1 deletionsrc/box/sql/vdbemem.c
Loading
Please register or sign in to comment