Tarantool development patches archive
 help / color / mirror / Atom feed
From: Vladislav Shpilevoy <v.shpilevoy@tarantool.org>
To: tarantool-patches@freelists.org, Kirill Yukhin <kyukhin@tarantool.org>
Subject: [tarantool-patches] Re: [PATCH] sql: print space names in VDBE dump
Date: Thu, 17 May 2018 18:12:47 +0300	[thread overview]
Message-ID: <4b712e43-cd89-42f6-596a-6a775624592b@tarantool.org> (raw)
In-Reply-To: <3fa71f93e60eab628771742d2ac156b4c3ec60a1.1526563390.git.kyukhin@tarantool.org>

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);.

  reply	other threads:[~2018-05-17 15:12 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-17 13:25 [tarantool-patches] " Kirill Yukhin
2018-05-17 15:12 ` Vladislav Shpilevoy [this message]
2018-05-17 16:01   ` [tarantool-patches] " Kirill Yukhin
2018-05-17 16:13     ` Vladislav Shpilevoy
2018-05-17 16:34       ` Kirill Yukhin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4b712e43-cd89-42f6-596a-6a775624592b@tarantool.org \
    --to=v.shpilevoy@tarantool.org \
    --cc=kyukhin@tarantool.org \
    --cc=tarantool-patches@freelists.org \
    --subject='[tarantool-patches] Re: [PATCH] sql: print space names in VDBE dump' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox