Skip to content

Commit 1817d93

Browse files
committed
fix missing ToInner usage in key-prefixed wrapper; in addition to the new code, this includes pre-existing bugs:
- SetIntersectionLength - SortedSetCombine - SortedSetCombineWithScores - SortedSetIntersectionLength
1 parent 6cb90d3 commit 1817d93

2 files changed

Lines changed: 34 additions & 34 deletions

File tree

src/StackExchange.Redis/KeyspaceIsolation/KeyPrefixed.cs

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -85,43 +85,43 @@ public Task<bool> HashExistsAsync(RedisKey key, RedisValue hashField, CommandFla
8585
Inner.HashExistsAsync(ToInner(key), hashField, flags);
8686

8787
public Task<RedisValue> HashFieldGetAndDeleteAsync(RedisKey key, RedisValue hashField, CommandFlags flags = CommandFlags.None) =>
88-
Inner.HashFieldGetAndDeleteAsync(key, hashField, flags);
88+
Inner.HashFieldGetAndDeleteAsync(ToInner(key), hashField, flags);
8989

9090
public Task<Lease<byte>?> HashFieldGetLeaseAndDeleteAsync(RedisKey key, RedisValue hashField, CommandFlags flags = CommandFlags.None) =>
91-
Inner.HashFieldGetLeaseAndDeleteAsync(key, hashField, flags);
91+
Inner.HashFieldGetLeaseAndDeleteAsync(ToInner(key), hashField, flags);
9292

9393
public Task<RedisValue[]> HashFieldGetAndDeleteAsync(RedisKey key, RedisValue[] hashFields, CommandFlags flags = CommandFlags.None) =>
94-
Inner.HashFieldGetAndDeleteAsync(key, hashFields, flags);
94+
Inner.HashFieldGetAndDeleteAsync(ToInner(key), hashFields, flags);
9595

9696
public Task<RedisValue> HashFieldGetAndSetExpiryAsync(RedisKey key, RedisValue hashField, TimeSpan? expiry = null, bool persist = false, CommandFlags flags = CommandFlags.None) =>
97-
Inner.HashFieldGetAndSetExpiryAsync(key, hashField, expiry, persist, flags);
97+
Inner.HashFieldGetAndSetExpiryAsync(ToInner(key), hashField, expiry, persist, flags);
9898

9999
public Task<RedisValue> HashFieldGetAndSetExpiryAsync(RedisKey key, RedisValue hashField, DateTime expiry, CommandFlags flags = CommandFlags.None) =>
100-
Inner.HashFieldGetAndSetExpiryAsync(key, hashField, expiry, flags);
100+
Inner.HashFieldGetAndSetExpiryAsync(ToInner(key), hashField, expiry, flags);
101101

102102
public Task<Lease<byte>?> HashFieldGetLeaseAndSetExpiryAsync(RedisKey key, RedisValue hashField, TimeSpan? expiry = null, bool persist = false, CommandFlags flags = CommandFlags.None) =>
103-
Inner.HashFieldGetLeaseAndSetExpiryAsync(key, hashField, expiry, persist, flags);
103+
Inner.HashFieldGetLeaseAndSetExpiryAsync(ToInner(key), hashField, expiry, persist, flags);
104104

105105
public Task<Lease<byte>?> HashFieldGetLeaseAndSetExpiryAsync(RedisKey key, RedisValue hashField, DateTime expiry, CommandFlags flags = CommandFlags.None) =>
106-
Inner.HashFieldGetLeaseAndSetExpiryAsync(key, hashField, expiry, flags);
106+
Inner.HashFieldGetLeaseAndSetExpiryAsync(ToInner(key), hashField, expiry, flags);
107107

108108
public Task<RedisValue[]> HashFieldGetAndSetExpiryAsync(RedisKey key, RedisValue[] hashFields, TimeSpan? expiry = null, bool persist = false, CommandFlags flags = CommandFlags.None) =>
109-
Inner.HashFieldGetAndSetExpiryAsync(key, hashFields, expiry, persist, flags);
109+
Inner.HashFieldGetAndSetExpiryAsync(ToInner(key), hashFields, expiry, persist, flags);
110110

111111
public Task<RedisValue[]> HashFieldGetAndSetExpiryAsync(RedisKey key, RedisValue[] hashFields, DateTime expiry, CommandFlags flags = CommandFlags.None) =>
112-
Inner.HashFieldGetAndSetExpiryAsync(key, hashFields, expiry, flags);
112+
Inner.HashFieldGetAndSetExpiryAsync(ToInner(key), hashFields, expiry, flags);
113113

114114
public Task<RedisValue> HashFieldSetAndSetExpiryAsync(RedisKey key, RedisValue field, RedisValue value, TimeSpan? expiry = null, bool keepTtl = false, When when = When.Always, CommandFlags flags = CommandFlags.None) =>
115-
Inner.HashFieldSetAndSetExpiryAsync(key, field, value, expiry, keepTtl, when, flags);
115+
Inner.HashFieldSetAndSetExpiryAsync(ToInner(key), field, value, expiry, keepTtl, when, flags);
116116

117117
public Task<RedisValue> HashFieldSetAndSetExpiryAsync(RedisKey key, RedisValue field, RedisValue value, DateTime expiry, When when = When.Always, CommandFlags flags = CommandFlags.None) =>
118-
Inner.HashFieldSetAndSetExpiryAsync(key, field, value, expiry, when, flags);
118+
Inner.HashFieldSetAndSetExpiryAsync(ToInner(key), field, value, expiry, when, flags);
119119

120120
public Task<RedisValue> HashFieldSetAndSetExpiryAsync(RedisKey key, HashEntry[] hashFields, TimeSpan? expiry = null, bool keepTtl = false, When when = When.Always, CommandFlags flags = CommandFlags.None) =>
121-
Inner.HashFieldSetAndSetExpiryAsync(key, hashFields, expiry, keepTtl, when, flags);
121+
Inner.HashFieldSetAndSetExpiryAsync(ToInner(key), hashFields, expiry, keepTtl, when, flags);
122122

123123
public Task<RedisValue> HashFieldSetAndSetExpiryAsync(RedisKey key, HashEntry[] hashFields, DateTime expiry, When when = When.Always, CommandFlags flags = CommandFlags.None) =>
124-
Inner.HashFieldSetAndSetExpiryAsync(key, hashFields, expiry, when, flags);
124+
Inner.HashFieldSetAndSetExpiryAsync(ToInner(key), hashFields, expiry, when, flags);
125125

126126
public Task<ExpireResult[]> HashFieldExpireAsync(RedisKey key, RedisValue[] hashFields, TimeSpan expiry, ExpireWhen when = ExpireWhen.Always, CommandFlags flags = CommandFlags.None) =>
127127
Inner.HashFieldExpireAsync(ToInner(key), hashFields, expiry, when, flags);
@@ -433,7 +433,7 @@ public Task<bool[]> SetContainsAsync(RedisKey key, RedisValue[] values, CommandF
433433
Inner.SetContainsAsync(ToInner(key), values, flags);
434434

435435
public Task<long> SetIntersectionLengthAsync(RedisKey[] keys, long limit = 0, CommandFlags flags = CommandFlags.None) =>
436-
Inner.SetIntersectionLengthAsync(keys, limit, flags);
436+
Inner.SetIntersectionLengthAsync(ToInner(keys), limit, flags);
437437

438438
public Task<long> SetLengthAsync(RedisKey key, CommandFlags flags = CommandFlags.None) =>
439439
Inner.SetLengthAsync(ToInner(key), flags);
@@ -489,10 +489,10 @@ public Task<bool> SortedSetAddAsync(RedisKey key, RedisValue member, double scor
489489
public Task<bool> SortedSetAddAsync(RedisKey key, RedisValue member, double score, SortedSetWhen updateWhen = SortedSetWhen.Always, CommandFlags flags = CommandFlags.None) =>
490490
Inner.SortedSetAddAsync(ToInner(key), member, score, updateWhen, flags);
491491
public Task<RedisValue[]> SortedSetCombineAsync(SetOperation operation, RedisKey[] keys, double[]? weights = null, Aggregate aggregate = Aggregate.Sum, CommandFlags flags = CommandFlags.None) =>
492-
Inner.SortedSetCombineAsync(operation, keys, weights, aggregate, flags);
492+
Inner.SortedSetCombineAsync(operation, ToInner(keys), weights, aggregate, flags);
493493

494494
public Task<SortedSetEntry[]> SortedSetCombineWithScoresAsync(SetOperation operation, RedisKey[] keys, double[]? weights = null, Aggregate aggregate = Aggregate.Sum, CommandFlags flags = CommandFlags.None) =>
495-
Inner.SortedSetCombineWithScoresAsync(operation, keys, weights, aggregate, flags);
495+
Inner.SortedSetCombineWithScoresAsync(operation, ToInner(keys), weights, aggregate, flags);
496496

497497
public Task<long> SortedSetCombineAndStoreAsync(SetOperation operation, RedisKey destination, RedisKey[] keys, double[]? weights = null, Aggregate aggregate = Aggregate.Sum, CommandFlags flags = CommandFlags.None) =>
498498
Inner.SortedSetCombineAndStoreAsync(operation, ToInner(destination), ToInner(keys), weights, aggregate, flags);
@@ -507,7 +507,7 @@ public Task<double> SortedSetIncrementAsync(RedisKey key, RedisValue member, dou
507507
Inner.SortedSetIncrementAsync(ToInner(key), member, value, flags);
508508

509509
public Task<long> SortedSetIntersectionLengthAsync(RedisKey[] keys, long limit = 0, CommandFlags flags = CommandFlags.None) =>
510-
Inner.SortedSetIntersectionLengthAsync(keys, limit, flags);
510+
Inner.SortedSetIntersectionLengthAsync(ToInner(keys), limit, flags);
511511

512512
public Task<long> SortedSetLengthAsync(RedisKey key, double min = -1.0 / 0.0, double max = 1.0 / 0.0, Exclude exclude = Exclude.None, CommandFlags flags = CommandFlags.None) =>
513513
Inner.SortedSetLengthAsync(ToInner(key), min, max, exclude, flags);

src/StackExchange.Redis/KeyspaceIsolation/KeyPrefixedDatabase.cs

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -82,43 +82,43 @@ public bool HashExists(RedisKey key, RedisValue hashField, CommandFlags flags =
8282
Inner.HashExists(ToInner(key), hashField, flags);
8383

8484
public RedisValue HashFieldGetAndDelete(RedisKey key, RedisValue hashField, CommandFlags flags = CommandFlags.None) =>
85-
Inner.HashFieldGetAndDelete(key, hashField, flags);
85+
Inner.HashFieldGetAndDelete(ToInner(key), hashField, flags);
8686

8787
public Lease<byte>? HashFieldGetLeaseAndDelete(RedisKey key, RedisValue hashField, CommandFlags flags = CommandFlags.None) =>
88-
Inner.HashFieldGetLeaseAndDelete(key, hashField, flags);
88+
Inner.HashFieldGetLeaseAndDelete(ToInner(key), hashField, flags);
8989

9090
public RedisValue[] HashFieldGetAndDelete(RedisKey key, RedisValue[] hashFields, CommandFlags flags = CommandFlags.None) =>
91-
Inner.HashFieldGetAndDelete(key, hashFields, flags);
91+
Inner.HashFieldGetAndDelete(ToInner(key), hashFields, flags);
9292

9393
public RedisValue HashFieldGetAndSetExpiry(RedisKey key, RedisValue hashField, TimeSpan? expiry = null, bool persist = false, CommandFlags flags = CommandFlags.None) =>
94-
Inner.HashFieldGetAndSetExpiry(key, hashField, expiry, persist, flags);
94+
Inner.HashFieldGetAndSetExpiry(ToInner(key), hashField, expiry, persist, flags);
9595

9696
public RedisValue HashFieldGetAndSetExpiry(RedisKey key, RedisValue hashField, DateTime expiry, CommandFlags flags = CommandFlags.None) =>
97-
Inner.HashFieldGetAndSetExpiry(key, hashField, expiry, flags);
97+
Inner.HashFieldGetAndSetExpiry(ToInner(key), hashField, expiry, flags);
9898

9999
public Lease<byte>? HashFieldGetLeaseAndSetExpiry(RedisKey key, RedisValue hashField, TimeSpan? expiry = null, bool persist = false, CommandFlags flags = CommandFlags.None) =>
100-
Inner.HashFieldGetLeaseAndSetExpiry(key, hashField, expiry, persist, flags);
100+
Inner.HashFieldGetLeaseAndSetExpiry(ToInner(key), hashField, expiry, persist, flags);
101101

102102
public Lease<byte>? HashFieldGetLeaseAndSetExpiry(RedisKey key, RedisValue hashField, DateTime expiry, CommandFlags flags = CommandFlags.None) =>
103-
Inner.HashFieldGetLeaseAndSetExpiry(key, hashField, expiry, flags);
103+
Inner.HashFieldGetLeaseAndSetExpiry(ToInner(key), hashField, expiry, flags);
104104

105105
public RedisValue[] HashFieldGetAndSetExpiry(RedisKey key, RedisValue[] hashFields, TimeSpan? expiry = null, bool persist = false, CommandFlags flags = CommandFlags.None) =>
106-
Inner.HashFieldGetAndSetExpiry(key, hashFields, expiry, persist, flags);
106+
Inner.HashFieldGetAndSetExpiry(ToInner(key), hashFields, expiry, persist, flags);
107107

108108
public RedisValue[] HashFieldGetAndSetExpiry(RedisKey key, RedisValue[] hashFields, DateTime expiry, CommandFlags flags = CommandFlags.None) =>
109-
Inner.HashFieldGetAndSetExpiry(key, hashFields, expiry, flags);
109+
Inner.HashFieldGetAndSetExpiry(ToInner(key), hashFields, expiry, flags);
110110

111111
public RedisValue HashFieldSetAndSetExpiry(RedisKey key, RedisValue field, RedisValue value, TimeSpan? expiry = null, bool keepTtl = false, When when = When.Always, CommandFlags flags = CommandFlags.None) =>
112-
Inner.HashFieldSetAndSetExpiry(key, field, value, expiry, keepTtl, when, flags);
112+
Inner.HashFieldSetAndSetExpiry(ToInner(key), field, value, expiry, keepTtl, when, flags);
113113

114114
public RedisValue HashFieldSetAndSetExpiry(RedisKey key, RedisValue field, RedisValue value, DateTime expiry, When when = When.Always, CommandFlags flags = CommandFlags.None) =>
115-
Inner.HashFieldSetAndSetExpiry(key, field, value, expiry, when, flags);
115+
Inner.HashFieldSetAndSetExpiry(ToInner(key), field, value, expiry, when, flags);
116116

117117
public RedisValue HashFieldSetAndSetExpiry(RedisKey key, HashEntry[] hashFields, TimeSpan? expiry = null, bool keepTtl = false, When when = When.Always, CommandFlags flags = CommandFlags.None) =>
118-
Inner.HashFieldSetAndSetExpiry(key, hashFields, expiry, keepTtl, when, flags);
118+
Inner.HashFieldSetAndSetExpiry(ToInner(key), hashFields, expiry, keepTtl, when, flags);
119119

120120
public RedisValue HashFieldSetAndSetExpiry(RedisKey key, HashEntry[] hashFields, DateTime expiry, When when = When.Always, CommandFlags flags = CommandFlags.None) =>
121-
Inner.HashFieldSetAndSetExpiry(key, hashFields, expiry, when, flags);
121+
Inner.HashFieldSetAndSetExpiry(ToInner(key), hashFields, expiry, when, flags);
122122

123123
public ExpireResult[] HashFieldExpire(RedisKey key, RedisValue[] hashFields, TimeSpan expiry, ExpireWhen when = ExpireWhen.Always, CommandFlags flags = CommandFlags.None) =>
124124
Inner.HashFieldExpire(ToInner(key), hashFields, expiry, when, flags);
@@ -420,7 +420,7 @@ public bool[] SetContains(RedisKey key, RedisValue[] values, CommandFlags flags
420420
Inner.SetContains(ToInner(key), values, flags);
421421

422422
public long SetIntersectionLength(RedisKey[] keys, long limit = 0, CommandFlags flags = CommandFlags.None) =>
423-
Inner.SetIntersectionLength(keys, limit, flags);
423+
Inner.SetIntersectionLength(ToInner(keys), limit, flags);
424424

425425
public long SetLength(RedisKey key, CommandFlags flags = CommandFlags.None) =>
426426
Inner.SetLength(ToInner(key), flags);
@@ -474,10 +474,10 @@ public bool SortedSetAdd(RedisKey key, RedisValue member, double score, SortedSe
474474
Inner.SortedSetAdd(ToInner(key), member, score, when, flags);
475475

476476
public RedisValue[] SortedSetCombine(SetOperation operation, RedisKey[] keys, double[]? weights = null, Aggregate aggregate = Aggregate.Sum, CommandFlags flags = CommandFlags.None) =>
477-
Inner.SortedSetCombine(operation, keys, weights, aggregate, flags);
477+
Inner.SortedSetCombine(operation, ToInner(keys), weights, aggregate, flags);
478478

479479
public SortedSetEntry[] SortedSetCombineWithScores(SetOperation operation, RedisKey[] keys, double[]? weights = null, Aggregate aggregate = Aggregate.Sum, CommandFlags flags = CommandFlags.None) =>
480-
Inner.SortedSetCombineWithScores(operation, keys, weights, aggregate, flags);
480+
Inner.SortedSetCombineWithScores(operation, ToInner(keys), weights, aggregate, flags);
481481

482482
public long SortedSetCombineAndStore(SetOperation operation, RedisKey destination, RedisKey[] keys, double[]? weights = null, Aggregate aggregate = Aggregate.Sum, CommandFlags flags = CommandFlags.None) =>
483483
Inner.SortedSetCombineAndStore(operation, ToInner(destination), ToInner(keys), weights, aggregate, flags);
@@ -492,7 +492,7 @@ public double SortedSetIncrement(RedisKey key, RedisValue member, double value,
492492
Inner.SortedSetIncrement(ToInner(key), member, value, flags);
493493

494494
public long SortedSetIntersectionLength(RedisKey[] keys, long limit = 0, CommandFlags flags = CommandFlags.None) =>
495-
Inner.SortedSetIntersectionLength(keys, limit, flags);
495+
Inner.SortedSetIntersectionLength(ToInner(keys), limit, flags);
496496

497497
public long SortedSetLength(RedisKey key, double min = -1.0 / 0.0, double max = 1.0 / 0.0, Exclude exclude = Exclude.None, CommandFlags flags = CommandFlags.None) =>
498498
Inner.SortedSetLength(ToInner(key), min, max, exclude, flags);

0 commit comments

Comments
 (0)