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 B540B2C38D for ; Fri, 5 Oct 2018 00:39:48 -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 Vh9ZE3InNSlQ for ; Fri, 5 Oct 2018 00:39:48 -0400 (EDT) Received: from smtp47.i.mail.ru (smtp47.i.mail.ru [94.100.177.107]) (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 00F7C2C38C for ; Fri, 5 Oct 2018 00:39:47 -0400 (EDT) Date: Fri, 5 Oct 2018 07:39:44 +0300 From: Kirill Yukhin Subject: [tarantool-patches] Re: [PATCH] sql: refactor SQL cursor to remove write ones Message-ID: <20181005043944.ts6gcu5t2ts7sa4n@tarantool.org> References: <4aec5b52bc28f47ad2af0ac6f4e64be0712f378b.1538389679.git.kyukhin@tarantool.org> <20181004120034.pbdqm7thu7kiqa25@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20181004120034.pbdqm7thu7kiqa25@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: korablev@tarantool.org Cc: tarantool-patches@freelists.org Hello, On 04 окт 15:00, Kirill Yukhin wrote: > Hello, > On 01 окт 13:31, Kirill Yukhin wrote: > > In Tarantool opening and positioning cursor for writing > > have no sense. So refactor SQL code, to perform: > > - Creation of ephemeral table w/o any cursors machinery. > > No op-code returns register which contains plain pointer > > to the ephemeral space. > > - OpenRead/OpenWrite opcodes were replaced with single > > CursorOpen op-code, which establishes new cursor w/ > > intention to sebsequent read from the space. This opcode > > accepts both plain pointer (in P4 operand) and register > > which contains pointer (inn P3) to the ephemeral space. > > This query scheduler and DML routines thoroughly. > > > > Closes #3182 > > Part of #2362 > > --- > > Branch: https://github.com/tarantool/tarantool/commits/kyukhin/gh-3182-repair-cursors-2 > > Issue: https://github.com/tarantool/tarantool/issues/3182 > Patch was checked into 2.0 branch. Seems like the patch broken testing in release mode. This is due to non-initialized local variable. Patch in the bottom fixes that. Comitted as obvious into 2.0 branch. -- Regard, Kirill Yukhin commit cebcf21114f50141e8aa0a72f30ea47dfbfef16c Author: Kirill Yukhin Date: Fri Oct 5 07:19:56 2018 +0300 sql: fix local var initialization in select planner Not initialized var led to crashes in non-debug modes. --- src/box/sql/where.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/box/sql/where.c b/src/box/sql/where.c index 6a1bea0..520a847 100644 --- a/src/box/sql/where.c +++ b/src/box/sql/where.c @@ -4591,7 +4591,7 @@ sqlite3WhereBegin(Parse * pParse, /* The parser context */ if (pLoop->wsFlags & WHERE_INDEXED) { struct index_def *idx_def = pLoop->index_def; int iIndexCur; - int op; + int op = OP_IteratorOpen; /* Check if index is primary. Either of * points should be true: * 1. struct Index is non-NULL and is @@ -4636,7 +4636,6 @@ sqlite3WhereBegin(Parse * pParse, /* The parser context */ } } assert(wctrlFlags & WHERE_ONEPASS_DESIRED); - op = OP_IteratorOpen; pWInfo->aiCurOnePass[1] = iIndexCur; } else if (iAuxArg && (wctrlFlags & WHERE_OR_SUBCLAUSE) != 0) {