x.3.2.6修复单路由多表跨表bug

This commit is contained in:
xuejiaming 2021-12-30 16:06:32 +08:00
parent e181348c65
commit c3b55c5af9
4 changed files with 8 additions and 19 deletions

View File

@ -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

View File

@ -67,8 +67,8 @@ namespace Sample.SqlServerShardingTable.Controllers
public async Task<IActionResult> QueryJoin2()
{
var begin = new DateTime(2021, 3, 2);
var end = new DateTime(2021, 4, 3);
var sql1 = from user in _myDbContext.Set<SysUser>().Where(o => o.Id == "1" || o.Id == "6")
var end = new DateTime(2021, 3, 28);
var sql1 = from user in _myDbContext.Set<SysUser>().Where(o => o.Id == "1")
join order in _myDbContext.Set<Order>().Where(o=>o.CreationTime>=begin&&o.CreationTime<=end)
on user.Id equals order.Payer
select new

View File

@ -57,18 +57,7 @@ namespace Sample.SqlServerShardingTable
op.AddShardingTableRoute<SysUserVirtualTableRoute>();
op.AddShardingTableRoute<OrderVirtualTableRoute>();
op.AddShardingTableRoute<MultiShardingOrderVirtualTableRoute>();
}).AddReadWriteSeparation(sp =>
{
return new Dictionary<string, IEnumerable<string>>()
{
{
"ds0", new List<string>()
{
"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.

View File

@ -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<TableRouteResult> GetTableRouteResults(IEnumerable<TableRouteResult> tableRouteResults)