From: Vladislav Shpilevoy <v.shpilevoy@tarantool.org> To: tarantool-patches@freelists.org, Kirill Yukhin <kyukhin@tarantool.org> Subject: [tarantool-patches] Re: [PATCH 1/3] sql: fetch primary index for affinity only Date: Thu, 7 Jun 2018 18:01:24 +0300 [thread overview] Message-ID: <5b1597db-8cba-1c71-2337-5d570fa3bc3a@tarantool.org> (raw) In-Reply-To: <20180607120324.h2laztbxfnhnpe2s@tarantool.org> Hello. Thanks for the fixes! See one minor comment below. And I do not see the new commit on the branch. Branch still has the old one + 2 my review fixes commits. > -- > Regards, Kirill Yukhin > > commit 6ef9616b71c6e253336c012442b90c4d2ebb2c55 > Author: Kirill Yukhin <kyukhin@tarantool.org> > Date: Wed May 23 15:31:37 2018 +0300 > > sql: fetch primary index for affinity only > > This small patch removes usages of primary index throughout > code sql_table_delete_from, limiting use to fetching of > affinities only. We cannot use space_def here, since primary > index might contain calculated columns. > > Part of #3235 > > diff --git a/src/box/sql/delete.c b/src/box/sql/delete.c > index ddad54b..a4a8da6 100644 > --- a/src/box/sql/delete.c > +++ b/src/box/sql/delete.c > @@ -325,8 +338,14 @@ sql_table_delete_from(struct Parse *parse, struct SrcList *tab_list, > (void *)space, P4_SPACEPTR); > sqlite3VdbeAddOp3(v, OP_OpenWrite, tab_cursor, > table->tnum, space_ptr_reg); > - sql_vdbe_set_p4_key_def(parse, pk); > - VdbeComment((v, "%s", pk->zName)); > + struct key_def *def = key_def_dup(pk_def); > + if (def == NULL) { > + sqlite3OomFault(parse->db); > + goto delete_from_cleanup; > + } > + sqlite3VdbeAppendP4(v, def, P4_KEYDEF); Why could not you at first dup key_def, and then just use AddOp4? Instead of AddOp3 + dup + AppendP4. > + > + VdbeComment((v, "%s", space->index[0]->def->name)); > > if (one_pass == ONEPASS_MULTI) > sqlite3VdbeJumpHere(v, iAddrOnce);
next prev parent reply other threads:[~2018-06-07 15:01 UTC|newest] Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top 2018-06-01 15:16 [tarantool-patches] [PATCH 0/3] sql: implement point where for DELETE stmts Kirill Yukhin 2018-06-01 15:16 ` [tarantool-patches] [PATCH 1/3] sql: fetch primary index for affinity only Kirill Yukhin 2018-06-01 18:00 ` [tarantool-patches] " Vladislav Shpilevoy 2018-06-07 12:03 ` Kirill Yukhin 2018-06-07 15:01 ` Vladislav Shpilevoy [this message] 2018-06-08 8:25 ` Kirill Yukhin 2018-06-01 15:16 ` [tarantool-patches] [PATCH 2/3] sql: remove expressions from SQL indexes Kirill Yukhin 2018-06-01 18:00 ` [tarantool-patches] " Vladislav Shpilevoy 2018-06-01 15:16 ` [tarantool-patches] [PATCH 3/3] sql: implement point where for DELETE stmts Kirill Yukhin 2018-06-01 18:00 ` [tarantool-patches] " Vladislav Shpilevoy 2018-06-18 2:11 ` n.pettik 2018-06-18 10:44 ` Vladislav Shpilevoy 2018-06-18 10:51 ` Vladislav Shpilevoy 2018-06-18 12:29 ` n.pettik 2018-06-18 12:40 ` Vladislav Shpilevoy 2018-06-18 14:00 ` n.pettik 2018-06-18 14:17 ` Vladislav Shpilevoy 2018-06-19 8:03 ` Kirill Yukhin 2018-06-14 12:41 ` [tarantool-patches] Re: [PATCH 0/3] " 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=5b1597db-8cba-1c71-2337-5d570fa3bc3a@tarantool.org \ --to=v.shpilevoy@tarantool.org \ --cc=kyukhin@tarantool.org \ --cc=tarantool-patches@freelists.org \ --subject='[tarantool-patches] Re: [PATCH 1/3] sql: fetch primary index for affinity only' \ /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