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 EA05724672 for ; Thu, 17 May 2018 11:12:49 -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 yFFAbbAjoQQr for ; Thu, 17 May 2018 11:12:49 -0400 (EDT) Received: from smtp59.i.mail.ru (smtp59.i.mail.ru [217.69.128.39]) (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 A943524671 for ; Thu, 17 May 2018 11:12:49 -0400 (EDT) Subject: [tarantool-patches] Re: [PATCH] sql: print space names in VDBE dump References: <3fa71f93e60eab628771742d2ac156b4c3ec60a1.1526563390.git.kyukhin@tarantool.org> From: Vladislav Shpilevoy Message-ID: <4b712e43-cd89-42f6-596a-6a775624592b@tarantool.org> Date: Thu, 17 May 2018 18:12:47 +0300 MIME-Version: 1.0 In-Reply-To: <3fa71f93e60eab628771742d2ac156b4c3ec60a1.1526563390.git.kyukhin@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, Kirill Yukhin Hello. Thanks for the patch! See 3 comments below. On 17/05/2018 16:25, Kirill Yukhin wrote: > Before the patch, when LoadPtr instruction is dumped, > raw pointer value was printed, which was looked like a > garbade. The patch inroduces new pointer type: space ptr, > which allows to print space name during VDBE dump. > --- 1. Please, post here branch and issue link (if issue exists). 2. Can not find any similar branch on github by kyukhin/ prefix. > src/box/sql/analyze.c | 4 ++-- > src/box/sql/build.c | 3 +-- > src/box/sql/insert.c | 2 +- > src/box/sql/vdbe.c | 6 +++--- > src/box/sql/vdbe.h | 19 ++++++++++++++++++- > src/box/sql/vdbeInt.h | 3 ++- > src/box/sql/vdbeaux.c | 9 +++++++-- > 7 files changed, 34 insertions(+), 12 deletions(-) > > diff --git a/src/box/sql/analyze.c b/src/box/sql/analyze.c > index 50d212a..563cd18 100644 > --- a/src/box/sql/analyze.c > +++ b/src/box/sql/analyze.c > @@ -910,8 +910,8 @@ analyzeOneTable(Parse * pParse, /* Parser context */ > struct space *space = > space_by_id(SQLITE_PAGENO_TO_SPACEID(pIdx->tnum)); > assert(space != NULL); > - sqlite3VdbeAddOp4Ptr(v, OP_LoadPtr, 0, space_ptr_reg, 0, > - (void *) space); > + sql_vdbe_add_op4_spaceptr(v, OP_LoadPtr, 0, space_ptr_reg, 0, > + space); 3. I think, all VdbeAppOp functions family must be refactored at once. You can introduce P4_SPACEPTR and use sqlite3VdbeAddOp4(v, OP_LoadPtr, 0, space_ptr_reg, 0, space, P4_SPACEPTR);.