[tarantool-patches] Re: [PATCH 1/2] sql: allow key_def to be NULL for ephemeral create
Vladislav Shpilevoy
v.shpilevoy at tarantool.org
Thu May 17 19:47:08 MSK 2018
Thanks for review fixes! See 4 comments below.
On 17/05/2018 18:49, Kirill Yukhin wrote:
> Hi Vlad,
>
> On 16 мая 18:24, Kirill Yukhin wrote:
>> There're many cases in SQL FE, where exact key def passed to
>> doesn't ephemeral table matter. It is used to store data only.
1. Can't read. Maybe 'where exact key def passed to ephemeral table doesn't matter' ?
>> Only field count makes sense in such a case. Hoewever it is
2. However.
>> passed separately (in P2). So, allow P4 field to be NULL for
>> OP_OpenTEphemeral. Update delte from routine from sql/delete.c
3. delete.
>> accordingly.
>>
>> Part of #3235
> Pasting updated patch from 1st round of review of 1/2 patch.
>
> diff --git a/src/box/sql/insert.c b/src/box/sql/insert.c
> index 22130ef..1ad7469 100644
> --- a/src/box/sql/insert.c
> +++ b/src/box/sql/insert.c
> @@ -566,13 +566,8 @@ sqlite3Insert(Parse * pParse, /* Parser context */
> regRec = sqlite3GetTempReg(pParse);
> regCopy = sqlite3GetTempRange(pParse, nColumn);
> regTempId = sqlite3GetTempReg(pParse);
> - struct key_def *def = key_def_new(nColumn + 1);
> - if (def == NULL) {
> - sqlite3OomFault(db);
> - goto insert_cleanup;
> - }
> sqlite3VdbeAddOp4(v, OP_OpenTEphemeral, srcTab, nColumn+1,
> - 0, (char*)def, P4_KEYDEF);
> + 0, (char*)NULL, P4_KEYDEF);
4. In the OP_OpenTEphemeral code you check for P4_KEYDEF absence, so you can use
AddOp2 here. And in other places.
More information about the Tarantool-patches
mailing list