From: Vladislav Shpilevoy <v.shpilevoy@tarantool.org> To: Kirill Yukhin <kyukhin@tarantool.org> Cc: tarantool-patches@freelists.org Subject: [tarantool-patches] Re: [PATCH 1/3] sql: fetch primary index for affinity only Date: Fri, 1 Jun 2018 21:00:49 +0300 [thread overview] Message-ID: <5bc1cc0b-529b-62b7-6ed3-36f657db1cd2@tarantool.org> (raw) In-Reply-To: <dec437baf8197237dbecd6bcc879a67deeea92eb.1527865931.git.kyukhin@tarantool.org> Hello. Thanks for the patch! See 2 comments below. On 01/06/2018 18:16, Kirill Yukhin wrote: > 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. 1. What are calculated columns? > > Part of #3235 > --- > src/box/sql/delete.c | 54 ++++++++++++++++++++++++++++++++++++---------------- > 1 file changed, 38 insertions(+), 16 deletions(-) > > diff --git a/src/box/sql/delete.c b/src/box/sql/delete.c > index ddad54b..28713c8 100644 > --- a/src/box/sql/delete.c > +++ b/src/box/sql/delete.c > @@ -183,6 +183,16 @@ sql_table_delete_from(struct Parse *parse, struct SrcList *tab_list, > struct NameContext nc; > memset(&nc, 0, sizeof(nc)); > nc.pParse = parse; > + if (tab_list->a[0].pTab == NULL) { > + struct Table *t = malloc(sizeof(struct Table)); > + if (t == NULL) { > + sqlite3OomFault(parse->db); > + goto delete_from_cleanup; > + } > + assert(space != NULL); > + t->def = space->def; > + tab_list->a[0].pTab = t; 2. Why can not you declare struct Table on the stack at the top of this function, and here use its address? Can this pTab be used out of sql_table_delete_from()? And I do not see where do you delete this table. > + } > nc.pSrcList = tab_list; > if (sqlite3ResolveExprNames(&nc, where)) > goto delete_from_cleanup;
next prev parent reply other threads:[~2018-06-01 18:00 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 ` Vladislav Shpilevoy [this message] 2018-06-07 12:03 ` [tarantool-patches] " Kirill Yukhin 2018-06-07 15:01 ` Vladislav Shpilevoy 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=5bc1cc0b-529b-62b7-6ed3-36f657db1cd2@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