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 DBC2F2AB76 for ; Thu, 4 Oct 2018 17:18:06 -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 GsFh8yw_ZlGq for ; Thu, 4 Oct 2018 17:18:06 -0400 (EDT) Received: from smtp38.i.mail.ru (smtp38.i.mail.ru [94.100.177.98]) (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 34CED2AA6B for ; Thu, 4 Oct 2018 17:18:06 -0400 (EDT) From: Nikita Pettik Subject: [tarantool-patches] [PATCH] sql: initialize variable containing opcode Date: Fri, 5 Oct 2018 00:17:58 +0300 Message-Id: <20181004211758.12107-1-korablev@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: kyukhin@tarantool.org, Nikita Pettik This bug appeared after patch on eliminating cursor usage for write operations in SQL (commit: 6fc3efec7). Lack of this initialization led to missed generation of cursor opening and as a consequence - usage of broken cursor during VDBE execution. Closes #3719 --- https://github.com/tarantool/tarantool/tree/np/gh-3719-fix-uninitialized-var https://github.com/tarantool/tarantool/issues/3719 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 6a1bea091..520a847dd 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) { -- 2.15.1