From: Roman Khabibov <roman.habibov@tarantool.org> To: tarantool-patches@freelists.org Cc: v.shpilevoy@tarantool.org Subject: [tarantool-patches] [PATCH 1/2] schema: add "_vcollation" sysview Date: Thu, 30 May 2019 15:36:02 +0300 [thread overview] Message-ID: <5eab44d0494d7622ef5fbb77c45229a09212d9bc.1559219194.git.roman.habibov@tarantool.org> (raw) In-Reply-To: <cover.1559219194.git.roman.habibov@tarantool.org> Add "_vcollation" sysview to read it from net.box. This sysview is always readable, exept when the user doesn't have "public" role. Needed for #3941 --- src/box/bootstrap.snap | Bin 4374 -> 4441 bytes src/box/lua/space.cc | 2 + src/box/lua/upgrade.lua | 25 ++++++++ src/box/schema_def.h | 2 + src/box/sysview.c | 13 ++++ test/app-tap/tarantoolctl.test.lua | 4 +- test/box-py/bootstrap.result | 13 +++- test/box/access_misc.result | 4 ++ test/box/access_sysview.result | 92 ++++++++++++++++++++++++++--- test/box/access_sysview.test.lua | 30 ++++++++++ test/box/alter.result | 6 +- test/wal_off/alter.result | 2 +- 12 files changed, 180 insertions(+), 13 deletions(-) diff --git a/src/box/bootstrap.snap b/src/box/bootstrap.snap index 871a93f9856f97636ad55b7f5260e5c6957fef36..4e93a794a0608710a2bb93e96e9031451186bf01 100644 GIT binary patch literal 4441 zcmV-f5vJ}_PC-x#FfK7O3RY!ub7^mGIv_GGGA=MJGC49WXEkDGHfA<7HZclGZgX^D zZewLSAZ0UTWj8QoW-T}~Vl^!^G&40VVmLN4EjMOmV>UQqF=I6_VhUD6Y;R+0Iv{&} z3JTS_3%bn^-T=-7f<eKh0000004TLD{Qyv{h5#CsSRqCbkk~l@3;+xOdU@HTEDz~p z+BX^(yPn0f4L~;l9QsnGq$X36ku4=DlgO!mdPKbrZ7!#tL!6h=TVNc<ruKgh$s0t8 z1Qr4a0`vj1od+O9S&WOac-O%P7?be;<1rmzoN_?s95)zqjv8=qj^`+516mv>4Q6pN z5R+@N@^vvz7$;E#lYuB=5JpTd0Hb$bFqrKuxIkwSxAXFa=G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gj5LoixFMkk)N0)%N~ zE-p-dAVAr&5G-T#-`cag8Ot5Re#*GG?>4dLFN=m729Yya7)h%h5u*T+C1OEsyl^RY z9=&k!gVhJ{3ZZ2o!oK=O4aNeNuuO7*e_Ra{TVoQZed}kR*8wQB#FB>4L%p!ia4=$e zYOuO=uXI%bH>&a%2UGEhi%6AqE-P;j9BOma-w;Ih`Yx@O3_ducSwe8ZIn+vQ2?-3= z%|9yMPJ!n;klelKR<4>U<6rW-U47{x7*d#zsvrw0JEj}b^1vXuaN4jv$A2^-Zc)<K zP@MU2;Kleeq#R$<iXQ?{@G39C0{$kmg+I+mNCY}1jz*t=_EuMcmc#XDGvBU41sMlx z&(6N*l}yPX=uUz4e|kXz)Y#m?IJ~=~7!7Fp3|R~51m>qn^BoGAo*o-+n<;~iD;J7| zQLrKBBIVi0?L%RO#>v{Vv)k7d4KXYOEKzvjJjy0iFhW+J&3wO~^YE6AxO(yzw(ydk zxP5vTci75K+-tH!hy7wCv~j)#kA)dcT=i~!v)V9cG5(s%(U4@}&rtx^8Z@h$qsLi+ QJ>-q$w`eZc2h|X*?NOjQ=l}o! diff --git a/src/box/lua/space.cc b/src/box/lua/space.cc index 100da0a79..fbfc2a64d 100644 --- a/src/box/lua/space.cc +++ b/src/box/lua/space.cc @@ -525,6 +525,8 @@ box_lua_space_init(struct lua_State *L) lua_setfield(L, -2, "FUNC_ID"); lua_pushnumber(L, BOX_COLLATION_ID); lua_setfield(L, -2, "COLLATION_ID"); + lua_pushnumber(L, BOX_VCOLLATION_ID); + lua_setfield(L, -2, "VCOLLATION_ID"); lua_pushnumber(L, BOX_VFUNC_ID); lua_setfield(L, -2, "VFUNC_ID"); lua_pushnumber(L, BOX_PRIV_ID); diff --git a/src/box/lua/upgrade.lua b/src/box/lua/upgrade.lua index 89d6e3d52..f2a1be639 100644 --- a/src/box/lua/upgrade.lua +++ b/src/box/lua/upgrade.lua @@ -737,6 +737,30 @@ local function upgrade_to_2_1_3() end end +local function create_vcollation_space() + local _collation = box.space._collation + local format = _collation:format() + create_sysview(box.schema.COLLATION_ID, box.schema.VCOLLATION_ID) + box.space[box.schema.VCOLLATION_ID]:format(format) +end + +local function upgrade_to_2_1_4() + local _collation = box.space._collation + local _index = box.space._index + + -- System space format usually is in order "id, owner, name...". + -- The fields "name", "owner" are swapped in "_collation" format, + -- due to the field "owner" was added after the "_collation" creation. + box.space._index:delete{276, 1} + log.info("update index name on _collation") + box.space._index:insert{_collation.id, 2, 'name', 'tree', {unique = true}, + {{1, 'string'}}} + log.info("create index owner on _collation") + box.space._index:insert{_collation.id, 1, 'owner', 'tree', {unique = false}, + {{2, 'unsigned'}}} + create_vcollation_space() +end + local function get_version() local version = box.space._schema:get{'version'} if version == nil then @@ -768,6 +792,7 @@ local function upgrade(options) {version = mkversion(2, 1, 1), func = upgrade_to_2_1_1, auto = true}, {version = mkversion(2, 1, 2), func = upgrade_to_2_1_2, auto = true}, {version = mkversion(2, 1, 3), func = upgrade_to_2_1_3, auto = true}, + {version = mkversion(2, 1, 4), func = upgrade_to_2_1_4, auto = true} } for _, handler in ipairs(handlers) do diff --git a/src/box/schema_def.h b/src/box/schema_def.h index eeeeb950b..77c004690 100644 --- a/src/box/schema_def.h +++ b/src/box/schema_def.h @@ -72,6 +72,8 @@ enum { BOX_SCHEMA_ID = 272, /** Space id of _collation. */ BOX_COLLATION_ID = 276, + /** Space id of _vcollation. */ + BOX_VCOLLATION_ID = 277, /** Space id of _space. */ BOX_SPACE_ID = 280, /** Space id of _vspace view. */ diff --git a/src/box/sysview.c b/src/box/sysview.c index 96c5e78ca..0d1259af0 100644 --- a/src/box/sysview.c +++ b/src/box/sysview.c @@ -402,6 +402,14 @@ vsequence_filter(struct space *source, struct tuple *tuple) ((PRIV_WRDA | PRIV_X) & effective); } +static bool + vcollation_filter(struct space *source, struct tuple *tuple) + { + (void) source; + (void) tuple; + return true; + } + static struct index * sysview_space_create_index(struct space *space, struct index_def *def) { @@ -448,6 +456,11 @@ sysview_space_create_index(struct space *space, struct index_def *def) source_index_id = def->iid; filter = vsequence_filter; break; + case BOX_VCOLLATION_ID: + source_space_id = BOX_COLLATION_ID; + source_index_id = def->iid; + filter = vcollation_filter; + break; default: diag_set(ClientError, ER_MODIFY_INDEX, def->name, space_name(space), diff --git a/test/app-tap/tarantoolctl.test.lua b/test/app-tap/tarantoolctl.test.lua index c1e1490ca..ac1efa0ba 100755 --- a/test/app-tap/tarantoolctl.test.lua +++ b/test/app-tap/tarantoolctl.test.lua @@ -405,8 +405,8 @@ do check_ctlcat_xlog(test_i, dir, "--from=3 --to=6 --format=json --show-system --replica 1", "\n", 3) check_ctlcat_xlog(test_i, dir, "--from=3 --to=6 --format=json --show-system --replica 1 --replica 2", "\n", 3) check_ctlcat_xlog(test_i, dir, "--from=3 --to=6 --format=json --show-system --replica 2", "\n", 0) - check_ctlcat_snap(test_i, dir, "--space=280", "---\n", 21) - check_ctlcat_snap(test_i, dir, "--space=288", "---\n", 47) + check_ctlcat_snap(test_i, dir, "--space=280", "---\n", 22) + check_ctlcat_snap(test_i, dir, "--space=288", "---\n", 51) end) end) diff --git a/test/box-py/bootstrap.result b/test/box-py/bootstrap.result index 379f6c51f..f37a28c80 100644 --- a/test/box-py/bootstrap.result +++ b/test/box-py/bootstrap.result @@ -4,7 +4,7 @@ box.internal.bootstrap() box.space._schema:select{} --- - - ['max_id', 511] - - ['version', 2, 1, 3] + - ['version', 2, 1, 4] ... box.space._cluster:select{} --- @@ -21,6 +21,10 @@ box.space._space:select{} 'name': 'name', 'type': 'string'}, {'name': 'owner', 'type': 'unsigned'}, {'name': 'type', 'type': 'string'}, {'name': 'locale', 'type': 'string'}, { 'name': 'opts', 'type': 'map'}]] + - [277, 1, '_vcollation', 'sysview', 0, {}, [{'name': 'id', 'type': 'unsigned'}, + {'name': 'name', 'type': 'string'}, {'name': 'owner', 'type': 'unsigned'}, { + 'name': 'type', 'type': 'string'}, {'name': 'locale', 'type': 'string'}, { + 'name': 'opts', 'type': 'map'}]] - [280, 1, '_space', 'memtx', 0, {}, [{'name': 'id', 'type': 'unsigned'}, {'name': 'owner', 'type': 'unsigned'}, {'name': 'name', 'type': 'string'}, {'name': 'engine', 'type': 'string'}, {'name': 'field_count', 'type': 'unsigned'}, {'name': 'flags', @@ -83,7 +87,11 @@ box.space._index:select{} --- - - [272, 0, 'primary', 'tree', {'unique': true}, [[0, 'string']]] - [276, 0, 'primary', 'tree', {'unique': true}, [[0, 'unsigned']]] - - [276, 1, 'name', 'tree', {'unique': true}, [[1, 'string']]] + - [276, 1, 'owner', 'tree', {'unique': false}, [[2, 'unsigned']]] + - [276, 2, 'name', 'tree', {'unique': true}, [[1, 'string']]] + - [277, 0, 'primary', 'tree', {'unique': true}, [[0, 'unsigned']]] + - [277, 1, 'owner', 'tree', {'unique': false}, [[2, 'unsigned']]] + - [277, 2, 'name', 'tree', {'unique': true}, [[1, 'string']]] - [280, 0, 'primary', 'tree', {'unique': true}, [[0, 'unsigned']]] - [280, 1, 'owner', 'tree', {'unique': false}, [[1, 'unsigned']]] - [280, 2, 'name', 'tree', {'unique': true}, [[2, 'string']]] @@ -150,6 +158,7 @@ box.space._priv:select{} - [1, 1, 'universe', 0, 4294967295] - [1, 2, 'function', 1, 4] - [1, 2, 'space', 276, 2] + - [1, 2, 'space', 277, 1] - [1, 2, 'space', 281, 1] - [1, 2, 'space', 286, 1] - [1, 2, 'space', 289, 1] diff --git a/test/box/access_misc.result b/test/box/access_misc.result index 36ebfae09..2b7ca4f97 100644 --- a/test/box/access_misc.result +++ b/test/box/access_misc.result @@ -761,6 +761,10 @@ box.space._space:select() 'name': 'name', 'type': 'string'}, {'name': 'owner', 'type': 'unsigned'}, {'name': 'type', 'type': 'string'}, {'name': 'locale', 'type': 'string'}, { 'name': 'opts', 'type': 'map'}]] + - [277, 1, '_vcollation', 'sysview', 0, {}, [{'name': 'id', 'type': 'unsigned'}, + {'name': 'name', 'type': 'string'}, {'name': 'owner', 'type': 'unsigned'}, { + 'name': 'type', 'type': 'string'}, {'name': 'locale', 'type': 'string'}, { + 'name': 'opts', 'type': 'map'}]] - [280, 1, '_space', 'memtx', 0, {}, [{'name': 'id', 'type': 'unsigned'}, {'name': 'owner', 'type': 'unsigned'}, {'name': 'name', 'type': 'string'}, {'name': 'engine', 'type': 'string'}, {'name': 'field_count', 'type': 'unsigned'}, {'name': 'flags', diff --git a/test/box/access_sysview.result b/test/box/access_sysview.result index c6a2b22ed..96976babb 100644 --- a/test/box/access_sysview.result +++ b/test/box/access_sysview.result @@ -74,6 +74,10 @@ session.su('guest') --- - true ... +#box.space._vspace.index[2]:select('_vcollation') ~= 0 +--- +- true +... #box.space._vindex:select(box.space._vspace.id) > 0 --- - true @@ -94,6 +98,10 @@ session.su('guest') --- - true ... +#box.space._vindex:select(box.space._vcollation.id) > 0 +--- +- true +... box.session.su('admin') --- ... @@ -127,6 +135,10 @@ box.session.su('guest') --- - error: Read access to space '_vsequence' is denied for user 'guest' ... +#box.space._vcollation:select{} +--- +- error: Read access to space '_vcollation' is denied for user 'guest' +... box.session.su('admin') --- ... @@ -138,11 +150,15 @@ box.session.su('guest') ... #box.space._vspace:select{} --- -- 8 +- 9 ... #box.space._vindex:select{} --- -- 20 +- 24 +... +#box.space._vcollation:select{} +--- +- 277 ... box.session.su('admin') --- @@ -230,11 +246,11 @@ box.session.su('guest') ... #box.space._vspace:select{} --- -- 22 +- 23 ... #box.space._vindex:select{} --- -- 48 +- 52 ... #box.space._vuser:select{} --- @@ -242,12 +258,16 @@ box.session.su('guest') ... #box.space._vpriv:select{} --- -- 15 +- 16 ... #box.space._vfunc:select{} --- - 1 ... +#box.space._vcollation:select{} +--- +- 277 +... box.session.su('admin') --- ... @@ -262,7 +282,7 @@ box.session.su('guest') ... #box.space._vindex:select{} --- -- 48 +- 52 ... #box.space._vuser:select{} --- @@ -270,7 +290,7 @@ box.session.su('guest') ... #box.space._vpriv:select{} --- -- 15 +- 16 ... #box.space._vfunc:select{} --- @@ -280,6 +300,10 @@ box.session.su('guest') --- - 0 ... +#box.space._vcollation:select{} +--- +- 277 +... box.session.su('admin') --- ... @@ -631,6 +655,60 @@ seq:drop() --- ... -- +-- _vcollation +-- +box.session.su('admin') +--- +... +box.internal.collation.create('test', 'ICU', 'ru-RU') +--- +... +-- Only admin can create collation. +coll_cnt = #box.space._collation:select{} +--- +... +box.schema.user.grant("guest", "read, write, alter, execute", "space", "_collation") +--- +... +box.session.su("guest") +--- +... +box.internal.collation.create('guest0', 'ICU', 'ru-RU') +--- +- error: Create access to collation 'guest0' is denied for user 'guest' +... +box.space._vcollation:select{0} +--- +- - [0, 'none', 1, 'BINARY', '', {}] +... +#box.space._vcollation:select{} == coll_cnt +--- +- true +... +box.session.su('admin') +--- +... +-- _vcollation is readable anyway. +box.schema.user.revoke("guest", "read", "space", "_collation") +--- +... +box.session.su("guest") +--- +... +#box.space._vcollation:select{} +--- +- 278 +... +session.su('admin') +--- +... +box.internal.collation.drop('test') +--- +... +box.internal.collation.drop('guest0') +--- +... +-- -- view:alter() tests -- box.space._vspace.index[1]:alter({parts = { 2, 'string' }}) diff --git a/test/box/access_sysview.test.lua b/test/box/access_sysview.test.lua index c62458407..031df28aa 100644 --- a/test/box/access_sysview.test.lua +++ b/test/box/access_sysview.test.lua @@ -31,12 +31,14 @@ session.su('guest') #box.space._vspace.index[2]:select('_vuser') ~= 0 #box.space._vspace.index[2]:select('_vfunc') ~= 0 #box.space._vspace.index[2]:select('_vpriv') ~= 0 +#box.space._vspace.index[2]:select('_vcollation') ~= 0 #box.space._vindex:select(box.space._vspace.id) > 0 #box.space._vindex:select(box.space._vindex.id) > 0 #box.space._vindex:select(box.space._vuser.id) > 0 #box.space._vindex:select(box.space._vfunc.id) > 0 #box.space._vindex:select(box.space._vpriv.id) > 0 +#box.space._vindex:select(box.space._vcollation.id) > 0 box.session.su('admin') box.schema.user.revoke('guest', 'public') @@ -48,6 +50,7 @@ box.session.su('guest') #box.space._vpriv:select{} #box.space._vfunc:select{} #box.space._vsequence:select{} +#box.space._vcollation:select{} box.session.su('admin') box.schema.user.grant('guest', 'public') @@ -55,6 +58,7 @@ box.session.su('guest') #box.space._vspace:select{} #box.space._vindex:select{} +#box.space._vcollation:select{} box.session.su('admin') s = box.schema.space.create('test') @@ -96,6 +100,7 @@ box.session.su('guest') #box.space._vuser:select{} #box.space._vpriv:select{} #box.space._vfunc:select{} +#box.space._vcollation:select{} box.session.su('admin') box.schema.user.revoke('guest', 'read', 'universe') @@ -107,6 +112,7 @@ box.session.su('guest') #box.space._vpriv:select{} #box.space._vfunc:select{} #box.space._vsequence:select{} +#box.space._vcollation:select{} box.session.su('admin') box.schema.user.revoke('guest', 'write', 'universe') @@ -264,6 +270,30 @@ box.session.su("guest") session.su('admin') seq:drop() +-- +-- _vcollation +-- + +box.session.su('admin') +box.internal.collation.create('test', 'ICU', 'ru-RU') + +-- Only admin can create collation. +coll_cnt = #box.space._collation:select{} +box.schema.user.grant("guest", "read, write, alter, execute", "space", "_collation") +box.session.su("guest") +box.internal.collation.create('guest0', 'ICU', 'ru-RU') +box.space._vcollation:select{0} +#box.space._vcollation:select{} == coll_cnt +box.session.su('admin') + +-- _vcollation is readable anyway. +box.schema.user.revoke("guest", "read", "space", "_collation") +box.session.su("guest") +#box.space._vcollation:select{} +session.su('admin') +box.internal.collation.drop('test') +box.internal.collation.drop('guest0') + -- -- view:alter() tests -- diff --git a/test/box/alter.result b/test/box/alter.result index c1b1de135..7fb09b4cd 100644 --- a/test/box/alter.result +++ b/test/box/alter.result @@ -183,7 +183,11 @@ _index:select{} --- - - [272, 0, 'primary', 'tree', {'unique': true}, [[0, 'string']]] - [276, 0, 'primary', 'tree', {'unique': true}, [[0, 'unsigned']]] - - [276, 1, 'name', 'tree', {'unique': true}, [[1, 'string']]] + - [276, 1, 'owner', 'tree', {'unique': false}, [[2, 'unsigned']]] + - [276, 2, 'name', 'tree', {'unique': true}, [[1, 'string']]] + - [277, 0, 'primary', 'tree', {'unique': true}, [[0, 'unsigned']]] + - [277, 1, 'owner', 'tree', {'unique': false}, [[2, 'unsigned']]] + - [277, 2, 'name', 'tree', {'unique': true}, [[1, 'string']]] - [280, 0, 'primary', 'tree', {'unique': true}, [[0, 'unsigned']]] - [280, 1, 'owner', 'tree', {'unique': false}, [[1, 'unsigned']]] - [280, 2, 'name', 'tree', {'unique': true}, [[2, 'string']]] diff --git a/test/wal_off/alter.result b/test/wal_off/alter.result index ee280fcbb..8040efa1a 100644 --- a/test/wal_off/alter.result +++ b/test/wal_off/alter.result @@ -28,7 +28,7 @@ end; ... #spaces; --- -- 65505 +- 65504 ... -- cleanup for k, v in pairs(spaces) do -- 2.20.1 (Apple Git-117)
next prev parent reply other threads:[~2019-05-30 12:36 UTC|newest] Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top 2019-05-30 12:36 [tarantool-patches] [PATCH 0/2] Add _vcollation and fetch in net.box Roman Khabibov 2019-05-30 12:36 ` Roman Khabibov [this message] 2019-06-04 16:31 ` [tarantool-patches] [PATCH 1/2] schema: add "_vcollation" sysview Vladimir Davydov 2019-06-05 17:08 ` [tarantool-patches] " Roman Khabibov 2019-06-05 17:56 ` Vladimir Davydov 2019-06-06 15:18 ` Roman Khabibov 2019-05-30 12:36 ` [tarantool-patches] [PATCH 2/2] net.box: fetch '_vcollation' sysview into the module Roman Khabibov 2019-06-04 16:36 ` Vladimir Davydov 2019-06-05 17:08 ` [tarantool-patches] " Roman Khabibov 2019-06-05 17:28 ` Vladimir Davydov 2019-06-06 15:22 ` Roman Khabibov 2019-06-06 16:00 ` Roman Khabibov 2019-06-06 17:00 ` Vladimir Davydov 2019-06-03 18:45 ` [tarantool-patches] Re: [PATCH 0/2] Add _vcollation and fetch in net.box Vladislav Shpilevoy 2019-06-04 15:54 ` [tarantool-patches] " Vladimir Davydov -- strict thread matches above, loose matches on Subject: below -- 2019-05-16 11:24 [tarantool-patches] [PATCH 0/2] Add "_vcollation" sysview and fetch it " Roman Khabibov 2019-05-16 11:24 ` [tarantool-patches] [PATCH 1/2] schema: add "_vcollation" sysview Roman Khabibov
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=5eab44d0494d7622ef5fbb77c45229a09212d9bc.1559219194.git.roman.habibov@tarantool.org \ --to=roman.habibov@tarantool.org \ --cc=tarantool-patches@freelists.org \ --cc=v.shpilevoy@tarantool.org \ --subject='Re: [tarantool-patches] [PATCH 1/2] schema: add "_vcollation" sysview' \ /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