From: Vladislav Shpilevoy <v.shpilevoy@tarantool.org> To: "n.pettik" <korablev@tarantool.org>, tarantool-patches@freelists.org Subject: [tarantool-patches] Re: [PATCH v2 4/4] sql: remove OP_LoadPtr Date: Tue, 10 Jul 2018 23:23:51 +0300 [thread overview] Message-ID: <e25ac786-bb45-a7e4-444b-d2b77b57d6df@tarantool.org> (raw) In-Reply-To: <450C4EA0-0803-4298-A3D4-D80A97145B66@tarantool.org> On 10/07/2018 21:34, n.pettik wrote: > >> @@ -2969,12 +2964,9 @@ sql_create_index(struct Parse *parse, struct Token *token, >> goto exit_create_index; >> >> sql_set_multi_write(parse, true); >> - >> - >> - sqlite3VdbeAddOp2(v, OP_SIDtoPtr, BOX_INDEX_ID, >> - index_space_ptr_reg); >> - sqlite3VdbeAddOp4Int(v, OP_OpenWrite, iCursor, 0, >> - index_space_ptr_reg, 6); >> + sqlite3VdbeAddOp4(v, OP_OpenWrite, iCursor, 0, 0, >> + (void *)space_by_id(BOX_INDEX_ID), >> + P4_SPACEPTR); >> sqlite3VdbeChangeP5(v, OPFLAG_SEEKEQ); > > Wait, AFAIK SIDtoPtr was used deliberately taking into consideration > the fact that DDL may change ptr to space. So conversion id -> space ptr > is delayed until vdbe execution (right before cursor opening). Am I wrong? Yes, you are wrong here, because it was used to restore pointer to struct space "_index", but "_index" is a system space, and it is never altered. So pointer to "_index" is always valid, and it makes no sense to restore it on runtime. >
next prev parent reply other threads:[~2018-07-10 20:23 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 ` [tarantool-patches] " n.pettik 2018-07-11 7:22 ` 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 [this message] 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=e25ac786-bb45-a7e4-444b-d2b77b57d6df@tarantool.org \ --to=v.shpilevoy@tarantool.org \ --cc=korablev@tarantool.org \ --cc=tarantool-patches@freelists.org \ --subject='[tarantool-patches] Re: [PATCH v2 4/4] sql: remove OP_LoadPtr' \ /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