@@ -4602,9 +4602,11 @@ private Message GetStreamAddMessage(RedisKey key, RedisValue entryId, long? maxL
46024602 var includeApproxLen = maxLength . HasValue && useApproximateMaxLength ? 1 : 0 ;
46034603
46044604 var totalLength = ( streamPairs . Length * 2 ) // Room for the name/value pairs
4605- + 1 // The stream entry ID
4606- + includeMaxLen // 2 or 0 (MAXLEN keyword & the count)
4607- + includeApproxLen ; // 1 or 0
4605+ + 1 // The stream entry ID
4606+ + ( maxLength . HasValue ? 2 : 0 ) // MAXLEN N
4607+ + ( maxLength . HasValue && useApproximateMaxLength ? 1 : 0 ) // ~
4608+ + ( mode == StreamTrimMode . KeepReferences ? 0 : 1 ) // relevant trim-mode keyword
4609+ + ( limit . HasValue ? 2 : 0 ) ; // LIMIT N
46084610
46094611 var values = new RedisValue [ totalLength ] ;
46104612
@@ -5047,7 +5049,7 @@ private Message GetStringSetMessage(
50475049 When when = When . Always ,
50485050 CommandFlags flags = CommandFlags . None )
50495051 {
5050- when . AlwaysOrExists ( ) ;
5052+ when . AlwaysOrExistsOrNotExists ( ) ;
50515053 if ( value . IsNull ) return Message . Create ( Database , flags , RedisCommand . DEL , key ) ;
50525054
50535055 if ( expiry == null || expiry . Value == TimeSpan . MaxValue )
@@ -5096,7 +5098,7 @@ private Message GetStringSetAndGetMessage(
50965098 When when = When . Always ,
50975099 CommandFlags flags = CommandFlags . None )
50985100 {
5099- when . AlwaysOrExists ( ) ;
5101+ when . AlwaysOrExistsOrNotExists ( ) ;
51005102 if ( value . IsNull ) return Message . Create ( Database , flags , RedisCommand . GETDEL , key ) ;
51015103
51025104 if ( expiry == null || expiry . Value == TimeSpan . MaxValue )
0 commit comments