From: Kirill Yukhin <kyukhin@tarantool.org>
To: tarantool-patches@freelists.org
Cc: korablev@tarantool.org, Kirill Shcherbatov <kshcherbatov@tarantool.org>
Subject: [tarantool-patches] Re: [PATCH v2 0/5] sql: do not use OP_Delete+OP_Insert for UPDATES
Date: Thu, 10 Jan 2019 15:30:51 +0300 [thread overview]
Message-ID: <20190110123051.j6j54d5kvlybmays@tarantool.org> (raw)
In-Reply-To: <cover.1546079994.git.kshcherbatov@tarantool.org>
Hello,
On 29 Dec 13:48, Kirill Shcherbatov wrote:
> Introduced a new OP_Update opcode making Tarantool native Update
> operation.
> In case of UPDATE or REPLACE we can't use new OP_Update as it
> has a complex SQL-specific semantics:
>
> CREATE TABLE tj (s1 INT PRIMARY KEY, s2 INT);
> INSERT INTO tj VALUES (1, 3),(2, 4),(3,5);
> CREATE UNIQUE INDEX i ON tj (s2);
> SELECT * FROM tj;
> [1, 3], [2, 4], [3, 5]
> UPDATE OR REPLACE tj SET s2 = s2 + 1;
> SELECT * FROM tj;
> [1, 4], [3, 6]
>
> I.e. [1, 3] tuple is updated as [1, 4] and have replaced tuple
> [2, 4]. This logic is implemented as preventive tuples deletion
> by all corresponding indexes in SQL.
>
> The other significant change is forbidden primary key update.
> It was possible to deal with it the same way like with or
> REPLACE specifier but we need an atomic UPDATE step for #3691
> ticket to support "or IGNORE/or ABORT/or FAIL" specifiers.
> Reworked tests to make testing avoiding primary key UPDATE where
> possible.
>
> Fixed bug in VDBE - sometimes temporal tuples in memory allocated
> with sql_vdbe_mem_alloc_region were stored in Mem variable having
> invalid flags set.
>
> Changes in version 2:
> - Reworked part of code to close tikets #3035, #3918: reused
> a new routine mpstream_encode_vdbe_mem to encode tuples on
> region everywhere on Vdbe execution: got rid of routines
> sqlite3VdbeMsgpackRecordLen and sqlite3VdbeMsgpackRecordPut
> that became useless.
> - Fixed few spell mistakes in comments and commit messages
> - Minor code changes: better mpstream methods names, changed
> OP_IdxUpdate to OP_Update name.
>
> Branch: http://github.com/tarantool/tarantool/tree/kshch/gh-3850-op-update
> Issue: https://github.com/tarantool/tarantool/issues/3850
I've checked your patch set into 2.1 branch.
--
Regards, Kirill Yukhin
prev parent reply other threads:[~2019-01-10 12:30 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-29 10:48 [tarantool-patches] " Kirill Shcherbatov
2018-12-29 10:48 ` [tarantool-patches] [PATCH v2 1/5] sql: clean-up vdbe_emit_constraint_checks Kirill Shcherbatov
2018-12-29 10:48 ` [tarantool-patches] [PATCH v2 2/5] sql: fix sql_vdbe_mem_alloc_region result memory Kirill Shcherbatov
2018-12-29 10:49 ` [tarantool-patches] [PATCH v2 3/5] sql: fix fkey exception for self-referenced table Kirill Shcherbatov
2018-12-29 13:26 ` [tarantool-patches] " n.pettik
2018-12-29 10:49 ` [tarantool-patches] [PATCH v2 4/5] sql: encode tuples with mpstream on Vdbe run Kirill Shcherbatov
2018-12-29 13:26 ` [tarantool-patches] " n.pettik
2018-12-29 15:28 ` Kirill Shcherbatov
2019-01-09 12:29 ` n.pettik
2018-12-29 10:49 ` [tarantool-patches] [PATCH v2 5/5] sql: do not use OP_Delete+OP_Insert for UPDATES Kirill Shcherbatov
2018-12-29 13:35 ` [tarantool-patches] " n.pettik
2018-12-29 15:31 ` Kirill Shcherbatov
2019-01-10 12:30 ` Kirill Yukhin [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190110123051.j6j54d5kvlybmays@tarantool.org \
--to=kyukhin@tarantool.org \
--cc=korablev@tarantool.org \
--cc=kshcherbatov@tarantool.org \
--cc=tarantool-patches@freelists.org \
--subject='[tarantool-patches] Re: [PATCH v2 0/5] sql: do not use OP_Delete+OP_Insert for UPDATES' \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox