From: Imeev Mergen <imeevma@tarantool.org>
To: "n.pettik" <korablev@tarantool.org>, tarantool-patches@freelists.org
Subject: [tarantool-patches] Re: [PATCH v1 1/1] sql: Fix UPDATE for types unknown to SQL.
Date: Tue, 9 Jul 2019 12:14:18 +0300 [thread overview]
Message-ID: <09286d9d-870b-f5dd-f328-56d374173160@tarantool.org> (raw)
In-Reply-To: <B9AF5233-639F-4A6F-BC2B-23949037ADDB@tarantool.org>
[-- Attachment #1: Type: text/plain, Size: 1043 bytes --]
Hi! Thank you for review. My answer below.
On 7/8/19 4:32 PM, n.pettik wrote:
>
>> Diff:
>>
>> diff --git a/src/box/sql/vdbe.c b/src/box/sql/vdbe.c
>> index f8cf1af..79232de 100644
>> --- a/src/box/sql/vdbe.c
>> +++ b/src/box/sql/vdbe.c
>> @@ -351,19 +351,22 @@ mem_apply_type(struct Mem *record, enum
>> field_type type)
>> return 0;
>> case FIELD_TYPE_SCALAR:
>> /* Can't cast MAP and ARRAY to scalar types. */
>> -if (record->subtype == SQL_SUBTYPE_MSGPACK) {
>> +if ((record->flags & MEM_Blob) == MEM_Blob &&
>
> Why do you need this additional check on MEM_Blob?
> Is it possible that memory holds raw msgpack and its
> type not blob? If so, please provide an example.
>
I'm not sure what you describe is possible. But it is impossible
to say what type MEM has when you look at the SUBTYPE. At the same
time, the subtype has any meaning only for BLOBs. Any other type
has any SUBTYPE, and it is not checked anywhere. So, to avoid an
error, when something, for example INT, throws an error when
casting to SCALAR, I added these checks.
[-- Attachment #2: Type: text/html, Size: 16646 bytes --]
next prev parent reply other threads:[~2019-07-09 9:14 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-28 15:34 [tarantool-patches] " imeevma
2019-07-01 23:29 ` [tarantool-patches] " n.pettik
2019-07-08 10:13 ` Mergen Imeev
2019-07-08 13:32 ` n.pettik
2019-07-09 9:14 ` Imeev Mergen [this message]
2019-07-15 13:32 ` n.pettik
2019-07-16 14:19 ` Mergen Imeev
2019-07-18 15:59 ` n.pettik
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=09286d9d-870b-f5dd-f328-56d374173160@tarantool.org \
--to=imeevma@tarantool.org \
--cc=korablev@tarantool.org \
--cc=tarantool-patches@freelists.org \
--subject='[tarantool-patches] Re: [PATCH v1 1/1] sql: Fix UPDATE for types unknown to SQL.' \
/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