From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp31.i.mail.ru (smtp31.i.mail.ru [94.100.177.91]) (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 CDC1B469719 for ; Wed, 4 Mar 2020 01:39:56 +0300 (MSK) References: <1581359737.397395198@f221.i.mail.ru> <11433298-80bb-336c-06a2-ce310634960f@tarantool.org> <20200227132113.GC12687@tarantool.org> <1583253766.42635729@f106.i.mail.ru> From: Vladislav Shpilevoy Message-ID: <2f34a430-731d-069a-8856-8cdbc30e77ab@tarantool.org> Date: Tue, 3 Mar 2020 23:39:54 +0100 MIME-Version: 1.0 In-Reply-To: <1583253766.42635729@f106.i.mail.ru> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 8bit Subject: Re: [Tarantool-patches] [PATCH] box: sql prepare and execute statistics should be reflected in box.stat() List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Maria Khaydich , Nikita Pettik Cc: tarantool-patches Thanks for the patch! See 2 comments below. > Calling prepare and execute did not update corresponding request statistics > in the box.stat table. This happened because methods that collect stats were > never called where they should have been. 1. I don't think we can make this commit have the same commit message as the original commit (even with an amendment below). And it should not be 'Closes'. This is rather 'Follow-up'. > There was a bug in previous commit resulting in collecting statistics on > box.execute twice in some cases. >   > Closes #4756 > --- > Issue: > https://github.com/tarantool/tarantool/issues/4756 > Branch: > https://github.com/tarantool/tarantool/tree/eljashm/gh-4756-hotfix-box-stat-execute-prepare  > > diff --git a/test/sql/iproto.result b/test/sql/iproto.result > index a391307d1..0e046577d 100644 > --- a/test/sql/iproto.result > +++ b/test/sql/iproto.result > @@ -800,22 +800,22 @@ e = box.stat().EXECUTE.total >  s = box.prepare([[ SELECT ?; ]]) >  --- >  ... > -s:execute({42}) > +res, err = box.unprepare(s) >  --- > -- metadata: > -  - name: '?' > -    type: integer > -  rows: > -  - [42] >  ... > -res, err = box.unprepare(s) > +box.execute('create table test (id integer primary key, a integer)') >  --- > +- row_count: 1 > +... > +box.execute('DROP TABLE test') 2. Is it important to call DDL? Would 'box.execute('SELECT 1;')' be enough?