[Tarantool-discussions] Implicit cast for ASSIGNMENT
kostja.osipov at gmail.com
Thu Apr 30 17:04:14 MSK 2020
* Imeev Mergen <imeevma at tarantool.org> [20/04/30 16:14]:
> On 4/30/20 4:09 PM, Konstantin Osipov wrote:
> > * Imeev Mergen <imeevma at tarantool.org> [20/04/30 15:59]:
> > > > The only possible exception is conversion of a lossless conversion
> > > > of a numeric literal, e.g.:
> > > >
> > > > float_val = 1.1 -- implicitly convert decimal constant 1.1 to float
> > > So, is it fine to implicitly cast 1.0(DOUBLE) to 1(INTEGER)?
> > 1.0 is not double, it's DECIMAL.
> Ok, then, let's say we executed something like this:
> box.execute('CREATE TABLE t (i INT PRIMARY KEY);')
> box.execute('INSERT INTO t VALUES(CAST(1 AS DOUBLE));')
> Should this work of we should receive an error?
I think it shouldn't because CAST(1 AS DOUBLE) is an expression,
not a constant literal.
Konstantin Osipov, Moscow, Russia
More information about the Tarantool-discussions