- 修复 子查询 Count/Max/Min/Avg/Sum 使用了 Limit(1) 的 bug;#462

This commit is contained in:
28810
2020-09-16 13:54:04 +08:00
parent b83efc1c6b
commit fd8ed29c02
18 changed files with 76 additions and 118 deletions

View File

@ -921,7 +921,13 @@ namespace FreeSql.Internal
fsqlType = fsql?.GetType();
if (fsqlType == null) break;
var fsqlSelect0 = fsql as Select0Provider;
if (exp3.Method.Name != "ToList") fsqlSelect0._limit = 1;
switch (exp3.Method.Name) {
case "Any": //exists
case "ToOne":
case "First":
fsqlSelect0._limit = 1; //#462
break;
}
if (tsc.dbParams != null) fsqlSelect0._params = tsc.dbParams;
fsqltables = fsqlSelect0._tables;
//fsqltables[0].Alias = $"{tsc._tables[0].Alias}_{fsqltables[0].Alias}";