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 DA20925C88 for ; Fri, 8 Jun 2018 09:17: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 cxQT_G0yiILV for ; Fri, 8 Jun 2018 09:17:06 -0400 (EDT) Received: from smtp29.i.mail.ru (smtp29.i.mail.ru [94.100.177.89]) (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 98E1825C0F for ; Fri, 8 Jun 2018 09:17:06 -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: rework VIEW internals From: "n.pettik" In-Reply-To: Date: Fri, 8 Jun 2018 16:17:04 +0300 Content-Transfer-Encoding: quoted-printable Message-Id: <374C812C-1387-42D1-B1B1-EE8FEDAA70A4@tarantool.org> References: <1528129571.147907906@f369.i.mail.ru> 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: Vladislav Shpilevoy > On 7 Jun 2018, at 23:06, Vladislav Shpilevoy = wrote: >=20 > Thanks for the fixes! See 1 comment below and a commit with my > fixes on the branch right after your. Most likely, my fixes are > not passing tests, so please, finish them. I fixed Select * leak on > exception during trigger_new_xc, and error message. + some style > fixes. Thanks for fixes, I have squashed them and tests seem to pass (Except for 1 run: box/sql.test.lua once failed on timeout, but I=E2=80=99= m not sure that it is my fault: locally on my machine it works fine both as single = run and within suite). The only change I made - added fiber.sleep(0.1) in tests after box.error.injection.set("ERRINJ_WAL_DELAY", false) Without it test turns out to be flaky. >> diff --git a/src/box/sql/build.c b/src/box/sql/build.c >> index 28e4d7a4d..53bb53ab8 100644 >> --- a/src/box/sql/build.c >> +++ b/src/box/sql/build.c >> @@ -2009,230 +2007,99 @@ sqlite3EndTable(Parse * pParse, /* Parse = context */ >> int >> -sql_view_column_names(struct Parse *parse, struct Table *table) >> +sql_view_assign_cursors(struct Parse *parse, const char *view_stmt) >> { >> + assert(view_stmt !=3D NULL); >> + struct sqlite3 *db =3D parse->db; >> + struct Select *select =3D sql_view_compile(db, view_stmt); >> if (select =3D=3D NULL) >> return -1; >> - int n =3D parse->nTab; >> sqlite3SrcListAssignCursors(parse, select->pSrc); >=20 > Where do you free the struct Select? Nowhere, shame on me.. +++ b/src/box/sql/build.c @@ -2090,6 +2090,7 @@ sql_view_assign_cursors(struct Parse *parse, const = char *view_stmt) if (select =3D=3D NULL) return -1; sqlite3SrcListAssignCursors(parse, select->pSrc); + sql_select_delete(db, select);