From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtpng2.m.smailru.net (smtpng2.m.smailru.net [94.100.179.3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id BED8246971A for ; Fri, 6 Dec 2019 02:59:30 +0300 (MSK) References: <1ca68695d7cd7d3d83f4b6829363ef533a23be38.1574846892.git.korablev@tarantool.org> <20191205114007.GA47637@tarantool.org> From: Vladislav Shpilevoy Message-ID: <23fe796e-4ea5-0438-78d6-ed9f1faafc89@tarantool.org> Date: Fri, 6 Dec 2019 00:59:29 +0100 MIME-Version: 1.0 In-Reply-To: <20191205114007.GA47637@tarantool.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [Tarantool-patches] [PATCH 2/6] sql: fix possible null dereference in sql_expr_coll() List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Nikita Pettik Cc: tarantool-patches@dev.tarantool.org On 05/12/2019 12:40, Nikita Pettik wrote: > On 28 Nov 23:42, Vladislav Shpilevoy wrote: >> Thanks for the patch! >> >> Is it possible to test this? > > As a pure test case - I've failed to come up with it. > But the next patch (which adds collation to metadata) definitely fails > without this fix (when TRIM() or REPLACE() are called without args). Why does not it fail right after finding that there are no arguments? TRIM looks strange, but REPLACE expects 3 arguments. > I can dive into details, but I guess it's not so important here (since > this is obviously buggy place). Is it? As I pointed above, maybe the bug is really in another place? I see, that REPLACE checks argument count. But somewhy too late: tarantool> box.execute('SELECT REPLACE()') --- - null - 'Wrong number of arguments is passed to REPLACE(): expected 3, got 0' ... > If you want further investigation, let me > know and I will do it. Yeah. I think we need to understand the bug before fixing it.