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
|
-- test-run result file version 2
-------------------------------------------------------------------------------
-- 32-bit hash insert fields tests
-------------------------------------------------------------------------------
hash = box.schema.space.create('tweedledum')
| ---
| ...
tmp = hash:create_index('primary', { type = 'hash', parts = {1, 'unsigned'}, unique = true })
| ---
| ...
-- Insert valid fields
hash:insert{0, 'value1 v1.0', 'value2 v1.0'}
| ---
| - [0, 'value1 v1.0', 'value2 v1.0']
| ...
hash:insert{1, 'value1 v1.0', 'value2 v1.0'}
| ---
| - [1, 'value1 v1.0', 'value2 v1.0']
| ...
hash:insert{2, 'value1 v1.0', 'value2 v1.0'}
| ---
| - [2, 'value1 v1.0', 'value2 v1.0']
| ...
hash:insert{3, 'value1 v1.0', 'value2 v1.0'}
| ---
| - [3, 'value1 v1.0', 'value2 v1.0']
| ...
-- Insert invalid fields
hash:insert{'invalid key', 'value1 v1.0', 'value2 v1.0'}
| ---
| - error: 'Tuple field 1 type does not match one required by operation: expected unsigned'
| ...
hash:drop()
| ---
| ...
|