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

HashSet with RedisValue.EmptyString do not work as "" #111

Closed
YoungjaeKim opened this issue Oct 22, 2014 · 1 comment
Closed

HashSet with RedisValue.EmptyString do not work as "" #111

YoungjaeKim opened this issue Oct 22, 2014 · 1 comment

Comments

@YoungjaeKim
Copy link
Contributor

When we do HashSet,

HashEntry[] hashEntries =
{
    new HashEntry("Id", 1),
    new HashEntry("Email", ""),
};
RedisDatabase.HashSet("Key1", hashEntries);

In line 4,

  • working: new HashEntry("Email", ""),
  • ArgumentNullException: new HashEntry("Email", RedisValue.EmptyString),

Why do they work differently?

Seems like RedisValue.EmptyString is treated as null value as we see the stacktrace.
Related stacktrace is as below.

Location: StackExchange.Redis.RedisValue.AssertNotNull() File c:\TeamCity\buildAgent\work\58bc9a6df18a3782\StackExchange.Redis\StackExchange\Redis\RedisValue.cs: line 237
Location: StackExchange.Redis.RedisDatabase.GetHashSetMessage(RedisKey key, HashEntry[] hashFields, CommandFlags flags) File c:\TeamCity\buildAgent\work\58bc9a6df18a3782\StackExchange.Redis\StackExchange\Redis\RedisDatabase.cs: line 1567
Location: StackExchange.Redis.RedisDatabase.HashSet(RedisKey key, HashEntry[] hashFields, CommandFlags flags) File c:\TeamCity\buildAgent\work\58bc9a6df18a3782\StackExchange.Redis\StackExchange\Redis\RedisDatabase.cs: line 216

luberg added a commit to luberg/StackExchange.Redis that referenced this issue Dec 7, 2014
…ork as ""

Simple reorder of static field init order fixes this issue.
mgravell added a commit that referenced this issue Mar 12, 2015
Issue #111: HashSet with RedisValue.EmptyString do not work as ""
@NickCraver
Copy link
Collaborator

NickCraver commented Nov 20, 2016

I'm not sure if this is intentional or not, but if we change the behavior, it'd need to be in a major version release - relating to #528.

TODO: Verify if this is the current behavior.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants