From 80a8041059741aa07321636fceca5d4997b49bc8 Mon Sep 17 00:00:00 2001 From: xuejiaming <326308290@qq.com> Date: Fri, 7 Jul 2023 21:56:59 +0800 Subject: [PATCH] =?UTF-8?q?track=20bug=20=E8=B7=A8=E5=BA=93=E4=B9=9F?= =?UTF-8?q?=E6=94=AF=E6=8C=81track?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DefaultShardingTrackQueryExecutor.cs | 12 ++++-------- .../ShardingExecutors/MergeQueryCompilerContext.cs | 2 +- src/ShardingCore/Sharding/StreamMergeContext.cs | 6 ++++++ 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/src/ShardingCore/Sharding/ShardingExecutors/DefaultShardingTrackQueryExecutor.cs b/src/ShardingCore/Sharding/ShardingExecutors/DefaultShardingTrackQueryExecutor.cs index 7bbcf4a6..c957151f 100644 --- a/src/ShardingCore/Sharding/ShardingExecutors/DefaultShardingTrackQueryExecutor.cs +++ b/src/ShardingCore/Sharding/ShardingExecutors/DefaultShardingTrackQueryExecutor.cs @@ -62,8 +62,7 @@ namespace ShardingCore.Sharding.ShardingExecutors { if (queryCompilerContext is IMergeQueryCompilerContext mergeQueryCompilerContext) { - var mergeResult = _shardingQueryExecutor.Execute(mergeQueryCompilerContext); - return ResultTrackExecute(mergeResult, queryCompilerContext, TrackEnumerable, Track); + return _shardingQueryExecutor.Execute(mergeQueryCompilerContext); } throw new ShardingCoreNotFoundException(queryCompilerContext.GetQueryExpression().ShardingPrint()); } @@ -120,8 +119,7 @@ namespace ShardingCore.Sharding.ShardingExecutors { if (queryCompilerContext is IMergeQueryCompilerContext mergeQueryCompilerContext) { - var mergeResult = _shardingQueryExecutor.ExecuteAsync(mergeQueryCompilerContext); - return ResultTrackExecute(mergeResult, queryCompilerContext, TrackAsyncEnumerable, TrackAsync); + return _shardingQueryExecutor.ExecuteAsync(mergeQueryCompilerContext); } throw new ShardingCoreNotFoundException(queryCompilerContext.GetQueryExpression().ShardingPrint()); } @@ -143,8 +141,7 @@ namespace ShardingCore.Sharding.ShardingExecutors { if (queryCompilerContext is IMergeQueryCompilerContext mergeQueryCompilerContext) { - var mergeResult= _shardingQueryExecutor.ExecuteAsync>(mergeQueryCompilerContext); - return ResultTrackExecute(mergeResult, queryCompilerContext, TrackEnumerable, Track); + return _shardingQueryExecutor.ExecuteAsync>(mergeQueryCompilerContext); } throw new ShardingCoreNotFoundException(queryCompilerContext.GetQueryExpression().ShardingPrint()); } @@ -162,8 +159,7 @@ namespace ShardingCore.Sharding.ShardingExecutors { if (queryCompilerContext is IMergeQueryCompilerContext mergeQueryCompilerContext) { - var mergeResult= _shardingQueryExecutor.ExecuteAsync>(mergeQueryCompilerContext); - return ResultTrackExecute(mergeResult, queryCompilerContext, TrackEnumerable, TrackAsync); + return _shardingQueryExecutor.ExecuteAsync>(mergeQueryCompilerContext); } throw new ShardingCoreNotFoundException(queryCompilerContext.GetQueryExpression().ShardingPrint()); } diff --git a/src/ShardingCore/Sharding/ShardingExecutors/MergeQueryCompilerContext.cs b/src/ShardingCore/Sharding/ShardingExecutors/MergeQueryCompilerContext.cs index 35f4fe6c..713a4384 100644 --- a/src/ShardingCore/Sharding/ShardingExecutors/MergeQueryCompilerContext.cs +++ b/src/ShardingCore/Sharding/ShardingExecutors/MergeQueryCompilerContext.cs @@ -246,7 +246,7 @@ namespace ShardingCore.Sharding.ShardingExecutors /// public bool IsParallelQuery() { - return _isCrossTable || _existCrossTableTails|| _queryCompilerContext.IsParallelQuery(); + return _isCrossTable || _existCrossTableTails || _queryCompilerContext.IsParallelQuery(); } public int? GetFixedTake() diff --git a/src/ShardingCore/Sharding/StreamMergeContext.cs b/src/ShardingCore/Sharding/StreamMergeContext.cs index f85ba0d5..59665169 100644 --- a/src/ShardingCore/Sharding/StreamMergeContext.cs +++ b/src/ShardingCore/Sharding/StreamMergeContext.cs @@ -278,7 +278,13 @@ namespace ShardingCore.Sharding public bool IsUseShardingTrack(Type entityType) { if (!IsParallelQuery()) + { + if (IsCrossDataSource) + { + return true; + } return false; + } return QueryTrack() && _trackerManager.EntityUseTrack(entityType); }