Tarantool development patches archive
 help / color / mirror / Atom feed
From: "n.pettik" <korablev@tarantool.org>
To: tarantool-patches@freelists.org
Cc: Vladislav Shpilevoy <v.shpilevoy@tarantool.org>
Subject: [tarantool-patches] Re: [PATCH 1/3] txn: move fk_deferred_count from psql_txn to txn
Date: Thu, 15 Aug 2019 14:03:18 +0300	[thread overview]
Message-ID: <27CE4324-3D92-4E89-B4BD-FFA7AD6C9A92@tarantool.org> (raw)
In-Reply-To: <1a4473c8-c4c7-faf4-3c27-54fd77a2532f@tarantool.org>



> On 9 Aug 2019, at 23:59, Vladislav Shpilevoy <v.shpilevoy@tarantool.org> wrote:
> 
> Hi! Thanks for the patch!
> 
>> diff --git a/src/box/txn.h b/src/box/txn.h
>> index 37d90932b..87e880a6a 100644
>> --- a/src/box/txn.h
>> +++ b/src/box/txn.h
>> @@ -213,6 +208,7 @@ struct txn {
>> 	struct trigger fiber_on_stop;
>> 	/** Commit and rollback triggers. */
>> 	struct rlist on_commit, on_rollback;
>> +	uint32_t fk_deferred_count;
> 
> Please, add a comment. A detailed one. That this number is used
> by SQL only, what does it mean 'deferred fk', why is it stored
> in the transaction.

Done:

diff --git a/src/box/txn.h b/src/box/txn.h
index 87e880a6a..f795cb76f 100644
--- a/src/box/txn.h
+++ b/src/box/txn.h
@@ -208,6 +208,17 @@ struct txn {
        struct trigger fiber_on_stop;
        /** Commit and rollback triggers. */
        struct rlist on_commit, on_rollback;
+       /**
+        * This member represents counter of deferred foreign key
+        * violations within transaction. DEFERRED mode means
+        * that until transaction is committed violations are
+        * allowed to appear. However, transaction can't be
+        * committed in presence of violations, i.e. if this
+        * counter is not equal to zero. In the normal mode
+        * violations of FK are checked at the end of each
+        * statement processing. Note that at the moment it is
+        * SQL specific property.
+        */
        uint32_t fk_deferred_count;
        struct sql_txn *psql_txn;
 };

  reply	other threads:[~2019-08-15 11:03 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-07 15:13 [tarantool-patches] [PATCH 0/3] Merge struct sql_txn into struct txn/savepoint Nikita Pettik
2019-08-07 15:13 ` [tarantool-patches] [PATCH 1/3] txn: move fk_deferred_count from psql_txn to txn Nikita Pettik
2019-08-09 20:59   ` [tarantool-patches] " Vladislav Shpilevoy
2019-08-15 11:03     ` n.pettik [this message]
2019-08-07 15:13 ` [tarantool-patches] [PATCH 2/3] txn: merge struct sql_txn into struct txn Nikita Pettik
2019-08-07 15:26   ` [tarantool-patches] " Konstantin Osipov
2019-08-09 21:02   ` Vladislav Shpilevoy
2019-08-12 21:55     ` Konstantin Osipov
2019-08-15 11:04     ` n.pettik
2019-08-15 22:03       ` Vladislav Shpilevoy
2019-08-16 18:52         ` n.pettik
2019-08-19 20:47           ` Vladislav Shpilevoy
2019-08-21  0:23             ` n.pettik
2019-08-21 20:45               ` Vladislav Shpilevoy
2019-08-07 15:13 ` [tarantool-patches] [PATCH 3/3] sql: use struct txn_savepoint as anonymous savepoint Nikita Pettik
2019-08-07 15:26 ` [tarantool-patches] Re: [PATCH 0/3] Merge struct sql_txn into struct txn/savepoint Konstantin Osipov
2019-08-22 11:56 ` 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=27CE4324-3D92-4E89-B4BD-FFA7AD6C9A92@tarantool.org \
    --to=korablev@tarantool.org \
    --cc=tarantool-patches@freelists.org \
    --cc=v.shpilevoy@tarantool.org \
    --subject='[tarantool-patches] Re: [PATCH 1/3] txn: move fk_deferred_count from psql_txn to txn' \
    /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