1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108
|
remote = require 'net.box'
---
...
fiber = require 'fiber'
---
...
test_run = require('test_run').new()
---
...
-- #636: Reload schema on demand
sp = box.schema.space.create('test_old')
---
...
_ = sp:create_index('primary')
---
...
sp:insert{1, 2, 3}
---
- [1, 2, 3]
...
box.schema.user.grant('guest', 'read', 'space', 'test_old')
---
...
con = remote.new(box.cfg.listen)
---
...
con:ping()
---
- true
...
con.space.test_old:select{}
---
- - [1, 2, 3]
...
con.space.test == nil
---
- true
...
sp = box.schema.space.create('test')
---
...
_ = sp:create_index('primary')
---
...
sp:insert{2, 3, 4}
---
- [2, 3, 4]
...
box.schema.user.grant('guest', 'read', 'space', 'test')
---
...
con.space.test == nil
---
- true
...
con:reload_schema()
---
...
con.space.test:select{}
---
- - [2, 3, 4]
...
box.space.test:drop()
---
...
box.space.test_old:drop()
---
...
con:close()
---
...
name = string.match(arg[0], "([^,]+)%.lua")
---
...
file_log = require('fio').open(name .. '.log', {'O_RDONLY', 'O_NONBLOCK'})
---
...
file_log:seek(0, 'SEEK_END') ~= 0
---
- true
...
box.schema.user.grant('guest', 'execute', 'universe')
---
...
test_run:cmd("setopt delimiter ';'")
---
- true
...
_ = fiber.create(
function()
local conn = require('net.box').new(box.cfg.listen)
conn:call('no_such_function', {})
conn:close()
end
);
---
...
test_run:cmd("setopt delimiter ''");
---
- true
...
test_run:wait_log('default', 'ER_NO_SUCH_PROC', nil, 10)
---
- ER_NO_SUCH_PROC
...
box.schema.user.revoke('guest', 'execute', 'universe')
---
...
|