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 F23FD2BC6E for ; Thu, 27 Sep 2018 16:24:04 -0400 (EDT) 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 jzf-i1DgXrjm for ; Thu, 27 Sep 2018 16:24:04 -0400 (EDT) Received: from smtp58.i.mail.ru (smtp58.i.mail.ru [217.69.128.38]) (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 B186D2BC33 for ; Thu, 27 Sep 2018 16:24:04 -0400 (EDT) Subject: [tarantool-patches] Re: [PATCH 1/6] sql: split conflict action and affinity for Expr References: <38b42cc370c2e531bb864e6172b8282d14073d56.1537216078.git.korablev@tarantool.org> From: Vladislav Shpilevoy Message-ID: <0bd6c03a-20f7-7b49-31b2-429f4302bb32@tarantool.org> Date: Thu, 27 Sep 2018 23:24:02 +0300 MIME-Version: 1.0 In-Reply-To: <38b42cc370c2e531bb864e6172b8282d14073d56.1537216078.git.korablev@tarantool.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit 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, Nikita Pettik Cc: Georgy Kirichenko See 1 comment below. On 17/09/2018 23:32, Nikita Pettik wrote: > From: Georgy Kirichenko > > Lets introduce separate field in struct Expr to store conflict action of > RAISE() function, instead of messing it with affinity. > --- > src/box/sql/expr.c | 46 ++++++++++++++++++---------------------------- > src/box/sql/fkey.c | 2 +- > src/box/sql/parse.y | 4 ++-- > src/box/sql/sqliteInt.h | 5 ++++- > src/box/sql/treeview.c | 6 ++++-- > 5 files changed, 29 insertions(+), 34 deletions(-) > > diff --git a/src/box/sql/sqliteInt.h b/src/box/sql/sqliteInt.h > index 1d32c9a03..5ca628aac 100644 > --- a/src/box/sql/sqliteInt.h > +++ b/src/box/sql/sqliteInt.h > @@ -2106,7 +2106,10 @@ typedef int ynVar; > */ > struct Expr { > u8 op; /* Operation performed by this node */ > - char affinity; /* The affinity of the column or 0 if not a column */ > + /** The affinity of the column or 0 if not a column. */ > + enum affinity_type affinity; > + /** Conflict action for RAISE() function. */ > + enum on_conflict_action on_conflict_action; As I understand, these two attributes are mutually exclusive, am I right? Could you put them into a union instead of the separate fields? > u32 flags; /* Various flags. EP_* See below */ > union { > char *zToken; /* Token value. Zero terminated and dequoted */