Tarantool development patches archive
 help / color / mirror / Atom feed
From: "n.pettik" <korablev@tarantool.org>
To: tarantool-patches@freelists.org
Cc: Kirill Shcherbatov <kshcherbatov@tarantool.org>
Subject: [tarantool-patches] Re: [PATCH v2 3/5] sql: fix fkey exception for self-referenced table
Date: Sat, 29 Dec 2018 15:26:17 +0200	[thread overview]
Message-ID: <B149ECA7-7C17-4AC8-AFE4-3A31EDE35879@tarantool.org> (raw)
In-Reply-To: <e9484074ecd92eed341a3327504b2b7ccfc21b77.1546079994.git.kshcherbatov@tarantool.org>


> UPDATE operation doesn't fail when fkey self-reference condition
> unsatisfied, when table has other records.

Nit: ... and table has other records.

> To do not raise error where it is not necessary Vdbe makes

It is russian-like collocation, we can’t ‘make’ lookup.

"… Vdbe inspects parent table emitting OP_Found" (or smth like this) 

> lookup in parent table with OP_Found. This branch is not valid
> for self-referenced table since its looking for a tuple affected
> by UPDATE operation and since the foreign key has already
> detected a conflict it mast be raised.

Nit: must.

Sorry for being so picky.

> 
> Example:
> CREATE TABLE t6(a INTEGER PRIMARY KEY, b TEXT, c INT, d TEXT, UNIQUE(a, b),
>                FOREIGN KEY(c, d) REFERENCES t6(a, b));
> INSERT INTO t6 VALUES(1, 'a', 1, 'a');
> INSERT INTO t6 VALUES(100, 'one', 100, 'one');
> UPDATE t6 SET c = 1, d = 'a' WHERE a = 100;
> -- fk conflict must be raised here
> 
> Needed for #3850
> Closes #3918
> —

Patch itself is OK.
Anyway, I am still interested why SQLite demonstrates
this behaviour. I believe they know about it and don't
fix it so far.

  reply	other threads:[~2018-12-29 13:26 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-29 10:48 [tarantool-patches] [PATCH v2 0/5] sql: do not use OP_Delete+OP_Insert for UPDATES 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   ` n.pettik [this message]
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 ` [tarantool-patches] Re: [PATCH v2 0/5] " Kirill Yukhin

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=B149ECA7-7C17-4AC8-AFE4-3A31EDE35879@tarantool.org \
    --to=korablev@tarantool.org \
    --cc=kshcherbatov@tarantool.org \
    --cc=tarantool-patches@freelists.org \
    --subject='[tarantool-patches] Re: [PATCH v2 3/5] sql: fix fkey exception for self-referenced table' \
    /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