[Tarantool-patches] [PATCH v2 1/1] sql: make NUMBER to be union of SQL numeric types

Mergen Imeev imeevma at tarantool.org
Tue Dec 31 12:46:11 MSK 2019


Hi! Thank you for review. My answer below.

On Tue, Dec 31, 2019 at 10:56:07AM +0200, Nikita Pettik wrote:
> On 31 Dec 11:50, imeevma at tarantool.org wrote:
> > This patch makes number to be union of UNSIGNED, INTEGER and
> > DOUBLE numeric types.
> > 
> > Closes #4233
> > Closes #4463
> 
> Please, explain in details changes in explicit/implicit
> casts behaviour.
> 
Fixed:

commit 492646da4f781b863e5e3e488a0be53f31d28964
Author: Mergen Imeev <imeevma at gmail.com>
Date:   Sat Oct 26 17:27:53 2019 +0300

    sql: make NUMBER to be union of SQL numeric types
    
    This patch makes number to be union of UNSIGNED, INTEGER and
    DOUBLE numeric types.
    
    Closes #4233
    Closes #4463
    
    @TarantoolBot document
    Title: NUMBER type in SQL.
    
    The NUMBER type in SQL is the union of all currently available
    numeric types in SQL: INTEGER, UNSIGNED, and DOUBLE. The types
    INTEGER and DOUBLE can be called subtypes of type NUMBER. Any
    value of type NUMBER has a subtype of INTEGER or DOUBLE. When
    any numeric value is implicitly or explicitly casted to NUMBER,
    the only thing that can change is its type. Its type will become
    NUMBER. When a value of type NUMBER is cast explicitly or
    implicitly to other numeric types, the rules applicable to the
    cast are determined by the subtype of the value.
    
    If a value of type STRING can be implicitly cast to value of
    type INTEGER or DOUBLE, then this value can be cast explicitly
    and implicitly to a value of type NUMBER. If this value can be
    implicitly cast to INTEGER, then its subtype will be INTEGER.
    The subtype will be DOUBLE in another case.
    
    If a value of type VARBINARY can be explicitly cast to type
    INTEGER or DOUBLE, then this value can be explicitly cast to a
    value of type NUMBER. If this value can be explicitly cast to
    INTEGER, then its subtype will be INTEGER. The subtype will be
    DOUBLE in another case.
> > ---


More information about the Tarantool-patches mailing list