- 优化 ServerTime 与 IUpdate.Set 指定更新的问题;#1251

This commit is contained in:
2881099
2022-09-20 12:23:51 +08:00
parent 0e6945cf76
commit f8f31df120
4 changed files with 93 additions and 3 deletions

View File

@ -193,9 +193,15 @@ namespace FreeSql.ClickHouse.Curd
if (_source.Any() == false)
{
var sbString = "";
foreach (var col in _table.Columns.Values)
if (col.Attribute.CanUpdate && string.IsNullOrEmpty(col.DbUpdateValue) == false)
sb.Append(", ").Append(_commonUtils.QuoteSqlName(col.Attribute.Name)).Append(" = ").Append(col.DbUpdateValue);
{
if (sbString == "") sbString = sb.ToString();
var loc3 = _commonUtils.QuoteSqlName(col.Attribute.Name);
if (sbString.Contains(loc3)) continue;
sb.Append(", ").Append(loc3).Append(" = ").Append(col.DbUpdateValue);
}
}
if (_table.VersionColumn != null)