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 2E75C23CF7 for ; Fri, 4 May 2018 08:54:45 -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 kmDHD1XeYkgX for ; Fri, 4 May 2018 08:54:45 -0400 (EDT) Received: from mail-lf0-f44.google.com (mail-lf0-f44.google.com [209.85.215.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTPS id BE9CA23840 for ; Fri, 4 May 2018 08:54:42 -0400 (EDT) Received: by mail-lf0-f44.google.com with SMTP id y14-v6so30416584lfy.12 for ; Fri, 04 May 2018 05:54:42 -0700 (PDT) MIME-Version: 1.0 References: <1524065531-32467-1-git-send-email-hollow653@gmail.com> <08FAE06B-F6D3-49BD-9011-B5770629AA21@tarantool.org> <5BB99B27-5F86-4664-AAD5-57A22ECED854@tarantool.org> <93E4DAEA-EF90-479D-9F62-3D1CEB3CBE3F@tarantool.org> In-Reply-To: From: Hollow111 Date: Fri, 04 May 2018 12:54:30 +0000 Message-ID: Subject: [tarantool-patches] Re: [PATCH] sql: xfer optimization issue Content-Type: multipart/alternative; boundary="000000000000cea68b056b60d2a7" 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: korablev@tarantool.org Cc: tarantool-patches@freelists.org --000000000000cea68b056b60d2a7 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable > @@ -1737,8 +1744,10 @@ xferOptimization(Parse * pParse, /* Parser context */ > if (onError =3D=3D ON_CONFLICT_ACTION_DEFAULT) { > if (pDest->iPKey >=3D 0) > onError =3D pDest->keyConf; > - if (onError =3D=3D ON_CONFLICT_ACTION_DEFAULT) > + if (onError =3D=3D ON_CONFLICT_ACTION_DEFAULT) { > onError =3D ON_CONFLICT_ACTION_ABORT; > + confl_action_default =3D 1; Why do you need this variable at all? I mean, DEFAULT always is an alias to ABORT, isn=E2=80=99t it? Yes, it is, but there's a little difference between directly specified ABORT for an insert stmt (INSERT OR ABORT) and just INSERT without any specified error action (ABORT specified by the internals). When you directly specify it ABORT is a higher priority action than in case there's a column with REPLACE error action. Thus we can even insert not in the empty destination table. --000000000000cea68b056b60d2a7 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
> @@ -1737,8 +1744,10 @@ xferOptimiz= ation(Parse * pParse,=C2=A0 =C2=A0 =C2=A0 =C2=A0/* Parser context */
>= ;=C2=A0 =C2=A0 =C2=A0 =C2=A0if (onError =3D=3D ON_CONFLICT_ACTION_DEFAULT) = {
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if (pDest-&= gt;iPKey >=3D 0)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0onError =3D pDest->keyConf;
> -= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if (onError =3D=3D ON_CONFL= ICT_ACTION_DEFAULT)
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0if (onError =3D=3D ON_CONFLICT_ACTION_DEFAULT) {
>=C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0onErro= r =3D ON_CONFLICT_ACTION_ABORT;
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0confl_action_default =3D 1;
Why do you need this variable at all? I= mean, DEFAULT always
is an alias to ABORT,= isn=E2=80=99t it?

<= div>Yes, it is, but there's a little d= ifference between directly specified ABORT for an
insert stmt (INSERT OR ABORT) and just INSERT with= out any specified error action
(ABORT specified by the internals).=C2=A0When you directly specify it ABORT is a higher priority<= /div>
action than in case=C2=A0= there's a column with REPLACE error ac= tion. Thus we can even=C2=A0= insert
not in the empty d= estination table.
--000000000000cea68b056b60d2a7--