From: "n.pettik" <korablev@tarantool.org> To: tarantool-patches@freelists.org Cc: "N. Tatunov" <hollow653@gmail.com> Subject: [tarantool-patches] Re: [PATCH] sql: analyze on VIEW lead to an assertion Date: Thu, 3 May 2018 02:33:55 +0300 [thread overview] Message-ID: <1CAC631B-C9A4-4DF3-9C89-706865E4AB4E@tarantool.org> (raw) In-Reply-To: <1525267540-23152-1-git-send-email-hollow653@gmail.com> Generally, patch looks OK to me. I can provide only several minor comments. > On 2 May 2018, at 16:25, N.Tatunov <hollow653@gmail.com> wrote: > > Currently analyze directly on VIEW or > analyze on db containing a VIEW leads to an > assertion. This patch adds few appropriate > check to fix this problem. From my point of view, sentence like ‘patch solves this problem' doesn’t seem to be informative enough. So I would better describe how you fixed problem, sort of: "ANALYZE statement directly on VIEW raises error, meanwhile ANALYZE on the whole database just skips views.” It would be great, if you rephrased somehow your last message. Moreover, you are capable of using up to 72 chars in one line for commit message body. Do not make lines be too short - it is not elegant. > - if ((pTab = sqlite3LocateTable(pParse, 0, z)) != 0) { > - analyzeTable(pParse, pTab, 0); > + if ((pTab = sqlite3LocateTable(pParse, 0, z))) { We use explicit NULL checks: != NULL. > + if (space_is_view(pTab)) > + sqlite3ErrorMsg(pParse, "VIEWs aren't " > + "allowed to be analyzed”); I would better use singular form: “VIEW isn’t …"; > +test:do_catchsql_test( > + "analyzeD-1.9", > + [[ > + CREATE TABLE table1(id INT PRIMARY KEY, a INT); > + CREATE VIEW v AS SELECT * FROM table1; > + ANALYZE; > + ]], { > + -- <analyzeD-1.9> > + 0 > + -- <analyzeD-1.9> > + }) Here I would also check that the name of view doesn’t accidentally trap into stat spaces. > +test:do_catchsql_test( > + "analyzeD-1.10", > + [[ > + ANALYZE v; > + ]], { > + -- <analyzeD-1.10> > + 1, "VIEWs aren't allowed to be analyzed" > + -- <analyzeD-1.10> > + }) The same is here: also check that stat spaces don’t contain statistics for table called‘V’.
next prev parent reply other threads:[~2018-05-02 23:34 UTC|newest] Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top 2018-05-02 13:25 [tarantool-patches] " N.Tatunov 2018-05-02 23:33 ` n.pettik [this message] 2018-05-03 17:16 ` [tarantool-patches] " Hollow111 2018-05-03 17:19 ` Hollow111 2018-05-03 18:28 ` n.pettik 2018-05-15 15:56 ` 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=1CAC631B-C9A4-4DF3-9C89-706865E4AB4E@tarantool.org \ --to=korablev@tarantool.org \ --cc=hollow653@gmail.com \ --cc=tarantool-patches@freelists.org \ --subject='[tarantool-patches] Re: [PATCH] sql: analyze on VIEW lead to an assertion' \ /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