[tarantool-patches] Re: [PATCH 1/6] sql: split conflict action and affinity for Expr
Vladislav Shpilevoy
v.shpilevoy at tarantool.org
Thu Sep 27 23:24:02 MSK 2018
See 1 comment below.
On 17/09/2018 23:32, Nikita Pettik wrote:
> From: Georgy Kirichenko <georgy at tarantool.org>
>
> 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 */
More information about the Tarantool-patches
mailing list