[tarantool-patches] Re: [PATCH v2 2/3] sql: disallow ck using non-persistent function

Nikita Pettik korablev at tarantool.org
Thu Sep 12 14:54:05 MSK 2019


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.
 




More information about the Tarantool-patches mailing list