Tarantool development patches archive
 help / color / mirror / Atom feed
From: Vladislav Shpilevoy <v.shpilevoy@tarantool.org>
To: Kirill Yukhin <kyukhin@tarantool.org>
Cc: tarantool-patches@freelists.org
Subject: [tarantool-patches] Re: [PATCH 1/2] sql: allow key_def to be NULL for ephemeral create
Date: Thu, 17 May 2018 19:47:08 +0300	[thread overview]
Message-ID: <e05a7dd4-1963-35d9-870f-73ed55151ef0@tarantool.org> (raw)
In-Reply-To: <20180517154939.ya64lgo4ifipmofk@tarantool.org>

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.

  reply	other threads:[~2018-05-17 16:47 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-16 15:24 [tarantool-patches] [PATCH 0/2] sql: refactor DELETE STMT translation Kirill Yukhin
2018-05-16 15:24 ` [tarantool-patches] [PATCH 1/2] sql: allow key_def to be NULL for ephemeral create Kirill Yukhin
2018-05-17 15:49   ` [tarantool-patches] " Kirill Yukhin
2018-05-17 16:47     ` Vladislav Shpilevoy [this message]
2018-05-18  6:57       ` Kirill Yukhin
2018-05-18 10:33         ` Vladislav Shpilevoy
2018-05-18 10:48           ` Kirill Yukhin
2018-05-18 10:50             ` Vladislav Shpilevoy
2018-05-16 15:24 ` [tarantool-patches] [PATCH 2/2] sql: refactor delete routines Kirill Yukhin
2018-05-16 16:29   ` [tarantool-patches] " Kirill Yukhin
2018-05-17 14:23     ` Vladislav Shpilevoy
2018-05-17 15:48       ` Kirill Yukhin
2018-05-17 16:47         ` Vladislav Shpilevoy
2018-05-18  6:56           ` Kirill Yukhin
2018-05-18 10:33             ` Vladislav Shpilevoy
2018-05-17 15:18     ` Vladislav Shpilevoy
2018-05-18 11:01 ` [tarantool-patches] Re: [PATCH 0/2] sql: refactor DELETE STMT translation Kirill Yukhin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e05a7dd4-1963-35d9-870f-73ed55151ef0@tarantool.org \
    --to=v.shpilevoy@tarantool.org \
    --cc=kyukhin@tarantool.org \
    --cc=tarantool-patches@freelists.org \
    --subject='[tarantool-patches] Re: [PATCH 1/2] sql: allow key_def to be NULL for ephemeral create' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox