Skip to content

A set STORE command doesn't properly overwrite an existing key #765

@wdscxsj

Description

@wdscxsj

Describe the bug

SINTERSTORE doesn't overwrite an existing string. SUNIONSTORE and SDIFFSTORE are also affected.

Steps to reproduce the bug

Please see the following Python snippet. Commands executed in the CLI have the same results. The "expected" values come from Redis 7.4.1.

import redis

r = redis.Redis()
r.set('foo', 'bar')
r.sadd('s1', *range(10))
r.sadd('s2', *range(5, 15))
r.sinterstore('foo', ['s1', 's2'])

print(r.keys('*'))    # [b'foo', b's1', b's2', b'foo']; expected: [b's2', b's1', b'foo']
print(r.type('foo'))  # 'string'; expected: 'set'

Expected behavior

No response

Screenshots

No response

Release version

v1.0.35

IDE

No response

OS version

Windows 11

Additional context

No response

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions