Skip to content

Ability to insert duplicate keys in unique index #9965

@0x501D

Description

@0x501D

If not using the most efficient representation we can insert duplicate keys in unique index:

Tarantool 2.11.2-0-g1bac2d2

tarantool> s = box.schema.space.create('test')
---
...

tarantool> s:create_index('pk')
---
- unique: true
  parts:
  - type: unsigned
    is_nullable: false
    fieldno: 1
  hint: true
  id: 0
  type: TREE
  space_id: 512
  name: pk
...

tarantool> msgpack = require('msgpack')
---
...

tarantool> s:insert{1}
---
- [1]
...

tarantool> o = msgpack.object_from_raw('\x91\xcf\x00\x00\x00\x00\x00\x00\x00\x01')
---
...

tarantool> o:decode()
---
- [1]
...

tarantool> s:insert(o)
---
- [1]
...

tarantool> s:select()
---
- - [1]
  - [1]
...

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions