From: Alexander Turenko <alexander.turenko@tarantool.org>
To: Nikita Tatunov <hollow653@gmail.com>
Cc: tarantool-patches@freelists.org
Subject: [tarantool-patches] Re: [PATCH] sql: assertion fail on nested select
Date: Tue, 17 Jul 2018 16:59:34 +0300 [thread overview]
Message-ID: <20180717135933.cc2g7rlbb2xl4kgo@tkn_work_nb> (raw)
In-Reply-To: <1530533500-9666-1-git-send-email-hollow653@gmail.com>
Hi Nikita!
Please, consider comments below.
WBR, Alexander Turenko.
On Mon, Jul 02, 2018 at 03:11:40PM +0300, N.Tatunov wrote:
> To optimize the select-subquery tarantool uses
> subquery flattening function which is only used
> with respect to some restrictions. One of them
> was implemented improperly.
>
Be certain: 'some restriction' and just 'improperly' are not good
problem descriptions.
I would use wording like the following.
> When a subquery is a compound select the subquery flattening
> optimization verify whether the ORDER BY clause presents, but only for
> the last subquery component. The commit fixes that to verify all
> subquery components.
> In case of ORDER BY in non-last component of a compound select the
> error should be raised. Accepting of such subqueries for the
> flattening optimization prevents the error to be raised afterwards.
> Instead it stuck into assertion violation inside flattenSubquery (see
> the issue).
I checked sqlite3 check-in 8000d230 (it is immediate predecessor of
c9104b59 where the flattening optimization seems to be changed, but
tarantool didn't updated with that check-in). It has the assert, but has
no a change like yours, and correctly shows the following error:
Error: ORDER BY clause should come after UNION ALL not before
Why it is so?
> +test:do_catchsql_test(
> + "subquery-9.3",
> + [[
> + SELECT * FROM (SELECT * FROM table1 ORDER BY 1 UNION All
> + SELECT * FROM table1 UNION All
> + SELECT * FROM table1);
All -> ALL
next prev parent reply other threads:[~2018-07-17 13:59 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-02 12:11 [tarantool-patches] " N.Tatunov
2018-07-17 13:59 ` Alexander Turenko [this message]
2018-07-18 12:34 ` [tarantool-patches] " Nikita Tatunov
2018-07-18 13:41 ` Nikita Tatunov
[not found] ` <07E4F387-E976-432B-A80B-E01B40BCF126@corp.mail.ru>
2018-07-18 15:37 ` Nikita Tatunov
2018-07-18 16:51 ` Alexander Turenko
2018-07-18 20:36 ` n.pettik
2018-07-19 12:47 ` Nikita Tatunov
2018-07-19 13:09 ` n.pettik
2018-07-19 15:22 ` Vladislav Shpilevoy
2018-07-20 13:21 ` 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=20180717135933.cc2g7rlbb2xl4kgo@tkn_work_nb \
--to=alexander.turenko@tarantool.org \
--cc=hollow653@gmail.com \
--cc=tarantool-patches@freelists.org \
--subject='[tarantool-patches] Re: [PATCH] sql: assertion fail on nested select' \
/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