Tarantool development patches archive
 help / color / mirror / Atom feed
From: Nikita Pettik <korablev@tarantool.org>
To: Mergen Imeev <imeevma@tarantool.org>
Cc: tarantool-patches@dev.tarantool.org
Subject: Re: [Tarantool-patches] [PATCH v1 2/2] sql: remove implicit cast in bitwise operations
Date: Thu, 17 Sep 2020 13:36:48 +0000	[thread overview]
Message-ID: <20200917133648.GF10599@tarantool.org> (raw)
In-Reply-To: <20200821123409.GA219863@tarantool.org>

On 21 Aug 15:34, Mergen Imeev wrote:
> Hi! Thank you for the review. My answer and new patch below.
> 
> On Fri, Aug 21, 2020 at 09:21:30AM +0000, Nikita Pettik wrote:
> > On 21 Aug 11:40, imeevma@tarantool.org wrote:
> > > This patch removes the implicit conversion from STRING to INTEGER from
> > > bitwise operations. However, DOUBLE can still be implicitly converted to
> > > INTEGER.
> > 
> > I see no test involving doubles in bitwise operations. Does it make
> > any sense at all?
> Even if it doesn't, it is legal to implicitly convert DOUBLE to INTEGER.
> 
> However, when I tried to add tests for this case, I found an error in my patch.
> I re-made patch. Now in these opcodes we convert MEM to INTEGER, which I tried
> to avoid in previous patch. I did this to fix a bug where result of the
> operation is DOUBLE if one of the operands is DOUBLE. It didn't help, the
> result still has DOUBLE type. I decided to left conversion since it looks right
> here because all operands must be INTEGERS. This wouldn't work for arithmetic
> operations though.

Не понял ничего..Как эта штука должна работать??
box.execute([[SELECT 3.5 | 1.3;]])                                           
 metadata:                                                                  
 name: COLUMN_1                                                           
 type: double                                                             
 rows:                                                                      
 [3] -- WTF

Давай по-честному выдавать ошибку, когда в битовые операции суем не инты.
 
> From 3515ada4b363062cf9caa5d550ea40770e8a5e65 Mon Sep 17 00:00:00 2001
> From: Mergen Imeev <imeevma@gmail.com>
> Date: Tue, 18 Aug 2020 18:18:59 +0300
> Subject: [PATCH] sql: remove implicit cast in bitwise operations
> 
> This patch removes the implicit conversion from STRING to INTEGER from
> bitwise operations. However, DOUBLE can still be implicitly converted to
> INTEGER.
> 
> Follow-up #3809
> 

  reply	other threads:[~2020-09-17 13:36 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-21  8:40 [Tarantool-patches] [PATCH v1 0/2] sql: remove implicit cast from operations imeevma
2020-08-21  8:40 ` [Tarantool-patches] [PATCH v1 1/2] sql: remove implicit cast in arithmetic operations imeevma
2020-08-21  8:59   ` Nikita Pettik
2020-08-21  8:40 ` [Tarantool-patches] [PATCH v1 2/2] sql: remove implicit cast in bitwise operations imeevma
2020-08-21  9:21   ` Nikita Pettik
2020-08-21 12:34     ` Mergen Imeev
2020-09-17 13:36       ` Nikita Pettik [this message]
2020-09-27  9:11         ` Mergen Imeev
2020-09-28 17:13           ` Nikita Pettik
2020-09-29 13:00             ` Mergen Imeev

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=20200917133648.GF10599@tarantool.org \
    --to=korablev@tarantool.org \
    --cc=imeevma@tarantool.org \
    --cc=tarantool-patches@dev.tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH v1 2/2] sql: remove implicit cast in bitwise operations' \
    /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