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 A86A62001A for ; Thu, 28 Jun 2018 06:18:41 -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 PsmBVGuoFRnm for ; Thu, 28 Jun 2018 06:18:41 -0400 (EDT) Received: from smtp50.i.mail.ru (smtp50.i.mail.ru [94.100.177.110]) (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 0922824EEB for ; Thu, 28 Jun 2018 06:18:40 -0400 (EDT) Date: Thu, 28 Jun 2018 13:18:39 +0300 From: Alexander Turenko Subject: [tarantool-patches] Re: [PATCH] sql: xfer optimization issue Message-ID: <20180628101839.fhnijezdpwviohop@tkn_work_nb> References: <08FAE06B-F6D3-49BD-9011-B5770629AA21@tarantool.org> <5BB99B27-5F86-4664-AAD5-57A22ECED854@tarantool.org> <93E4DAEA-EF90-479D-9F62-3D1CEB3CBE3F@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: 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: Kirill Yukhin , Nikita Pettik Cc: tarantool-patches@freelists.org, Hollow111 On Fri, May 04, 2018 at 12:54:30PM +0000, Hollow111 wrote: > > @@ -1737,8 +1744,10 @@ xferOptimization(Parse * pParse, /* > Parser context */ > > if (onError == ON_CONFLICT_ACTION_DEFAULT) { > > if (pDest->iPKey >= 0) > > onError = pDest->keyConf; > > - if (onError == ON_CONFLICT_ACTION_DEFAULT) > > + if (onError == ON_CONFLICT_ACTION_DEFAULT) { > > onError = ON_CONFLICT_ACTION_ABORT; > > + confl_action_default = 1; > Why do you need this variable at all? I mean, DEFAULT always > is an alias to ABORT, isn’t 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. If an user asks for ABORT explicitly we should make abort, I think. As I understood the extra variable appears due to the fact than we can have per-column conflict clauses in CREATE TABLE and per-table clause with INSERT OR ABORT. The latter should have precedence, I think. I don't sure whether something (behaviour? code?) should be different from SQLite here in light of #2963 changes. Kirill, Nikita, can you comment, please? WBR, Alexander Turenko.