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 D403A2E9E7 for ; Sun, 19 May 2019 08:13:46 -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 UWLcvpcxOAW2 for ; Sun, 19 May 2019 08:13:46 -0400 (EDT) Received: from smtp60.i.mail.ru (smtp60.i.mail.ru [217.69.128.40]) (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 1BC612E9C2 for ; Sun, 19 May 2019 08:13:45 -0400 (EDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.8\)) Subject: [tarantool-patches] Re: [PATCH v1 1/1] sql: make assertion to check only ephemeral spaces From: "n.pettik" In-Reply-To: Date: Sun, 19 May 2019 15:13:36 +0300 Content-Transfer-Encoding: quoted-printable Message-Id: References: 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 Cc: Imeev Mergen > On 17 May 2019, at 18:51, imeevma@tarantool.org wrote: >=20 > At some point, it became possible to use SELECT on spaces created > in Lua. Since it is allowed to create temporary spaces in Lua, > this led to an error. > To avoid this error, now not all temporary > spaces are checked, but only ephemeral spaces. Checked on what condition? Please, provide complete explanation of the problem in commit message. Btw, they are not real ephemeral spaces, they are surrogate wrappers which have no underlying spaces in cache. It was our convention to avoid messing them with real (ephemeral, temporary or casual) spaces.=20 >=20 > Close #4139 > --- > https://github.com/tarantool/tarantool/issues/4139 > = https://github.com/tarantool/tarantool/tree/imeevma/gh-4139-assertion-on-t= emporary-space >=20 > src/box/sql.c | 1 + > src/box/sql/build.c | 6 +++--- > test/sql/misc.result | 22 ++++++++++++++++++++++ > test/sql/misc.test.lua | 9 +++++++++ > 4 files changed, 35 insertions(+), 3 deletions(-) >=20 > diff --git a/src/box/sql.c b/src/box/sql.c > index fbfa599..3bf263d 100644 > --- a/src/box/sql.c > +++ b/src/box/sql.c > @@ -1281,6 +1281,7 @@ sql_ephemeral_space_def_new(struct Parse = *parser, const char *name) > memcpy(def->name, name, name_len); > def->name[name_len] =3D '\0'; > def->opts.is_temporary =3D true; > + def->opts.is_ephemeral =3D true; Let=E2=80=99s set only is_ephemeral flag - setting both doesn=E2=80=99t really make any sense. Also, fix assertions during building routine to check is_ephemeral flag, not is_temporary.