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 D47EA29048 for ; Fri, 1 Jun 2018 09:48:14 -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 tlc65gKcUGRR for ; Fri, 1 Jun 2018 09:48:14 -0400 (EDT) Received: from smtp2.mail.ru (smtp2.mail.ru [94.100.179.91]) (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 33C5A29047 for ; Fri, 1 Jun 2018 09:48:13 -0400 (EDT) Subject: [tarantool-patches] Re: [PATCH] sql: remove Table lookup from ColumnsFromExprList References: <20180601111219.48029-1-korablev@tarantool.org> From: Vladislav Shpilevoy Message-ID: <1c17e865-9181-dda4-7840-eabd452efb82@tarantool.org> Date: Fri, 1 Jun 2018 16:48:11 +0300 MIME-Version: 1.0 In-Reply-To: <20180601111219.48029-1-korablev@tarantool.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit 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, Nikita Pettik Hello. Thanks for the patch! LGTM. On 01/06/2018 14:12, Nikita Pettik wrote: > sqlite3ColumnsFromExprList doesn't assume that hash contains table to be > examined. Thus, assert(table != NULL) after table lookup fails for > temporary (or in other words ephemeral) objects, e.g. see sqlite_sq_... > tables. In fact, this lookup is needed only when iColumn member of > struct Expr is less than zero. On the other hand, Expr->iColumn < 0 only > for rowid (according to comments in source code) columns: > "Expr.iColumn The column index in X.Y. -1 for the rowid." > As far as we don't have rowid anymore, remove table lookup and add > assert testing iColumn to be greater or equal to zero. > > Closes #3440 > --- > Branch: https://github.com/tarantool/tarantool/commits/np/gh-3440-crash-on-view > Issue: https://github.com/tarantool/tarantool/issues/3440 > > src/box/sql/select.c | 7 +------ > test/sql-tap/tkt1449.test.lua | 12 +++++++++++- > 2 files changed, 12 insertions(+), 7 deletions(-) >