[tarantool-patches] Re: [PATCH 3/3] sql: fix passing FP values to integer iterator

Konstantin Osipov kostja at tarantool.org
Wed May 29 12:14:00 MSK 2019


* n.pettik <korablev at tarantool.org> [19/05/28 16:01]:

> Ok, consider searching condition ‘a == FP’, where a is
> integer field and FP is floating point value. Since both
> sides of comparison operator have different numeric
> types, one of them is promoted to another according to
> precedence list (I use DB2 terminology:
> https://www.ibm.com/support/knowledgecenter/en/SSEPEK_10.0.0/sqlref/src/tpc/db2z_promotionofdatatypes.html
> I suppose it is not significantly different from ANSI but
> way much easier to understand). In our case, integer is
> promoted to float type. Hence, searching condition
> is transformed to this one: ‘implicit_cast(a to float) == FP’.
> In our particular case: ‘1.0 == 1.1’ and ‘1.0 == 1.0’.
> First one is obviously false, second one it true.

Oh, I missed that implicit casts between integer
and float are allowed and promotion rules apply.

I thought it's strings and numbers only, not the different numbers
between each other. It is my mistake.

-- 
Konstantin Osipov, Moscow, Russia




More information about the Tarantool-patches mailing list