- 修复 QuestDb And Or 优先级解析问题;

This commit is contained in:
2881099 2023-09-13 11:08:08 +08:00
parent 4e740c3072
commit 04a01c86df

View File

@ -824,6 +824,7 @@ namespace FreeSql.Internal
var rightBool = ExpressionLambdaToSql(rightExp, tsc); var rightBool = ExpressionLambdaToSql(rightExp, tsc);
if (SearchColumnByField(tsc._tables, tsc.currentTable, rightBool) != null) rightBool = $"{rightBool} = {formatSql(true, null, null, null)}"; if (SearchColumnByField(tsc._tables, tsc.currentTable, rightBool) != null) rightBool = $"{rightBool} = {formatSql(true, null, null, null)}";
else rightBool = GetBoolString(rightBool); else rightBool = GetBoolString(rightBool);
if (_common._orm?.Ado?.DataType == DataType.QuestDb) return $"(({leftBool}) {oper} ({rightBool}))";
return $"({leftBool} {oper} {rightBool})"; return $"({leftBool} {oper} {rightBool})";
} }
return $"({ExpressionLambdaToSql(leftExp, tsc)} {oper} {ExpressionLambdaToSql(rightExp, tsc)})"; return $"({ExpressionLambdaToSql(leftExp, tsc)} {oper} {ExpressionLambdaToSql(rightExp, tsc)})";