benluteijn / redis

Automatically exported from code.google.com/p/redis
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

SUNIONSTORE and SINTERSTORE produce different key values for non-existant keys #133

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

>>> r.exists('a')
0
>>> r.exists('b')
0
>>> r.sunionstore('x', 'a', 'b')
0
>>> r.sinterstore('y', 'a', 'b')
0
>>> r.exists('x')
1
>>> r.exists('y')
0

You can see that SUNIONSTORE has created a key, whereas SINTERSTORE 
has not.

What is the expected output? What do you see instead?

I expect both commands to create an empty key if the result of the union is 
an empty set (regardless of weather the keys to be unioned/intersected 
exist)

What version of the product are you using? On what operating system?

Git master. Ubuntu 9.04 64bit (VM under Parallels on OS X)

Original issue reported on code.google.com by acharnock on 28 Dec 2009 at 4:29

GoogleCodeExporter commented 9 years ago
That does seem inconsistent. I have a fix that requires code review in a branch 
of my 
fork on GitHub: 
http://github.com/dbravender/redis/commit/9ffd2e23c71572f7ec6b3419d0933bc987a30f
e6

Original comment by dan.brav...@gmail.com on 29 Dec 2009 at 3:53

GoogleCodeExporter commented 9 years ago
Hi Dan,

Thank you for working out a patch! My C skills are pretty miniscule, so I will 
leave it to 
someone else to give the thumbs up/down.

Thanks again :)

Adam

Original comment by acharnock on 29 Dec 2009 at 1:57

GoogleCodeExporter commented 9 years ago
This is now fixed, thanks.

Cheers,
Salvatore

Original comment by anti...@gmail.com on 24 Aug 2010 at 8:11