[tarantool-patches] Re: [PATCH v1 1/1] sql: make assertion to check only ephemeral spaces

n.pettik korablev at tarantool.org
Sun May 19 15:13:36 MSK 2019



> On 17 May 2019, at 18:51, imeevma at tarantool.org wrote:
> 
> 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. 

> 
> Close #4139
> ---
> https://github.com/tarantool/tarantool/issues/4139
> https://github.com/tarantool/tarantool/tree/imeevma/gh-4139-assertion-on-temporary-space
> 
> 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(-)
> 
> 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] = '\0';
> 	def->opts.is_temporary = true;
> +	def->opts.is_ephemeral = true;

Let’s set only is_ephemeral flag - setting both doesn’t
really make any sense. Also, fix assertions during
building routine to check is_ephemeral flag, not
is_temporary.






More information about the Tarantool-patches mailing list