mirror of
https://github.com/nsnail/FreeSql.git
synced 2025-04-22 02:32:50 +08:00
- 修复 3.2.801 AsTreeCte cte_path 别名问题;
This commit is contained in:
parent
94fa653ec9
commit
117568178e
@ -733,7 +733,7 @@ JOIN {select._commonUtils.QuoteSqlName(tbDbName)} a ON cte_tbc.cte_id = a.{selec
|
|||||||
}
|
}
|
||||||
|
|
||||||
var sql1ctePath = "";
|
var sql1ctePath = "";
|
||||||
var wct2ctePath = "";
|
string wct2ctePath = null;
|
||||||
if (pathSelector != null)
|
if (pathSelector != null)
|
||||||
{
|
{
|
||||||
select._tables[0].Parameter = pathSelector?.Parameters[0];
|
select._tables[0].Parameter = pathSelector?.Parameters[0];
|
||||||
@ -751,7 +751,6 @@ JOIN {select._commonUtils.QuoteSqlName(tbDbName)} a ON cte_tbc.cte_id = a.{selec
|
|||||||
case DataType.Firebird:
|
case DataType.Firebird:
|
||||||
case DataType.ClickHouse:
|
case DataType.ClickHouse:
|
||||||
sql1ctePath = select._commonExpression.ExpressionWhereLambda(select._tables, select._tableRule, Expression.Call(typeof(Convert).GetMethod("ToString", new Type[] { typeof(string) }), pathSelector?.Body), select._diymemexpWithTempQuery, null, null);
|
sql1ctePath = select._commonExpression.ExpressionWhereLambda(select._tables, select._tableRule, Expression.Call(typeof(Convert).GetMethod("ToString", new Type[] { typeof(string) }), pathSelector?.Body), select._diymemexpWithTempQuery, null, null);
|
||||||
wct2ctePath = select._commonExpression.ExpressionWhereLambda(select._tables, select._tableRule, pathSelector?.Body, select._diymemexpWithTempQuery, null, null);
|
|
||||||
break;
|
break;
|
||||||
case DataType.MySql:
|
case DataType.MySql:
|
||||||
case DataType.OdbcMySql:
|
case DataType.OdbcMySql:
|
||||||
@ -762,7 +761,6 @@ JOIN {select._commonUtils.QuoteSqlName(tbDbName)} a ON cte_tbc.cte_id = a.{selec
|
|||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
sql1ctePath = select._commonExpression.ExpressionWhereLambda(select._tables, select._tableRule, pathSelector?.Body, select._diymemexpWithTempQuery, null, null);
|
sql1ctePath = select._commonExpression.ExpressionWhereLambda(select._tables, select._tableRule, pathSelector?.Body, select._diymemexpWithTempQuery, null, null);
|
||||||
wct2ctePath = sql1ctePath;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
sql1ctePath = $"{sql1ctePath} as cte_path, ";
|
sql1ctePath = $"{sql1ctePath} as cte_path, ";
|
||||||
@ -780,6 +778,8 @@ JOIN {select._commonUtils.QuoteSqlName(tbDbName)} a ON cte_tbc.cte_id = a.{selec
|
|||||||
if (pathSelector != null)
|
if (pathSelector != null)
|
||||||
{
|
{
|
||||||
select._tables[0].Parameter = pathSelector?.Parameters[0];
|
select._tables[0].Parameter = pathSelector?.Parameters[0];
|
||||||
|
if (wct2ctePath == null)
|
||||||
|
wct2ctePath = select._commonExpression.ExpressionWhereLambda(select._tables, select._tableRule, pathSelector?.Body, select._diymemexpWithTempQuery, null, null);
|
||||||
sql2ctePath = select._commonUtils.StringConcat(
|
sql2ctePath = select._commonUtils.StringConcat(
|
||||||
new string[] {
|
new string[] {
|
||||||
up == false ? "wct1.cte_path" : wct2ctePath,
|
up == false ? "wct1.cte_path" : wct2ctePath,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user