Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to insert duplicate keys in unique index #9965

Open
0x501D opened this issue Apr 18, 2024 · 2 comments
Open

Ability to insert duplicate keys in unique index #9965

0x501D opened this issue Apr 18, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@0x501D
Copy link
Member

0x501D commented Apr 18, 2024

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]
...
@0x501D 0x501D added the bug Something isn't working label Apr 18, 2024
@unera
Copy link
Collaborator

unera commented Apr 18, 2024

I think that it can be frequent pattern. For exampe a user could use Java messagepack.encoder and tarantool's.

So if a user write into one space using two languages, he can stumble over the bug.

@R-omk
Copy link

R-omk commented Apr 18, 2024

Maybe related
tarantool/vshard#207

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants