Tarantool development patches archive
 help / color / mirror / Atom feed
From: Nikita Pettik <korablev@tarantool.org>
To: tarantool-patches@freelists.org
Cc: Kirill Shcherbatov <kshcherbatov@tarantool.org>
Subject: [tarantool-patches] Re: [PATCH v2 2/3] sql: disallow ck using non-persistent function
Date: Thu, 12 Sep 2019 14:54:05 +0300	[thread overview]
Message-ID: <20190912115405.GA92833@tarantool.org> (raw)
In-Reply-To: <2c39792c46f84fc38b0a3e2b50fb27fc1d229142.1568275504.git.kshcherbatov@tarantool.org>

On 12 Sep 11:06, Kirill Shcherbatov wrote:
> Each CK constraint object is a part of the database schema and
> is restored during recovery. It is not possible if a CK
> constraint uses some user-defined function inside. Thus we should
> disallow non-persistent functions participate in ck constraints.

This patch should be dropped taking into consideration last patch
in series: it implements fix for special case of the problem solved
in the next patch.
 
> diff --git a/test/sql/checks.test.lua b/test/sql/checks.test.lua
> index 9716647d0..051c9ae38 100644
> --- a/test/sql/checks.test.lua
> +++ b/test/sql/checks.test.lua
> @@ -273,6 +273,25 @@ box.execute("DROP TABLE test;")
>  
>  test_run = require('test_run').new()
>  test_run:cmd('switch default')
> -test_run:cmd('stop server test')
> +
> +--
> +-- gh-4176: Can't recover if check constraint involves function.
> +-- Make sure that non-persistent functions can't participate in
> +-- check constraints, since after instance reboot they disappear
> +-- and check constraint can't be created.
> +--
> +function myfunc(x) return x < 10 end
> +box.schema.func.create("MYFUNC", {exports = {'LUA', 'SQL'}, param_list = {'integer'}})

Nit: name shoul be lowercased I guess.
 

  reply	other threads:[~2019-09-12 11:54 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
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   ` Nikita Pettik [this message]
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=20190912115405.GA92833@tarantool.org \
    --to=korablev@tarantool.org \
    --cc=kshcherbatov@tarantool.org \
    --cc=tarantool-patches@freelists.org \
    --subject='[tarantool-patches] Re: [PATCH v2 2/3] sql: disallow ck using non-persistent function' \
    /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