Tarantool development patches archive
 help / color / mirror / Atom feed
From: Kirill Shcherbatov <kshcherbatov@tarantool.org>
To: tarantool-patches@freelists.org,
	Vladislav Shpilevoy <v.shpilevoy@tarantool.org>
Subject: [tarantool-patches] Re: [PATCH v4 4/4] box: user-friendly interface to manage ck constraints
Date: Fri, 31 May 2019 16:45:33 +0300	[thread overview]
Message-ID: <6befe4a1-5089-b9ce-13ea-ed7b14a8dee1@tarantool.org> (raw)
In-Reply-To: <a56527e2-11db-1039-2a61-740b24e43183@tarantool.org>

>>> 4. lbox_ck_constraint_what? If a function is not a getter, it should
>>> have a verb saying what the function does.
>>>
>>> What is 'i' argument? Index of space table?
>> This code is all similar to the code that is near it...
> 
> It does not mean, that it is good. Besides, you did not
> answer the question, and still did nothing in the new
> version of the patch about that place.

/**
 * Make ck_constraints available in Lua, via ck_constraint[]
 * array for space table by given index i.
 * Updata a ck_constraint table in the parent space table object
 * on the Lua stack.
 */
static void
lbox_push_ck_constraint(struct lua_State *L, struct space *space, int i)

> 
>>
>>> 5. Why do you avoid serialization? What will happen,
>>> if I will write
>>>
>>>     tarantool> s1.ck_constraint.physics
>> I don't like space_id to be show. It may differ.
> 
> You can hide it with a test-run filter, or remember it
> into a copy table, nullify space_id, and print the rest.
> Anyway, you need to check serialization.
Nice idea. I've solved this problem using filter:

test_run:cmd("push filter 'space_id: [0-9]+' to 'space_id: <ID>'")

>>> 6. The test does not check, that after a constraint is
>>> dropped, a tuple can be inserted violating the dropped
>>> constraint.
>> It is not so, actually I test exactly this case.
> 
> Where? I opened the test file, and there is only one
> place, where you drop a constraint, but after it all
> insertions fail. I do not see a successful insertion.
> This is all the code after a single ck constraint drop:
....
> All the insertions fail.
s2.ck_constraint.greater:drop()
---
...
s2:insert({1, 2})
---
- error: 'Check constraint failed ''physics'': X > Y'
...
s2:insert({2, 1})
---
- [2, 1]
...



> 
> By the way, what happens, if a constraint object is assigned
> to a local variable, then its space is dropped. What if I
> then call :drop() on the constraint object?
s2:drop()
---
...
physics_ck
---
- []
...
physics_ck:drop()
---
- error: '[string "return physics_ck:drop() "]:1: attempt to call method ''drop''
    (a nil value)'
...

  reply	other threads:[~2019-05-31 13:45 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-16 13:56 [tarantool-patches] [PATCH v4 0/4] box: run checks on insertions in LUA spaces Kirill Shcherbatov
2019-05-16 13:56 ` [tarantool-patches] [PATCH v4 1/4] schema: add new system space for CHECK constraints Kirill Shcherbatov
2019-05-19 16:01   ` [tarantool-patches] " Vladislav Shpilevoy
2019-05-23 10:32     ` Kirill Shcherbatov
2019-05-26 12:03       ` Vladislav Shpilevoy
2019-05-31 13:45         ` Kirill Shcherbatov
2019-05-16 13:56 ` [tarantool-patches] [PATCH v4 2/4] box: run check constraint tests on space alter Kirill Shcherbatov
2019-05-19 16:02   ` [tarantool-patches] " Vladislav Shpilevoy
2019-05-23 10:37     ` Kirill Shcherbatov
2019-05-16 13:56 ` [tarantool-patches] [PATCH v4 3/4] box: introduce column_mask for ck constraint Kirill Shcherbatov
2019-05-19 16:02   ` [tarantool-patches] " Vladislav Shpilevoy
2019-05-23 10:38     ` Kirill Shcherbatov
2019-05-26 12:03     ` Vladislav Shpilevoy
2019-05-31 13:45       ` Kirill Shcherbatov
2019-05-16 13:56 ` [tarantool-patches] [PATCH v4 4/4] box: user-friendly interface to manage ck constraints Kirill Shcherbatov
2019-05-19 16:02   ` [tarantool-patches] " Vladislav Shpilevoy
2019-05-23 10:41     ` Kirill Shcherbatov
2019-05-26 12:04       ` Vladislav Shpilevoy
2019-05-31 13:45         ` Kirill Shcherbatov [this message]
2019-06-03 21:15           ` Vladislav Shpilevoy

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=6befe4a1-5089-b9ce-13ea-ed7b14a8dee1@tarantool.org \
    --to=kshcherbatov@tarantool.org \
    --cc=tarantool-patches@freelists.org \
    --cc=v.shpilevoy@tarantool.org \
    --subject='[tarantool-patches] Re: [PATCH v4 4/4] box: user-friendly interface to manage 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