liubiao4123 / servicestack

Automatically exported from code.google.com/p/servicestack
0 stars 0 forks source link

empty string stored in redis is returned as NULL #53

Open GoogleCodeExporter opened 8 years ago

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

using (var redisClient = SC.Services.Helpers.RedisHelpers.GetClient("joe"))
{
    if (redisClient != null)
    {
        // set non NULL/empty string value
        if (!redisClient.Set("joekey", "joevalue", SC.Services.Helpers.RedisHelpers.Timeout))
        {
            int bpFail = 0;
        }

        string res = redisClient.Get<string>("joekey"); //"joevalue" returned

        // set string.empty
        if (!redisClient.Set("joekey", string.Empty, SC.Services.Helpers.RedisHelpers.Timeout))
        {
            int bpFail = 0;
        }

        string res = redisClient.Get<string>("joekey"); //NULL returned

        if (res == null)
        {
            int bpFail = 0;
        }
    }
}

What is the expected output? What do you see instead?
expected = string.empty
actual = NULL

What version of the product are you using? On what operating system?
ServiceStack.Redis.dll v1.0.0.0

Please provide any additional information below.

Original issue reported on code.google.com by joe.ward...@gmail.com on 16 Dec 2010 at 3:37