From c3b55c5af98a82660cb4d5241515080de037896e Mon Sep 17 00:00:00 2001 From: xuejiaming <326308290@qq.com> Date: Thu, 30 Dec 2021 16:06:32 +0800 Subject: [PATCH] =?UTF-8?q?x.3.2.6=E4=BF=AE=E5=A4=8D=E5=8D=95=E8=B7=AF?= =?UTF-8?q?=E7=94=B1=E5=A4=9A=E8=A1=A8=E8=B7=A8=E8=A1=A8bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nuget-publish.bat | 8 ++++---- .../Controllers/TestController.cs | 4 ++-- samples/Sample.SqlServerShardingTable/Startup.cs | 13 +------------ .../ShardingExecutors/MergeQueryCompilerContext.cs | 2 +- 4 files changed, 8 insertions(+), 19 deletions(-) diff --git a/nuget-publish.bat b/nuget-publish.bat index 74ac6245..e3817ef6 100644 --- a/nuget-publish.bat +++ b/nuget-publish.bat @@ -1,9 +1,9 @@ :start ::定义版本 -set EFCORE2=2.3.2.05 -set EFCORE3=3.3.2.05 -set EFCORE5=5.3.2.05 -set EFCORE6=6.3.2.05 +set EFCORE2=2.3.2.06 +set EFCORE3=3.3.2.06 +set EFCORE5=5.3.2.06 +set EFCORE6=6.3.2.06 ::删除所有bin与obj下的文件 @echo off diff --git a/samples/Sample.SqlServerShardingTable/Controllers/TestController.cs b/samples/Sample.SqlServerShardingTable/Controllers/TestController.cs index f5944e3c..00fe9233 100644 --- a/samples/Sample.SqlServerShardingTable/Controllers/TestController.cs +++ b/samples/Sample.SqlServerShardingTable/Controllers/TestController.cs @@ -67,8 +67,8 @@ namespace Sample.SqlServerShardingTable.Controllers public async Task QueryJoin2() { var begin = new DateTime(2021, 3, 2); - var end = new DateTime(2021, 4, 3); - var sql1 = from user in _myDbContext.Set().Where(o => o.Id == "1" || o.Id == "6") + var end = new DateTime(2021, 3, 28); + var sql1 = from user in _myDbContext.Set().Where(o => o.Id == "1") join order in _myDbContext.Set().Where(o=>o.CreationTime>=begin&&o.CreationTime<=end) on user.Id equals order.Payer select new diff --git a/samples/Sample.SqlServerShardingTable/Startup.cs b/samples/Sample.SqlServerShardingTable/Startup.cs index 6001ad7e..3a042c5c 100644 --- a/samples/Sample.SqlServerShardingTable/Startup.cs +++ b/samples/Sample.SqlServerShardingTable/Startup.cs @@ -57,18 +57,7 @@ namespace Sample.SqlServerShardingTable op.AddShardingTableRoute(); op.AddShardingTableRoute(); op.AddShardingTableRoute(); - }).AddReadWriteSeparation(sp => - { - return new Dictionary>() - { - { - "ds0", new List() - { - "Data Source=localhost;Initial Catalog=EFCoreShardingTableDBxxxxxxxx;Integrated Security=True;" - } - } - }; - },ReadStrategyEnum.Loop,defaultEnable:true,readConnStringGetStrategy:ReadConnStringGetStrategyEnum.LatestEveryTime).End(); + }).End(); } // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. diff --git a/src/ShardingCore/Sharding/ShardingExecutors/MergeQueryCompilerContext.cs b/src/ShardingCore/Sharding/ShardingExecutors/MergeQueryCompilerContext.cs index c2429c09..11b0ba4e 100644 --- a/src/ShardingCore/Sharding/ShardingExecutors/MergeQueryCompilerContext.cs +++ b/src/ShardingCore/Sharding/ShardingExecutors/MergeQueryCompilerContext.cs @@ -47,7 +47,7 @@ namespace ShardingCore.Sharding.ShardingExecutors _dataSourceRouteResult = dataSourceRouteResult; _tableRouteResults = GetTableRouteResults(tableRouteResults); _isCrossDataSource = dataSourceRouteResult.IntersectDataSources.Count > 1; - _isCrossTable = _tableRouteResults.Count() > 1; + _isCrossTable = _tableRouteResults.Count() > 1|| _tableRouteResults.IsNotEmpty()&& !_tableRouteResults.First().NoDifferentTail; } private IEnumerable GetTableRouteResults(IEnumerable tableRouteResults)