From: Kirill Yukhin <kyukhin@tarantool.org>
To: tarantool-patches@freelists.org
Cc: Nikita Pettik <korablev@tarantool.org>
Subject: [tarantool-patches] Re: [PATCH 4/4] sql: replace pgnoRoot with struct space in BtCursor
Date: Tue, 20 Mar 2018 13:58:41 +0300 [thread overview]
Message-ID: <20180320105840.izfy5rpnz32fx6hj@tarantool.org> (raw)
In-Reply-To: <c3eff7bad14d7c3dc598ae031f3344383ab4148d.1521479592.git.korablev@tarantool.org>
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.
--
Thanks, Kirill
next prev parent reply other threads:[~2018-03-20 10:58 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 ` Kirill Yukhin [this message]
2018-03-20 12:28 ` [tarantool-patches] " n.pettik
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=20180320105840.izfy5rpnz32fx6hj@tarantool.org \
--to=kyukhin@tarantool.org \
--cc=korablev@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