Skip to content

Commit

Permalink
- 修复 Clickhouse ToInt32/ToInt64 解析错误;
Browse files Browse the repository at this point in the history
  • Loading branch information
2881099 committed Feb 27, 2024
1 parent c1ab981 commit b18f9a5
Show file tree
Hide file tree
Showing 2 changed files with 103 additions and 5 deletions.
98 changes: 98 additions & 0 deletions FreeSql/FreeSql.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions Providers/FreeSql.Provider.ClickHouse/ClickHouseExpression.cs
Original file line number Diff line number Diff line change
Expand Up @@ -604,14 +604,14 @@ public override string ExpressionLambdaToSqlCallConvert(MethodCallExpression exp
case "ToDateTime": return ExpressionConstDateTime(exp.Arguments[0]) ?? $"cast({getExp(exp.Arguments[0])} as DateTime)";
case "ToDecimal": return $"cast({getExp(exp.Arguments[0])} as Decimal128(19))";
case "ToDouble": return $"cast({getExp(exp.Arguments[0])} as Float64)";
case "ToInt16":
case "ToInt32":
case "ToInt64":
case "ToInt16": return $"cast({getExp(exp.Arguments[0])} as Int16)";
case "ToInt32": return $"cast({getExp(exp.Arguments[0])} as Int32)";
case "ToInt64": return $"cast({getExp(exp.Arguments[0])} as Int64)";
case "ToSByte": return $"cast({getExp(exp.Arguments[0])} as UInt8)";
case "ToSingle": return $"cast({getExp(exp.Arguments[0])} as Float32)";
case "ToString": return $"cast({getExp(exp.Arguments[0])} as String)";
case "ToUInt16":
case "ToUInt32":
case "ToUInt16": return $"cast({getExp(exp.Arguments[0])} as UInt16)";
case "ToUInt32": return $"cast({getExp(exp.Arguments[0])} as UInt32)";
case "ToUInt64": return $"cast({getExp(exp.Arguments[0])} as UInt64)";
}
}
Expand Down

0 comments on commit b18f9a5

Please sign in to comment.