Tarantool development patches archive
 help / color / mirror / Atom feed
From: "n.pettik" <korablev@tarantool.org>
To: Kirill Yukhin <kyukhin@tarantool.org>
Cc: tarantool-patches@freelists.org
Subject: [tarantool-patches] Re: [PATCH 4/4] sql: replace pgnoRoot with struct space in BtCursor
Date: Tue, 20 Mar 2018 15:28:36 +0300	[thread overview]
Message-ID: <216A377C-389E-4B6F-8E4D-BF8ED80F5633@tarantool.org> (raw)
In-Reply-To: <20180320105840.izfy5rpnz32fx6hj@tarantool.org>

[-- Attachment #1: Type: text/plain, Size: 1813 bytes --]


> On 20 Mar 2018, at 13:58, Kirill Yukhin <kyukhin@tarantool.org> wrote:
> 
> Hello,
> 
> Single comment.
> 
> On 19 мар 21:10, Nikita Pettik wrote:
>> Instead of passing encoded space id and index id to SQL bindings,
>> pointers to space and index are saved in cursor and passed implicitly.
>> Space and index lookups appear during execution of
>> OP_OpenRead/OP_OpenWrite once. Moreover, having struct space it has
>> become possible to remove several wrapper-function calls on insertions
>> and deletions by invoking sql_execute_dml().
>> 
>> Closes #3122
>> ---
>> src/box/sql.c              | 87 +++++++++++++++++++++++-----------------------
>> src/box/sql/cursor.h       |  3 +-
>> src/box/sql/tarantoolInt.h |  2 +-
>> src/box/sql/vdbe.c         | 24 ++++++-------
>> src/box/sql/vdbeInt.h      |  1 -
>> 5 files changed, 58 insertions(+), 59 deletions(-)
>> 
>> diff --git a/src/box/sql/vdbe.c b/src/box/sql/vdbe.c
>> index cd3321c4f..1ee8c4d7b 100644
>> --- a/src/box/sql/vdbe.c
>> +++ b/src/box/sql/vdbe.c
>> @@ -3209,16 +3214,17 @@ case OP_OpenWrite:
>> 	pCur = allocateCursor(p, pOp->p1, nField, CURTYPE_TARANTOOL);
>> 	if (pCur==0) goto no_mem;
>> 	pCur->nullRow = 1;
>> -	pCur->pgnoRoot = p2;
>> 
>> 	assert(p2 >= 1);
>> 	pBtCur = pCur->uc.pCursor;
>> -	pBtCur->pgnoRoot = p2;
>> +	pBtCur->space = space_by_id(SQLITE_PAGENO_TO_SPACEID(p2));
>> +	pBtCur->index = space_index(pBtCur->space, SQLITE_PAGENO_TO_INDEXID(p2));
>> +	assert(pBtCur->space != NULL && pBtCur->index != NULL);
>> 	pBtCur->eState = CURSOR_INVALID;
>> 	pBtCur->curFlags |= BTCF_TaCursor;
>> 	pCur->pKeyInfo = pKeyInfo;
>> 
>> -	open_cursor_set_hints:
>> +//	open_cursor_set_hints:
> Please, don't usse C++ style comments.

Fixed on branch (it is obviously tragic accident).


[-- Attachment #2: Type: text/html, Size: 7125 bytes --]

      reply	other threads:[~2018-03-20 12:28 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-19 18:10 [tarantool-patches] [PATCH 0/4] Remove space id and index id from cursor Nikita Pettik
2018-03-19 18:10 ` [tarantool-patches] [PATCH 1/4] Move space_is_system helper from CPP define guard Nikita Pettik
2018-03-19 18:10 ` [tarantool-patches] [PATCH 2/4] sql: rework OP_Clear internals Nikita Pettik
2018-03-20 10:54   ` [tarantool-patches] " Kirill Yukhin
2018-03-20 12:27     ` n.pettik
2018-03-19 18:10 ` [tarantool-patches] [PATCH 3/4] sql: remove struct ta_cursor and refactor BtCursor Nikita Pettik
2018-03-19 18:10 ` [tarantool-patches] [PATCH 4/4] sql: replace pgnoRoot with struct space in BtCursor Nikita Pettik
2018-03-20 10:58   ` [tarantool-patches] " Kirill Yukhin
2018-03-20 12:28     ` n.pettik [this message]

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=216A377C-389E-4B6F-8E4D-BF8ED80F5633@tarantool.org \
    --to=korablev@tarantool.org \
    --cc=kyukhin@tarantool.org \
    --cc=tarantool-patches@freelists.org \
    --subject='[tarantool-patches] Re: [PATCH 4/4] sql: replace pgnoRoot with struct space in BtCursor' \
    /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