From: Konstantin Osipov <kostja@tarantool.org>
To: "n.pettik" <korablev@tarantool.org>
Cc: tarantool-patches@freelists.org,
Vladislav Shpilevoy <v.shpilevoy@tarantool.org>
Subject: [tarantool-patches] Re: [PATCH 3/3] sql: fix passing FP values to integer iterator
Date: Wed, 29 May 2019 12:14:00 +0300 [thread overview]
Message-ID: <20190529091400.GA29529@atlas> (raw)
In-Reply-To: <A8343998-1ECA-47CE-9855-411E77DE7026@tarantool.org>
* n.pettik <korablev@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
next prev parent reply other threads:[~2019-05-29 9:14 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-24 17:39 [tarantool-patches] [PATCH 0/3] Fix passing key with different from iterator's type Nikita Pettik
2019-05-24 17:39 ` [tarantool-patches] [PATCH 1/3] sql: remove redundant check of space format from QP Nikita Pettik
2019-05-24 17:39 ` [tarantool-patches] [PATCH 2/3] sql: remove redundant type derivation " Nikita Pettik
2019-05-27 21:49 ` [tarantool-patches] " Vladislav Shpilevoy
2019-05-28 19:58 ` n.pettik
2019-05-24 17:39 ` [tarantool-patches] [PATCH 3/3] sql: fix passing FP values to integer iterator Nikita Pettik
2019-05-25 5:51 ` [tarantool-patches] " Konstantin Osipov
2019-05-27 21:49 ` Vladislav Shpilevoy
2019-05-28 7:19 ` Konstantin Osipov
2019-05-28 11:31 ` Vladislav Shpilevoy
2019-05-29 7:02 ` Konstantin Osipov
2019-05-28 13:00 ` n.pettik
2019-05-29 9:14 ` Konstantin Osipov [this message]
2019-05-27 21:49 ` Vladislav Shpilevoy
2019-05-28 19:58 ` n.pettik
2019-06-02 18:11 ` Vladislav Shpilevoy
2019-06-06 13:51 ` n.pettik
2019-06-06 19:07 ` Vladislav Shpilevoy
2019-07-11 9:19 ` [tarantool-patches] Re: [PATCH 0/3] Fix passing key with different from iterator's type Kirill Yukhin
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=20190529091400.GA29529@atlas \
--to=kostja@tarantool.org \
--cc=korablev@tarantool.org \
--cc=tarantool-patches@freelists.org \
--cc=v.shpilevoy@tarantool.org \
--subject='[tarantool-patches] Re: [PATCH 3/3] sql: fix passing FP values to integer iterator' \
/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