Tarantool development patches archive
 help / color / mirror / Atom feed
From: Kirill Shcherbatov <kshcherbatov@tarantool.org>
To: Nikita Pettik <korablev@tarantool.org>,
	Tarantool MailList <tarantool-patches@freelists.org>
Subject: [tarantool-patches] Re: [PATCH v2 1/3] box: an ability to disable CK constraints
Date: Thu, 12 Sep 2019 17:15:08 +0300	[thread overview]
Message-ID: <7a9c02d6-9ae9-6c88-cc57-ea379b2967f5@tarantool.org> (raw)
In-Reply-To: <20190912140044.GA97194@tarantool.org>

>> +	struct memtx_engine *memtx =
>> +		(struct memtx_engine *)engine_by_name("memtx");
>> +	assert(memtx != NULL);
> 
> Wait a second, how it is supposed to work with vinyl?
All system spaces use memtx engine. Thus looking for memtx engine state is an
acceptable way to determine, whether Tarantool loaded.

> Nit: method is calles "enable", but it can also disable trigger.
> I'd rename it to "_set_status"/"set_state" etc
I don't like both your variants. "enable" has been proposed by Kostya.

>> +	if (space_foreach(space_run_ck_constraints, (void *)true) != 0)
>> +		unreachable();
> 
> What does this change do? Why do you need param if it is always true?
In the first patch version I used to call this function space_run_ck_constraints with
false and true in two places to enable/disable all check constraint. In my opinion
hardcoding true in smth like space_enable_ck_constraints is not really good idea.

> Is space_is_system() check vital?
It may be omitted. Initially I assumed that system spaces cold not have ck constraints
but actually it is not so now, they could.

  reply	other threads:[~2019-09-12 14:15 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-12  8:06 [tarantool-patches] [PATCH v2 0/3] sql: fixes for ck constraints involving a function Kirill Shcherbatov
2019-09-12  8:06 ` [tarantool-patches] [PATCH v2 1/3] box: an ability to disable CK constraints Kirill Shcherbatov
2019-09-12 14:00   ` [tarantool-patches] " Nikita Pettik
2019-09-12 14:15     ` Kirill Shcherbatov [this message]
2019-09-12  8:06 ` [tarantool-patches] [PATCH v2 2/3] sql: disallow ck using non-persistent function Kirill Shcherbatov
2019-09-12 11:54   ` [tarantool-patches] " Nikita Pettik
2019-09-12  8:06 ` [tarantool-patches] [PATCH v2 3/3] sql: use name instead of function pointer for UDF Kirill Shcherbatov
2019-09-12 12:13   ` [tarantool-patches] " Nikita Pettik

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=7a9c02d6-9ae9-6c88-cc57-ea379b2967f5@tarantool.org \
    --to=kshcherbatov@tarantool.org \
    --cc=korablev@tarantool.org \
    --cc=tarantool-patches@freelists.org \
    --subject='[tarantool-patches] Re: [PATCH v2 1/3] box: an ability to disable CK constraints' \
    /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