@@ -1197,33 +1197,38 @@ private void SetSnapshottedState(SnapshottedStateFlags flag, bool value)
1197
1197
}
1198
1198
}
1199
1199
1200
+ private bool GetSnapshottedState ( SnapshottedStateFlags flag )
1201
+ {
1202
+ return ( _snapshottedState & flag ) == flag ;
1203
+ }
1204
+
1200
1205
internal bool HasOpenResult
1201
1206
{
1202
- get => _snapshottedState . HasFlag ( SnapshottedStateFlags . OpenResult ) ;
1207
+ get => GetSnapshottedState ( SnapshottedStateFlags . OpenResult ) ;
1203
1208
set => SetSnapshottedState ( SnapshottedStateFlags . OpenResult , value ) ;
1204
1209
}
1205
1210
1206
1211
internal bool HasPendingData
1207
1212
{
1208
- get => _snapshottedState . HasFlag ( SnapshottedStateFlags . PendingData ) ;
1213
+ get => GetSnapshottedState ( SnapshottedStateFlags . PendingData ) ;
1209
1214
set => SetSnapshottedState ( SnapshottedStateFlags . PendingData , value ) ;
1210
1215
}
1211
1216
1212
1217
internal bool HasReceivedError
1213
1218
{
1214
- get => _snapshottedState . HasFlag ( SnapshottedStateFlags . ErrorTokenReceived ) ;
1219
+ get => GetSnapshottedState ( SnapshottedStateFlags . ErrorTokenReceived ) ;
1215
1220
set => SetSnapshottedState ( SnapshottedStateFlags . ErrorTokenReceived , value ) ;
1216
1221
}
1217
1222
1218
1223
internal bool HasReceivedAttention
1219
1224
{
1220
- get => _snapshottedState . HasFlag ( SnapshottedStateFlags . AttentionReceived ) ;
1225
+ get => GetSnapshottedState ( SnapshottedStateFlags . AttentionReceived ) ;
1221
1226
set => SetSnapshottedState ( SnapshottedStateFlags . AttentionReceived , value ) ;
1222
1227
}
1223
1228
1224
1229
internal bool HasReceivedColumnMetadata
1225
1230
{
1226
- get => _snapshottedState . HasFlag ( SnapshottedStateFlags . ColMetaDataReceived ) ;
1231
+ get => GetSnapshottedState ( SnapshottedStateFlags . ColMetaDataReceived ) ;
1227
1232
set => SetSnapshottedState ( SnapshottedStateFlags . ColMetaDataReceived , value ) ;
1228
1233
}
1229
1234
@@ -4291,11 +4296,11 @@ internal void ResetSnapshotState()
4291
4296
_stateObj. _cleanupAltMetaDataSetArray = _snapshotCleanupAltMetaDataSetArray ;
4292
4297
4293
4298
// Make sure to go through the appropriate increment/decrement methods if changing the OpenResult flag
4294
- if ( ! _stateObj . HasOpenResult && _state . HasFlag ( SnapshottedStateFlags . OpenResult ) )
4299
+ if ( ! _stateObj . HasOpenResult && ( ( _state & SnapshottedStateFlags . OpenResult ) == SnapshottedStateFlags . OpenResult ) )
4295
4300
{
4296
4301
_stateObj. IncrementAndObtainOpenResultCount ( _stateObj . _executedUnderTransaction ) ;
4297
4302
}
4298
- else if ( _stateObj . HasOpenResult && ! _state . HasFlag ( SnapshottedStateFlags . OpenResult ) )
4303
+ else if ( _stateObj . HasOpenResult && ( ( _state & SnapshottedStateFlags . OpenResult ) != SnapshottedStateFlags . OpenResult ) )
4299
4304
{
4300
4305
_stateObj. DecrementOpenResultCount ( ) ;
4301
4306
}
0 commit comments