Tarantool development patches archive
 help / color / mirror / Atom feed
From: Vladislav Shpilevoy <v.shpilevoy@tarantool.org>
To: tarantool-patches@freelists.org,
	Konstantin Osipov <kostja@tarantool.org>
Cc: Nikita Pettik <korablev@tarantool.org>
Subject: [tarantool-patches] Re: [PATCH 3/3] sql: fix passing FP values to integer iterator
Date: Tue, 28 May 2019 00:49:18 +0300	[thread overview]
Message-ID: <1fea92f3-20cc-d539-4010-0ef00b1b6c9a@tarantool.org> (raw)
In-Reply-To: <20190525055140.GA14501@atlas>



On 25/05/2019 08:51, Konstantin Osipov wrote:
> * Nikita Pettik <korablev@tarantool.org> [19/05/24 20:42]:
>> That happened due to the fact that type casting mechanism (OP_ApplyType)
>> doesn't affect FP value when it is converted to integer. Hence, FP value
>> was passed to the iterator over integer field which resulted in error.
>> Meanwhile, comparison of integer and FP values is legal in SQL.  To cope
>> with this problem for each equality comparison involving integer field
>> we emit OP_MustBeInt, which checks whether value to be compared is
>> integer or not. If the latter, we assume that result of comparison is
>> always false and continue processing query. 
> 
> Are you sure other vendords would fail to return any results for
> WHERE foo = 1.0?

I do not understand, what you are talking about. It works.

tarantool> box.execute("CREATE TABLE t1(id INT PRIMARY KEY, a INT UNIQUE);")
---
- row_count: 1
...

tarantool> box.execute("INSERT INTO t1 VALUES (1, 1);")
---
- row_count: 1
...

tarantool> box.execute("SELECT a FROM t1 WHERE a = 1.0;")
---
- metadata:
  - name: A
    type: integer
  rows:
  - [1]
...

  reply	other threads:[~2019-05-27 21:49 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 [this message]
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
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=1fea92f3-20cc-d539-4010-0ef00b1b6c9a@tarantool.org \
    --to=v.shpilevoy@tarantool.org \
    --cc=korablev@tarantool.org \
    --cc=kostja@tarantool.org \
    --cc=tarantool-patches@freelists.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