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 3FF282EED2 for ; Sun, 2 Jun 2019 12:35:16 -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 CXBE_-3NZ9KV for ; Sun, 2 Jun 2019 12:35:16 -0400 (EDT) Received: from smtp54.i.mail.ru (smtp54.i.mail.ru [217.69.128.34]) (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 F36B32EECB for ; Sun, 2 Jun 2019 12:35:15 -0400 (EDT) Subject: [tarantool-patches] Re: [PATCH v1 5/9] sql: make SQL_TARANTOOL_ERROR the only errcode of OP_Halt References: From: Vladislav Shpilevoy Message-ID: Date: Sun, 2 Jun 2019 18:35:11 +0200 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 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, imeevma@tarantool.org > * This routine is invoked once per CTE by the parser while parsing a > diff --git a/src/box/sql/expr.c b/src/box/sql/expr.c > index 6ac42d7..a4a2d71 100644 > --- a/src/box/sql/expr.c > +++ b/src/box/sql/expr.c > @@ -4386,9 +4386,10 @@ sqlExprCodeTarget(Parse * pParse, Expr * pExpr, int target) > ON_CONFLICT_ACTION_IGNORE, 0, > pExpr->u.zToken, 0); > } else { > - sqlHaltConstraint(pParse, SQL_CONSTRAINT_TRIGGER, > - pExpr->on_conflict_action, > - pExpr->u.zToken, 0, 0); > + sqlVdbeAddOp4(v, OP_Halt, SQL_TARANTOOL_ERROR, > + pExpr->on_conflict_action, 0, > + pExpr->u.zToken, 0); > + sqlVdbeChangeP5(v, ER_SQL_EXECUTE); Please, remove p5 arg and store error code in p2. Now it can be done with ease. > } > break; > }