Tarantool development patches archive
 help / color / mirror / Atom feed
From: Nikita Pettik <korablev@tarantool.org>
To: tarantool-patches@freelists.org
Cc: kyukhin@tarantool.org, Nikita Pettik <korablev@tarantool.org>
Subject: [tarantool-patches] [PATCH] sql: initialize variable containing opcode
Date: Fri,  5 Oct 2018 00:17:58 +0300	[thread overview]
Message-ID: <20181004211758.12107-1-korablev@tarantool.org> (raw)

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

             reply	other threads:[~2018-10-04 21:18 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-04 21:17 Nikita Pettik [this message]
2018-10-05  4:42 ` [tarantool-patches] " Kirill Yukhin

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=20181004211758.12107-1-korablev@tarantool.org \
    --to=korablev@tarantool.org \
    --cc=kyukhin@tarantool.org \
    --cc=tarantool-patches@freelists.org \
    --subject='Re: [tarantool-patches] [PATCH] sql: initialize variable containing opcode' \
    /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