Tarantool development patches archive
 help / color / mirror / Atom feed
From: "n.pettik" <korablev@tarantool.org>
To: tarantool-patches@freelists.org
Cc: Kirill Shcherbatov <kshcherbatov@tarantool.org>
Subject: [tarantool-patches] Re: [PATCH v2 3/4] sql: refactor vdbe_emit_open_cursor calls
Date: Tue, 10 Jul 2018 21:22:17 +0300	[thread overview]
Message-ID: <7EFC158D-8B80-4B12-8293-514077BD6923@tarantool.org> (raw)
In-Reply-To: <66f3383d8d49c9ac059a72ff47bf235c9cf11da7.1531242355.git.kshcherbatov@tarantool.org>


> diff --git a/src/box/sql/insert.c b/src/box/sql/insert.c
> index 58e159c..62b85d5 100644
> --- a/src/box/sql/insert.c
> +++ b/src/box/sql/insert.c
> @@ -179,41 +179,51 @@ sqlite3TableAffinity(Vdbe * v, Table * pTab, int iReg)
> -static int
> -readsTable(Parse * p, Table * pTab)
> +static bool
> +vdbe_has_table_read(struct Parse *parser, const struct Table *table)
> {
> +		if (op->opcode == OP_OpenRead || op->opcode == OP_OpenWrite) {
> +			assert(i > 1);
> +			struct VdbeOp *space_var_op =
> +				sqlite3VdbeGetOp(v, i - 1);
> +			assert(space_var_op != NULL);
> +			assert(space_var_op->opcode == OP_LoadPtr);
> +			struct space *space = space_var_op->p4.space;
> +
> +			if (space->def->id == table->def->id)
> +				return true;
> +
> +			int idx_id = op->p2;
> +			for (struct Index *pIndex = table->pIndex;
> +				pIndex != NULL; pIndex = pIndex->pNext) {
> +				if (idx_id ==
> +				    SQLITE_PAGENO_TO_INDEXID(pIndex->tnum))
> +					return true;

Why do you need these index iterations? If spaces don’t match, what is the
point to check index ids? Btw, I deleted this code and all tests seem to pass.

The rest is OK in this patch.

  reply	other threads:[~2018-07-10 18:22 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-10 17:08 [tarantool-patches] [PATCH v2 0/4] sql: get rid off sqlite3NestedParse Kirill Shcherbatov
2018-07-10 17:08 ` [tarantool-patches] [PATCH v2 1/4] sql: get rid off sqlite3NestedParse in clean stats Kirill Shcherbatov
2018-07-10 17:52   ` [tarantool-patches] " n.pettik
2018-07-11  7:22     ` Kirill Shcherbatov
2018-07-11 12:19       ` n.pettik
2018-07-11 12:23         ` Kirill Shcherbatov
2018-07-11 13:16           ` n.pettik
2018-07-10 17:08 ` [tarantool-patches] [PATCH v2 2/4] sql: remove usless sqlite3NestedParse function Kirill Shcherbatov
2018-07-10 18:22   ` [tarantool-patches] " n.pettik
2018-07-11  7:22     ` Kirill Shcherbatov
2018-07-10 17:08 ` [tarantool-patches] [PATCH v2 3/4] sql: refactor vdbe_emit_open_cursor calls Kirill Shcherbatov
2018-07-10 18:22   ` n.pettik [this message]
2018-07-11  7:22     ` [tarantool-patches] " Kirill Shcherbatov
2018-07-10 17:08 ` [tarantool-patches] [PATCH v2 4/4] sql: remove OP_LoadPtr Kirill Shcherbatov
2018-07-10 18:34   ` [tarantool-patches] " n.pettik
2018-07-10 20:23     ` Vladislav Shpilevoy
2018-07-10 20:34       ` n.pettik
2018-07-11 13:45 ` [tarantool-patches] Re: [PATCH v2 0/4] sql: get rid off sqlite3NestedParse 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=7EFC158D-8B80-4B12-8293-514077BD6923@tarantool.org \
    --to=korablev@tarantool.org \
    --cc=kshcherbatov@tarantool.org \
    --cc=tarantool-patches@freelists.org \
    --subject='[tarantool-patches] Re: [PATCH v2 3/4] sql: refactor vdbe_emit_open_cursor calls' \
    /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