From: Vladimir Davydov <vdavydov.dev@gmail.com> To: imeevma@tarantool.org Cc: tarantool-patches@freelists.org Subject: Re: [PATCH v1 1/1] sql: remove _sql_stat1 and _sql_stat4 system tables Date: Wed, 3 Apr 2019 11:35:54 +0300 [thread overview] Message-ID: <20190403083554.m4ddy2djjkoqxtdj@esperanza> (raw) In-Reply-To: <ed5a8672d2fdcb922358f0c62c95d308920e0b1f.1554196491.git.imeevma@gmail.com> On Tue, Apr 02, 2019 at 12:25:49PM +0300, imeevma@tarantool.org wrote: > These tables won't be used anymore and should be deleted. Please mention that this breaks backward compatibility. > diff --git a/src/box/sql.c b/src/box/sql.c > index 4fac020..7beeee1 100644 > --- a/src/box/sql.c > +++ b/src/box/sql.c > @@ -87,7 +87,7 @@ sql_load_schema() > * statistics (_sql_stat1 and _sql_stat4). Thus, we can > * skip statistics loading. > */ > - struct space *stat = space_by_id(BOX_SQL_STAT1_ID); > + struct space *stat = space_by_name("_sql_stat1"); I don't understand this change: even though you removed the tables you still expect them to be accessible by name here and in a few other places. At any rate, the comment above needs to be refreshed. > assert(stat != NULL); > if (stat->def->field_count == 0) > return; > @@ -2478,19 +2460,17 @@ sql_drop_index(struct Parse *parse_context, struct SrcList *index_name_list, > } > goto exit_drop_index; > } > - struct index *index = space_index(space, index_id); > - assert(index != NULL); > > /* > * Generate code to remove entry from _index space > * But firstly, delete statistics since schema > * changes after DDL. > */ > - sql_clear_stat_spaces(parse_context, table_name, index->def->name); > int record_reg = ++parse_context->nMem; > int space_id_reg = ++parse_context->nMem; > + int index_id_reg =++parse_context->nMem; Nit: a space is missing. Anyway, this change looks like it doesn't have anything to do with stat tables removal. If so, please factor it out into a separate patch with a proper justification. > sqlVdbeAddOp2(v, OP_Integer, space->def->id, space_id_reg); > - sqlVdbeAddOp2(v, OP_Integer, index_id, space_id_reg + 1); > + sqlVdbeAddOp2(v, OP_Integer, index_id, index_id_reg); > sqlVdbeAddOp3(v, OP_MakeRecord, space_id_reg, 2, record_reg); > sqlVdbeAddOp2(v, OP_SDelete, BOX_INDEX_ID, record_reg); > sqlVdbeChangeP5(v, OPFLAG_NCHANGE);
prev parent reply other threads:[~2019-04-03 8:35 UTC|newest] Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top 2019-04-02 9:25 imeevma 2019-04-02 16:03 ` [tarantool-patches] " Imeev Mergen 2019-04-03 8:35 ` Vladimir Davydov [this message]
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=20190403083554.m4ddy2djjkoqxtdj@esperanza \ --to=vdavydov.dev@gmail.com \ --cc=imeevma@tarantool.org \ --cc=tarantool-patches@freelists.org \ --subject='Re: [PATCH v1 1/1] sql: remove _sql_stat1 and _sql_stat4 system tables' \ /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