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 3F062276CA for ; Thu, 4 Oct 2018 06:45:51 -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 E0BZUnOHqzqL for ; Thu, 4 Oct 2018 06:45:51 -0400 (EDT) Received: from smtp51.i.mail.ru (smtp51.i.mail.ru [94.100.177.111]) (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 A6CBE2778F for ; Thu, 4 Oct 2018 06:45:50 -0400 (EDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: [tarantool-patches] Re: [PATCH] sql: refactor SQL cursor to remove write ones From: "n.pettik" In-Reply-To: <20181004071637.jncwrcmp62r7zucn@tarantool.org> Date: Thu, 4 Oct 2018 13:45:45 +0300 Content-Transfer-Encoding: quoted-printable Message-Id: <036AB308-449D-4789-9F78-432CB93DF902@tarantool.org> References: <4aec5b52bc28f47ad2af0ac6f4e64be0712f378b.1538389679.git.kyukhin@tarantool.org> <7816B3E4-321F-446F-B19A-ED3E241D5D86@tarantool.org> <20181003095759.2cdk54garm4na3f3@tarantool.org> <4A0EC663-775A-4D4B-8458-A27ADB72B71C@tarantool.org> <20181004071637.jncwrcmp62r7zucn@tarantool.org> 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 Cc: Kirill Yukhin > Hello Nikita! > Thanks for review. All nits applied. > Updated patch in the bottom. Branch force-pushed. IDK whether it is outlined in our review policy or not, but it is quite hard to review each time the whole patch again. So, it would be nice if you attached intermediate diff (i.e. diff between two versions of = patch) in order to review only parts which have changed. Or, inline diff for each comment/remark. >>>> Finally, now I think about renaming CursorOpen to IteratorOpen: in = fact after your >>>> patch cursor has turned almost in wrapper around index iterator. = Such naming >>>> would underline the fact that =E2=80=98cursor=E2=80=99 is used only = for read iterations over the space. >>> Yes, sure. Renamed. >>=20 >> You forgot to update name of opcode in commit message. >> Also, you deleted not all mentions of OP_Cursor(Re)Open - just grep = it Still, I can grep OP_OpenWrite. Eliminate it completely pls. Consider code style fixes: diff --git a/src/box/sql/select.c b/src/box/sql/select.c index 929d3c814..353b0af9f 100644 --- a/src/box/sql/select.c +++ b/src/box/sql/select.c @@ -86,7 +86,7 @@ struct SortCtx { ExprList *pOrderBy; /* The ORDER BY (or GROUP BY clause) */ int nOBSat; /* Number of ORDER BY terms satisfied by = indices */ int iECursor; /* Cursor number for the sorter */ - /* Register, containing pointer to ephemeral space. */ + /** Register, containing pointer to ephemeral space. */ int reg_eph; int regReturn; /* Register holding block-output return = address */ int labelBkOut; /* Start label for the block-output = subroutine */ @@ -1005,7 +1005,8 @@ selectInnerLoop(Parse * pParse, /* The = parser context */ regPrev =3D pParse->nMem + 1; pParse->nMem +=3D nResultCol; =20 - /* Actually, for DISTINCT handling + /* + * Actually, for DISTINCT handling * two op-codes were emitted here: * OpenTEphemeral & IteratorOpen. * So, we need to Noop one and @@ -1061,7 +1062,7 @@ selectInnerLoop(Parse * pParse, /* The = parser context */ } =20 case WHERE_DISTINCT_UNIQUE:{ - /** + /* * To handle DISTINCT two op-codes are * emitted: OpenTEphemeral & IteratorOpen. * addrTnct is address of first insn in Except for these nits, patch LGTM.