[tarantool-patches] Re: [PATCH v2 1/1] schema:frommap() to create table or tuple

Vladislav Shpilevoy v.shpilevoy at tarantool.org
Tue Apr 3 12:47:39 MSK 2018


Hello. Please, consider 4 comments below.
> diff --git a/src/box/lua/space.cc b/src/box/lua/space.cc
> index 29a9aca..2ff9a11 100644
> --- a/src/box/lua/space.cc
> +++ b/src/box/lua/space.cc
> @@ -32,11 +32,13 @@
>   #include "box/lua/tuple.h"
>   #include "lua/utils.h"
>   #include "lua/trigger.h"
> +#include "box/schema.h"
>   
>   extern "C" {
>   	#include <lua.h>
>   	#include <lauxlib.h>
>   	#include <lualib.h>
> +	#include <trivia/util.h>
>   } /* extern "C" */
1. Schema.h is included below. Trivia/util.h is not needed here.

> +		space = space_by_id(id);
> +		if (!space)
> +			luaL_error(L, "Specified space is not exists");
> +
2. Please, for pointers use explicit != NULL.

3. As I noted earlier, a function must not raise an error. It must 
return nil + error message/object.
And please, check your comments grammar: you can not say "is not 
exists". Perhaps,
you meant "does not exist".

4. I do not see my crash test in your space_frommap.test.lua. When I 
provide you a test, or you
found an own, you must add it to the patch.






More information about the Tarantool-patches mailing list