修改异步插入或修改时由于无法获取执行状态导致的无限循环,添加decimal数据类型(最后一位小数点精度会丢失)

This commit is contained in:
chenbo
2021-12-02 16:33:48 +08:00
parent ae0f2e9d0d
commit 0212577933
9 changed files with 257 additions and 23 deletions

View File

@ -67,6 +67,9 @@ namespace FreeSql.ClickHouse
case "Float32":
case "float":
case "nullable(float32)": return DbType.Single;
case "decimal":
case "decimal128":
case "nullable(decimal128)": return DbType.Decimal;
case "date":
case "nullable(date)": return DbType.Date;
case "datetime":
@ -103,6 +106,7 @@ namespace FreeSql.ClickHouse
{ (int)DbType.Double, new DbToCs("(double?)", "double.Parse({0})", "{0}.ToString()", "double?", typeof(double), typeof(double?), "{0}.Value", "GetDouble") },
{ (int)DbType.Single, new DbToCs("(float?)", "float.Parse({0})", "{0}.ToString()", "float?", typeof(float), typeof(float?), "{0}.Value", "GetFloat") },
{ (int)DbType.Decimal, new DbToCs("(decimal?)", "decimal.Parse({0})", "{0}.ToString()", "decimal?", typeof(decimal), typeof(decimal?), "{0}.Value", "GetDecimal") },
{ (int)DbType.Date, new DbToCs("(DateTime?)", "new DateTime(long.Parse({0}))", "{0}.Ticks.ToString()", "DateTime?", typeof(DateTime), typeof(DateTime?), "{0}.Value", "GetDateTime") },
{ (int)DbType.Date, new DbToCs("(DateTime?)", "new DateTime(long.Parse({0}))", "{0}.Ticks.ToString()", "DateTime?", typeof(DateTime), typeof(DateTime?), "{0}.Value", "GetDateTime") },