From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id 333B123AB7 for ; Mon, 21 May 2018 11:27:40 -0400 (EDT) Received: from turing.freelists.org ([127.0.0.1]) by localhost (turing.freelists.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id G9PUrdaH3zdf for ; Mon, 21 May 2018 11:27:40 -0400 (EDT) Received: from smtp52.i.mail.ru (smtp52.i.mail.ru [94.100.177.112]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTPS id E4F7D23A77 for ; Mon, 21 May 2018 11:27:39 -0400 (EDT) Subject: [tarantool-patches] Re: [PATCH v2 1/1] sql: COLLATE after LIMIT throws an error References: <13ccf5856ab21d72c71a3fc5f65739871d824b40.1526913411.git.imeevma@tarantool.org> <6395034d-3cd9-f26f-a38e-561e86fcbdb7@tarantool.org> <1526915797.481599602@f468.i.mail.ru> From: Vladislav Shpilevoy Message-ID: Date: Mon, 21 May 2018 18:27:34 +0300 MIME-Version: 1.0 In-Reply-To: <1526915797.481599602@f468.i.mail.ru> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: tarantool-patches-bounce@freelists.org Errors-to: tarantool-patches-bounce@freelists.org Reply-To: tarantool-patches@freelists.org List-help: List-unsubscribe: List-software: Ecartis version 1.0.0 List-Id: tarantool-patches List-subscribe: List-owner: List-post: List-archive: To: tarantool-patches@freelists.org, =?UTF-8?B?0JzQtdGA0LPQtdC9INCY0LzQtdC1?= =?UTF-8?B?0LI=?= Thanks a lot! But please, apply this diff: diff --git a/src/box/sql/select.c b/src/box/sql/select.c index 7a7728992..0b610dca7 100644 --- a/src/box/sql/select.c +++ b/src/box/sql/select.c @@ -1994,8 +1994,10 @@ computeLimitRegisters(Parse * pParse, Select * p, int iBreak) 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"); + (p->pOffset != NULL && + (p->pOffset->flags & EP_Collate) != 0)) { + sqlite3ErrorMsg(pParse, "near \"COLLATE\": "\ + "syntax error"); return; } p->iLimit = iLimit = ++pParse->nMem; In your patch sqlite3ErrorMsg was out of 80 symbols, and pointer p->pOffset must be checked on != NULL explicitly. (I see, that other SQLite3 code does not this, but we will fix this gradually). After this the patch LGTM.