[tarantool-patches] Re: [PATCH v1 1/1] sql: invalid integer type in arithmetic operations

Konstantin Osipov kostja.osipov at gmail.com
Thu Apr 25 13:52:37 MSK 2019


* Konstantin Osipov <kostja.osipov at gmail.com> [19/04/25 13:49]:
> * n.pettik <korablev at tarantool.org> [19/04/25 09:18]:
> > Surely, we still can create space and set format with unsigned types
> > from Lua, so strictly speaking UNSIGNED is allowed even now.
> > But we can’t set UNSIGNED as a type of column in SQL, and we don’t
> > set this type in meta. So in some sense it is not allowed.
> > Mb it is worth fixing comment. Or return _UNSIGNED instead
> > of _NUMBER in this case. I guess there will be no severe consequences.
> 
> SQL *is* server. Please begin by having a comment containing a
> table for integer type arithmetics, something like this:
> 
>   Plus operation:
>   --------------
>   
>                integer   float
> 
>   integer      integer   float
>   float        float     float
> 
> It's best to implement such table in the source code too, and not
> have complicated branching.

Re UNSIGNED type itself:

once you have a proper table for type arithmetics, it will be easy
to understand what the result of unsigned + unsigned should be.
Most likely it should be unsigned, not a number.

-- 
Konstantin Osipov, Moscow, Russia, +7 903 626 22 32
http://tarantool.io - www.twitter.com/kostja_osipov




More information about the Tarantool-patches mailing list