From: Vladislav Shpilevoy <v.shpilevoy@tarantool.org>
To: tarantool-patches@freelists.org, ImeevMA <imeevma@tarantool.org>
Subject: [tarantool-patches] Re: [PATCH v2 1/1] sql: COLLATE after LIMIT throws an error
Date: Mon, 21 May 2018 17:45:23 +0300 [thread overview]
Message-ID: <6395034d-3cd9-f26f-a38e-561e86fcbdb7@tarantool.org> (raw)
In-Reply-To: <13ccf5856ab21d72c71a3fc5f65739871d824b40.1526913411.git.imeevma@tarantool.org>
Thanks for the patch! Looks like you did fix not all my comments from the
previous review.
On 21/05/2018 17:36, ImeevMA wrote:
> Originally, SQLite3 execute queries with COLLATE after LIMIT like
> "SELECT * FROM test LIMIT N COLLATE not_exist"
> and queries without COLLATE like
> "SELECT * FROM test LIMIT N"
> the same way.
>
> From this patch on queries with COLLATE after LIMIT
> or OFFSET throws a syntax error.
>
> Closes #3010
> ---
> src/box/sql/select.c | 5 +++++
> test/sql/collation.result | 41 +++++++++++++++++++++++++++++++++++++++++
> test/sql/collation.test.lua | 19 +++++++++++++++++++
> 3 files changed, 65 insertions(+)
> create mode 100644 test/sql/collation.result
> create mode 100644 test/sql/collation.test.lua
>
> diff --git a/src/box/sql/select.c b/src/box/sql/select.c
> index 29075d5..b11e688 100644
> --- a/src/box/sql/select.c
> +++ b/src/box/sql/select.c
> @@ -1993,6 +1993,11 @@ computeLimitRegisters(Parse * pParse, Select * p, int iBreak)
> sqlite3ExprCacheClear(pParse);
> assert(p->pOffset == 0 || p->pLimit != 0);
> if (p->pLimit) {
> + if((p->pLimit->flags & EP_Collate) != 0 ||
> + (p->pOffset && (p->pOffset->flags & EP_Collate) != 0)) {
> + sqlite3ErrorMsg(pParse, "near \"COLLATE\": syntax error");
> + return;
> + }
1. Still bad indentation.
> diff --git a/test/sql/collation.result b/test/sql/collation.result
> new file mode 100644
> index 0000000..3a4f81f
> --- /dev/null
> +++ b/test/sql/collation.result
2. Still no test on OFFSET ... COLLATE.
next prev parent reply other threads:[~2018-05-21 14:45 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-21 14:36 [tarantool-patches] " ImeevMA
2018-05-21 14:45 ` Vladislav Shpilevoy [this message]
2018-05-21 15:16 ` [tarantool-patches] Re: [tarantool-patches] " Мерген Имеев
2018-05-21 15:27 ` Vladislav Shpilevoy
2018-05-21 16:50 ` [tarantool-patches] " Мерген Имеев
2018-05-21 18:26 ` Vladislav Shpilevoy
2018-05-22 7:01 ` Kirill Yukhin
-- strict thread matches above, loose matches on Subject: below --
2018-05-21 13:35 [tarantool-patches] " ImeevMA
2018-05-21 13:45 ` [tarantool-patches] " Vladislav Shpilevoy
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=6395034d-3cd9-f26f-a38e-561e86fcbdb7@tarantool.org \
--to=v.shpilevoy@tarantool.org \
--cc=imeevma@tarantool.org \
--cc=tarantool-patches@freelists.org \
--subject='[tarantool-patches] Re: [PATCH v2 1/1] sql: COLLATE after LIMIT throws an error' \
/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