From: Vladislav Shpilevoy <v.shpilevoy@tarantool.org>
To: "n.pettik" <korablev@tarantool.org>, tarantool-patches@freelists.org
Subject: [tarantool-patches] Re: [PATCH 09/10] sql: disable ON CONFLICT actions for indexes
Date: Mon, 27 Aug 2018 14:24:35 -0300 [thread overview]
Message-ID: <37357d61-cd5a-75ef-02e4-96b47467064e@tarantool.org> (raw)
In-Reply-To: <9C5A6A50-CB06-489D-A708-28DC346EA013@tarantool.org>
On 26/08/2018 16:44, n.pettik wrote:
>
>>> diff --git a/src/box/sql/insert.c b/src/box/sql/insert.c
>>> index 33d243414..9da971415 100644
>>> --- a/src/box/sql/insert.c
>>> +++ b/src/box/sql/insert.c
>>> @@ -354,11 +351,14 @@ sqlite3Insert(Parse * pParse, /* Parser context */
>>> }
>>> #endif /* SQLITE_OMIT_XFER_OPT */
>>> - /* Allocate registers for holding the tupleid of the new row,
>>> - * the content of the new row, and the assembled row record.
>>> + /*
>>> + * Allocate registers for holding the tupleid of the new
>>> + * row (if it isn't required first register will contain
>>> + * NULL), the content of the new row, and the assembled
>>> + * row record.
>>> */
>>> regTupleid = regIns = pParse->nMem + 1;
>>> - pParse->nMem += def->field_count + 1;
>>> + pParse->nMem += def->field_count + 2;
>>
>> Why +2? My presumption is because nMem was not
>> incremented one line above here 'regTupleid = regIns = pParse->nMem + 1;',
>> am I right? Why did it work before?
>
> As comments says: field_count for raw data to be encoded into tuple,
> one memory cell for encoded tuple, and the last one for rowid (or tupleid):
> it is used for ephemeral spaces to distinguish entries. If it is not required,
> then mem will contain NULL. Tuple id (regTupleId) comes first, then
> raw tuple and in the end - encoded msgpack.
Thanks for the explanation.
I understand the comment. But I do not understand why nMem is changed
to +1 in comparison with the previous version. Your comment is actually
the same as it was, but nMem is increased.
The comment is this in short: "Allocate registers for holding the
tupleid, content, assembled record.". Both before and after your patch.
But nMem is now +1.
next prev parent reply other threads:[~2018-08-27 17:24 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-12 14:12 [tarantool-patches] [PATCH 00/10] sql: cleanup in struct Index and struct Table Nikita Pettik
2018-08-12 14:12 ` [tarantool-patches] [PATCH 01/10] sql: remove suport of ALTER TABLE ADD COLUMN Nikita Pettik
2018-08-13 20:24 ` [tarantool-patches] " Vladislav Shpilevoy
2018-08-12 14:12 ` [tarantool-patches] [PATCH 02/10] sql: remove string of fields collation from Table Nikita Pettik
2018-08-13 20:24 ` [tarantool-patches] " Vladislav Shpilevoy
2018-08-12 14:12 ` [tarantool-patches] [PATCH 03/10] sql: remove index hash from struct Table Nikita Pettik
2018-08-13 20:24 ` [tarantool-patches] " Vladislav Shpilevoy
2018-08-12 14:13 ` [tarantool-patches] [PATCH 04/10] sql: remove flags " Nikita Pettik
2018-08-13 20:24 ` [tarantool-patches] " Vladislav Shpilevoy
2018-08-12 14:13 ` [tarantool-patches] [PATCH 05/10] sql: remove affinity string of columns from Index Nikita Pettik
2018-08-13 20:24 ` [tarantool-patches] " Vladislav Shpilevoy
2018-08-21 16:31 ` n.pettik
2018-08-24 21:04 ` Vladislav Shpilevoy
2018-08-26 19:45 ` n.pettik
2018-08-12 14:13 ` [tarantool-patches] [PATCH 06/10] sql: completely remove support of partial indexes Nikita Pettik
2018-08-13 20:24 ` [tarantool-patches] " Vladislav Shpilevoy
2018-08-21 16:31 ` n.pettik
2018-08-24 21:04 ` Vladislav Shpilevoy
2018-08-26 19:44 ` n.pettik
2018-08-12 14:13 ` [tarantool-patches] [PATCH 07/10] sql: remove index type from struct Index Nikita Pettik
2018-08-13 20:24 ` [tarantool-patches] " Vladislav Shpilevoy
2018-08-21 16:31 ` n.pettik
2018-08-12 14:13 ` [tarantool-patches] [PATCH 08/10] sql: use secondary indexes to process OP_Delete Nikita Pettik
2018-08-13 20:24 ` [tarantool-patches] " Vladislav Shpilevoy
2018-08-12 14:13 ` [tarantool-patches] [PATCH 09/10] sql: disable ON CONFLICT actions for indexes Nikita Pettik
2018-08-13 20:24 ` [tarantool-patches] " Vladislav Shpilevoy
2018-08-21 16:31 ` n.pettik
2018-08-24 21:04 ` Vladislav Shpilevoy
2018-08-26 19:44 ` n.pettik
2018-08-27 17:24 ` Vladislav Shpilevoy [this message]
2018-08-12 14:13 ` [tarantool-patches] [PATCH 10/10] sql: move autoincrement field number to server Nikita Pettik
2018-08-13 20:24 ` [tarantool-patches] " Vladislav Shpilevoy
2018-08-21 16:31 ` n.pettik
2018-08-24 21:03 ` Vladislav Shpilevoy
2018-08-26 19:44 ` n.pettik
2018-08-27 17:24 ` Vladislav Shpilevoy
2018-08-27 17:24 ` [tarantool-patches] Re: [PATCH 00/10] sql: cleanup in struct Index and struct Table Vladislav Shpilevoy
2018-08-29 14:11 ` 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=37357d61-cd5a-75ef-02e4-96b47467064e@tarantool.org \
--to=v.shpilevoy@tarantool.org \
--cc=korablev@tarantool.org \
--cc=tarantool-patches@freelists.org \
--subject='[tarantool-patches] Re: [PATCH 09/10] sql: disable ON CONFLICT actions for indexes' \
/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