[Tarantool-patches] [PATCH v1 1/2] box: introduce DOUBLE field type
Nikita Pettik
korablev at tarantool.org
Wed Dec 25 01:50:37 MSK 2019
On 21 Dec 19:03, imeevma at tarantool.org wrote:
> diff --git a/test/engine/insert.result b/test/engine/insert.result
> index 1015b6a..60c31a7 100644
> --- a/test/engine/insert.result
> +++ b/test/engine/insert.result
> @@ -730,3 +730,154 @@ s:drop()
> fiber = nil
> ---
> ...
> +-- Integers of Lua type NUMBER and CDATA of type int64 or uint64
> +-- cannot be inserted into this field.
> +--
> +s:insert({4, 1})
> +---
> +- error: 'Tuple field 2 type does not match one required by operation: expected double'
> +...
Could you please add a follow-up or file an issue to make this error
more clear and display actually passed type? Like
'..operatiion: expected double, got integer'
> +
> +--
> +-- To insert an integer, we must cast it to a CDATA of type DOUBLE
> +-- using ffi.cast(). Non-integers can also be inserted this way.
> +--
> +s:insert({7, ffi.cast('double', 1)})
> +s:insert({8, ffi.cast('double', -9223372036854775808)})
> +s:insert({9, ffi.cast('double', tonumber('123'))})
> +s:insert({10, ffi.cast('double', tonumber64('18000000000000000000'))})
> +s:insert({11, ffi.cast('double', 1.1)})
> +s:insert({12, ffi.cast('double', -3.0009)})
Inserts are OK, but let's also test delete, update and upsert
operations (a few tests just in case).
The rest is OK.
More information about the Tarantool-patches
mailing list