From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id DB6E42624D for ; Tue, 5 Feb 2019 12:46:27 -0500 (EST) Received: from turing.freelists.org ([127.0.0.1]) by localhost (turing.freelists.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id BLGknf234ac2 for ; Tue, 5 Feb 2019 12:46:27 -0500 (EST) Received: from smtpng3.m.smailru.net (smtpng3.m.smailru.net [94.100.177.149]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTPS id 6511B2621D for ; Tue, 5 Feb 2019 12:46:27 -0500 (EST) From: "n.pettik" Message-Id: <273BF938-8D9C-4C1B-8D6B-1FD7087FD6E2@tarantool.org> Content-Type: multipart/alternative; boundary="Apple-Mail=_0D37E0AC-001F-4329-887B-5A0F27DDF927" Mime-Version: 1.0 (Mac OS X Mail 12.2 \(3445.102.3\)) Subject: [tarantool-patches] Re: [PATCH 5/8] sql: replace field type with affinity for VDBE runtime Date: Tue, 5 Feb 2019 20:46:25 +0300 In-Reply-To: <69deceb9-307d-047b-d0de-fa463137bf46@tarantool.org> References: <6e7623ee-fdcc-616f-6a99-20aff0e97f43@tarantool.org> <93178595-D7AF-49DE-8273-0FBD18545D56@tarantool.org> <115cb635-13f4-1946-22b3-36b828d9d679@tarantool.org> <2ED4082B-7899-4880-8FF2-25E1A3E6D90B@tarantool.org> <69deceb9-307d-047b-d0de-fa463137bf46@tarantool.org> Sender: tarantool-patches-bounce@freelists.org Errors-to: tarantool-patches-bounce@freelists.org Reply-To: tarantool-patches@freelists.org List-help: List-unsubscribe: List-software: Ecartis version 1.0.0 List-Id: tarantool-patches List-subscribe: List-owner: List-post: List-archive: To: tarantool-patches@freelists.org Cc: Vladislav Shpilevoy --Apple-Mail=_0D37E0AC-001F-4329-887B-5A0F27DDF927 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On 5 Feb 2019, at 18:08, Vladislav Shpilevoy = wrote: >=20 > Hi! Thanks for the fixes! >=20 >>>> diff --git a/src/box/sql/vdbe.c b/src/box/sql/vdbe.c >>>> index 24d992284..80d2fd0aa 100644 >>>> --- a/src/box/sql/vdbe.c >>>> +++ b/src/box/sql/vdbe.c >>>> @@ -2881,7 +2873,7 @@ case OP_MakeRecord: { >>>> * of the record to data0. >>>> */ >>>> nField =3D pOp->p1; >>>> - zAffinity =3D pOp->p4.z; >>>> + enum field_type *types =3D (enum field_type *)pOp->p4.z; >>>=20 >>> 2. Maybe, it is worth adding enum field_type *types into = VdbeOp.p4union >>> and do not cast. Like we did with many other pointers. >> Thanks for suggestion, but I guess it is not necessary now. >> Lets consider this refactoring a bit later. >=20 > Space * and other members of p4union also were not > necessary, but they make it easier to understand what can > be stored in p4, when you look at struct VdbeOp. So please, > apply this: Ok, sorry, I slightly misunderstood your proposal: I forgot that they would have the same layout and we wouldn=E2=80=99t have to refactor sqlite3VdbeChangeP4() with P4_FIELDTYPE and so on. Thanks, applied. --Apple-Mail=_0D37E0AC-001F-4329-887B-5A0F27DDF927 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8
On = 5 Feb 2019, at 18:08, Vladislav Shpilevoy <v.shpilevoy@tarantool.org> wrote:

Hi! Thanks for the = fixes!

diff --git a/src/box/sql/vdbe.c b/src/box/sql/vdbe.c
index 24d992284..80d2fd0aa 100644
--- = a/src/box/sql/vdbe.c
+++ b/src/box/sql/vdbe.c
@@ -2881,7 +2873,7 @@ case OP_MakeRecord: {
 * of the record to = data0.
 */
= nField =3D pOp->p1;
- zAffinity = =3D pOp->p4.z;
+ enum field_type *types =3D (enum = field_type *)pOp->p4.z;

2. = Maybe, it is worth adding enum field_type *types into VdbeOp.p4union
and do not cast. Like we did with many other pointers.
Thanks for suggestion, but I guess it is not = necessary now.
Lets consider this refactoring a bit = later.

Space * and other members of p4union also were not
necessary, but they make it = easier to understand what can
be stored in p4, when you look at struct VdbeOp. So = please,
apply = this:

Ok, = sorry, I slightly misunderstood your proposal:
I forgot that = they would have the same layout and
we wouldn=E2=80=99t have = to refactor sqlite3VdbeChangeP4()
with P4_FIELDTYPE and so on. = Thanks, applied.

= --Apple-Mail=_0D37E0AC-001F-4329-887B-5A0F27DDF927--