Tarantool development patches archive
 help / color / mirror / Atom feed
From: Vladislav Shpilevoy via Tarantool-patches <tarantool-patches@dev.tarantool.org>
To: Mergen Imeev <imeevma@tarantool.org>
Cc: tarantool-patches@dev.tarantool.org
Subject: Re: [Tarantool-patches] [PATCH v1 1/1] sql: introduce literals for DECIMAL
Date: Sun, 24 Oct 2021 17:50:00 +0200	[thread overview]
Message-ID: <6e80c869-3251-1b31-476a-b750c6f00599@tarantool.org> (raw)
In-Reply-To: <20211019084940.GA96058@tarantool.org>

Hi! Thanks for the fixes!

LGTM.

>>> diff --git a/src/box/sql/vdbe.c b/src/box/sql/vdbe.c
>>> index 44533fb3e..747fb608b 100644
>>> --- a/src/box/sql/vdbe.c
>>> +++ b/src/box/sql/vdbe.c
>>> @@ -804,6 +804,17 @@ case OP_Real: {            /* same as TK_FLOAT, out2 */
>>>  	break;
>>>  }
>>>  
>>> +/* Opcode: Decimal * P2 * P4 *
>>> + * Synopsis: r[P2]=P4
>>> + *
>>> + * P4 is a pointer to a DECIMAL value. Write that value into register P2.
>>> + */
>>> +case OP_Decimal: {            /* same as TK_DECIMAL, out2 */
>>
>> 2. Lets stick to our code style when write comments:
>> start them with /** out of functions, and not write them
>> on the same line as code.
>>
> Fixed.

Nope, it seems not.

>>> diff --git a/test/sql-tap/cast.test.lua b/test/sql-tap/cast.test.lua
>>> index 68d2ae585..5f8e885ce 100755
>>> --- a/test/sql-tap/cast.test.lua
>>> +++ b/test/sql-tap/cast.test.lua
>>> @@ -962,7 +962,7 @@ test:do_catchsql_test(
>>>  test:do_catchsql_test(
>>>      "cast-6.2.3",
>>>      [[
>>> -        SELECT CAST(1.5 AS BOOLEAN);
>>> +        SELECT CAST(15e-1 AS BOOLEAN);
>>
>> 5. Please, add some tests for so large numbers that only
>> DECIMAL would fit them. To prove that VDBE really uses
>> decimal for them.
>>
> Not sure if I got it right. At first we wanted to parse large numbers without
> decimal point and exponent as DECIMAL if they are not fit for INTEGER, but we
> decided to abandon this idea. Is that what you mean?

I mean just use large decimal numbers, which wouldn't fit into an INTEGER.
You define decimals as "A value consisting of digits and a decimal point".
My proposal was to test a huge number with a decimal point which would
be > UINT64_MAX. I see you got it correct in the new patch.

  reply	other threads:[~2021-10-24 15:50 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-04 13:35 Mergen Imeev via Tarantool-patches
2021-10-08 22:32 ` Vladislav Shpilevoy via Tarantool-patches
2021-10-19  8:49   ` Mergen Imeev via Tarantool-patches
2021-10-24 15:50     ` Vladislav Shpilevoy via Tarantool-patches [this message]
2021-10-26 10:27 Mergen Imeev via Tarantool-patches
2021-11-03  9:55 ` Kirill Yukhin via Tarantool-patches

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6e80c869-3251-1b31-476a-b750c6f00599@tarantool.org \
    --to=tarantool-patches@dev.tarantool.org \
    --cc=imeevma@tarantool.org \
    --cc=v.shpilevoy@tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH v1 1/1] sql: introduce literals for DECIMAL' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox