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
|
-- test-run result file version 2
-- Hash index can not use function.
s = box.schema.space.create('withdata')
| ---
| ...
lua_code = [[function(tuple) return tuple[1] + tuple[2] end]]
| ---
| ...
box.schema.func.create('s', {body = lua_code, is_deterministic = true, is_sandboxed = true})
| ---
| ...
_ = s:create_index('pk')
| ---
| ...
_ = s:create_index('idx', {type = 'hash', func = box.func.s.id, parts = {{1, 'unsigned'}}})
| ---
| - error: 'Can''t create or modify index ''idx'' in space ''withdata'': HASH index
| can not use a function'
| ...
s:drop()
| ---
| ...
box.schema.func.drop('s')
| ---
| ...
|