-
Notifications
You must be signed in to change notification settings - Fork 4
/
config.lua
64 lines (56 loc) · 1.55 KB
/
config.lua
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
fiber = require 'fiber'
box.cfg{
listen = '0.0.0.0:3301',
readahead = 10 * 1024 * 1024, -- to keep up with benchmark load.
net_msg_max = 10 * 1024, -- to keep up with benchmark load.
}
box.once("init", function()
local s = box.schema.space.create('test', {
id = 512,
if_not_exists = true,
})
s:create_index('primary', {type = 'tree', parts = {1, 'uint'}, if_not_exists = true})
local st = box.schema.space.create('schematest', {
id = 514,
temporary = true,
if_not_exists = true,
field_count = 7,
format = {
{name = "name0", type = "unsigned"},
{name = "name1", type = "unsigned"},
{name = "name2", type = "string"},
{name = "name3", type = "unsigned"},
{name = "name4", type = "unsigned"},
{name = "name5", type = "string"},
},
})
st:create_index('primary', {
type = 'hash',
parts = {1, 'uint'},
unique = true,
if_not_exists = true,
})
st:create_index('secondary', {
id = 3,
type = 'tree',
unique = false,
parts = { 2, 'uint', 3, 'string' },
if_not_exists = true,
})
st:truncate()
box.schema.func.create('box.info')
box.schema.func.create('simple_incr')
-- auth testing: access control
box.schema.user.create('test', {password = 'test'})
box.schema.user.grant('test', 'execute', 'universe')
box.schema.user.grant('test', 'read,write', 'space', 'test')
box.schema.user.grant('test', 'read,write', 'space', 'schematest')
end)
function timeout()
fiber.sleep(1)
return 1
end
function simple_incr(a)
return a+1
end
box.space.test:truncate()