Tarantool development patches archive
 help / color / mirror / Atom feed
From: Vladislav Shpilevoy <v.shpilevoy@tarantool.org>
To: Kirill Shcherbatov <kshcherbatov@tarantool.org>,
	tarantool-patches@freelists.org,
	Kirill Yukhin <kyukhin@tarantool.org>
Subject: [tarantool-patches] Re: [PATCH v1 1/1] sql: Fix DEFAULTs AST memory leak on alter
Date: Tue, 25 Dec 2018 15:38:39 +0300	[thread overview]
Message-ID: <a7bea1dc-5f04-b381-9ae4-fbc1e72cf960@tarantool.org> (raw)
In-Reply-To: <3bbec3b9-c9e9-9d2e-7b29-e8ced2f51518@tarantool.org>

LGTM.

On 25/12/2018 15:37, Kirill Shcherbatov wrote:
> Extras: catch another one memleak, better comment
> 
> diff --git b/src/box/alter.cc a/src/box/alter.cc
> index 5ec57590e..27b06c083 100644
> --- b/src/box/alter.cc
> +++ a/src/box/alter.cc
> @@ -540,6 +540,7 @@ space_def_new_from_tuple(struct tuple *tuple, uint32_t errcode,
>                  space_def_new_xc(id, uid, exact_field_count, name, name_len,
>                                   engine_name, engine_name_len, &opts, fields,
>                                   field_count);
> +       auto def_guard = make_scoped_guard([=] { space_def_delete(def); });
>          if (def->opts.checks != NULL &&
>              sql_checks_resolve_space_def_reference(def->opts.checks,
>                                                     def) != 0) {
> @@ -551,7 +552,6 @@ space_def_new_from_tuple(struct tuple *tuple, uint32_t errcode,
>                          diag_raise();
>                  }
>          }
> -       auto def_guard = make_scoped_guard([=] { space_def_delete(def); });
>          struct engine *engine = engine_find_xc(def->engine_name);
>          engine_check_space_def_xc(engine, def);
>          def_guard.is_active = false;
> diff --git b/src/box/space_def.h a/src/box/space_def.h
> index e99581dab..8044f88fd 100644
> --- b/src/box/space_def.h
> +++ a/src/box/space_def.h
> @@ -123,6 +123,9 @@ struct space_def {
>    * @param fields Fields array to destroy.
>    * @param field_count Length of @a fields.
>    * @param extern_alloc Fields expression AST allocated externally.
> + *                     (specify false when sql_expr_delete should
> + *                      release default_value_expr memory,
> + *                      true - when shouldn't)
>    */
> 

  reply	other threads:[~2018-12-25 12:38 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-25 12:00 [tarantool-patches] " Kirill Shcherbatov
2018-12-25 12:37 ` [tarantool-patches] " Kirill Shcherbatov
2018-12-25 12:38   ` Vladislav Shpilevoy [this message]
2018-12-25 13:29 ` 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=a7bea1dc-5f04-b381-9ae4-fbc1e72cf960@tarantool.org \
    --to=v.shpilevoy@tarantool.org \
    --cc=kshcherbatov@tarantool.org \
    --cc=kyukhin@tarantool.org \
    --cc=tarantool-patches@freelists.org \
    --subject='[tarantool-patches] Re: [PATCH v1 1/1] sql: Fix DEFAULTs AST memory leak on alter' \
    /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