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 17D072FCAC for ; Wed, 14 Nov 2018 11:20:39 -0500 (EST) 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 tvNrOexFCx8J for ; Wed, 14 Nov 2018 11:20:39 -0500 (EST) Received: from smtp3.mail.ru (smtp3.mail.ru [94.100.179.58]) (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 9F5A12A570 for ; Wed, 14 Nov 2018 11:20:38 -0500 (EST) From: "n.pettik" Message-Id: Content-Type: multipart/alternative; boundary="Apple-Mail=_BC81A8D7-E4DF-4327-ABAB-31BF70727D2E" Mime-Version: 1.0 (Mac OS X Mail 12.0 \(3445.100.39\)) Subject: [tarantool-patches] Re: [PATCH v2 2/4] sql: account REPLACE as two row changes Date: Wed, 14 Nov 2018 19:20:36 +0300 In-Reply-To: <1cb8f01c-80a8-658a-895f-31649a9e70e8@tarantool.org> References: <60bebfba861b6378f0bf5de24effba83370a4e7b.1542124689.git.korablev@tarantool.org> <1cb8f01c-80a8-658a-895f-31649a9e70e8@tarantool.org> 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 Cc: Vladislav Shpilevoy --Apple-Mail=_BC81A8D7-E4DF-4327-ABAB-31BF70727D2E Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii > Thanks for the patch! >=20 > On 13/11/2018 19:11, Nikita Pettik wrote: >> In our SQL implementation REPLACE acts as DELETE + INSERT, so we = should >> account it as two row changes. >> Needed for #2181 >> --- >> src/box/sql/insert.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-)> diff --git = a/src/box/sql/insert.c b/src/box/sql/insert.c >> index fd05c0254..a53568810 100644 >> --- a/src/box/sql/insert.c >> +++ b/src/box/sql/insert.c >> @@ -1076,7 +1076,7 @@ process_index: ; >> sql_triggers_exist(tab, TK_DELETE, NULL, = NULL); >> sql_generate_row_delete(parse_context, tab, = trigger, >> cursor, idx_key_reg, = part_count, >> - false, >> + true, >> = ON_CONFLICT_ACTION_REPLACE, >> ONEPASS_SINGLE, -1); >> sqlite3VdbeResolveLabel(v, skip_index); >=20 > I added a test on the branch and here: Applied as obvious. Thx. --Apple-Mail=_BC81A8D7-E4DF-4327-ABAB-31BF70727D2E Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=us-ascii
Thanks for the patch!

On 13/11/2018 19:11, Nikita = Pettik wrote:
In = our SQL implementation REPLACE acts as DELETE + INSERT, so we should
account it as two row changes.
Needed for = #2181
---
 src/box/sql/insert.c | 2 = +-
 1 file changed, 1 insertion(+), 1 deletion(-)> = diff --git a/src/box/sql/insert.c b/src/box/sql/insert.c
index fd05c0254..a53568810 100644
--- = a/src/box/sql/insert.c
+++ b/src/box/sql/insert.c
@@ -1076,7 +1076,7 @@ process_index:  ;
  sql_triggers_exist(tab, TK_DELETE, NULL, NULL);
  sql_generate_row_delete(parse_context, tab, trigger,
  cursor, idx_key_reg, part_count,
- false,
+ = = = = = = true,
  ON_CONFLICT_ACTION_REPLACE,
  ONEPASS_SINGLE, -1);
  = sqlite3VdbeResolveLabel(v, skip_index);

I added a test on the branch and here:

Applied as = obvious. Thx.

= --Apple-Mail=_BC81A8D7-E4DF-4327-ABAB-31BF70727D2E--