From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtpng3.m.smailru.net (smtpng3.m.smailru.net [94.100.177.149]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 91DA746970E for ; Wed, 25 Dec 2019 01:50:39 +0300 (MSK) Date: Wed, 25 Dec 2019 01:50:37 +0300 From: Nikita Pettik Message-ID: <20191224225037.GA16168@tarantool.org> References: <6faa3090e13cd9317baf619aa17716251c7faa27.1576944064.git.imeevma@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <6faa3090e13cd9317baf619aa17716251c7faa27.1576944064.git.imeevma@gmail.com> Subject: Re: [Tarantool-patches] [PATCH v1 1/2] box: introduce DOUBLE field type List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: imeevma@tarantool.org Cc: tarantool-patches@dev.tarantool.org, v.shpilevoy@tarantool.org On 21 Dec 19:03, imeevma@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.