Skip to content

Commit b9048c5

Browse files
committed
- 补充 提交 #1936
1 parent 868e70e commit b9048c5

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

FreeSql/Internal/CommonProvider/InsertProvider.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -631,7 +631,7 @@ string ToSqlValuesOrSelectUnionAllExtension103(bool isValues, Action<object, int
631631
foreach (var item in atarr)
632632
{
633633
_source = item.ToList();
634-
sb.Append(ToSqlValuesOrSelectUnionAllExtension103(isValues, onrowPre, onrow, true)).Append("\r\n\r\n;\r\n\r\n");
634+
sb.Append(ToSqlValuesOrSelectUnionAllExtension103(isValues, onrowPre, onrow, true, ignoreColumn)).Append("\r\n\r\n;\r\n\r\n");
635635
}
636636
_source = oldSource;
637637
if (sb.Length > 0) sb.Remove(sb.Length - 9, 9);
@@ -644,7 +644,7 @@ string ToSqlValuesOrSelectUnionAllExtension103(bool isValues, Action<object, int
644644
foreach (var col in _table.Columns.Values)
645645
{
646646
//增加忽略插入的列
647-
if (ignoreColumn != null && ignoreColumn.Contains(col.CsName)) continue;
647+
if (ignoreColumn?.Contains(col.CsName) == true) continue;
648648
if (col.Attribute.IsIdentity && _insertIdentity == false && string.IsNullOrEmpty(col.DbInsertValue)) continue;
649649
if (col.Attribute.IsIdentity == false && _ignore.ContainsKey(col.Attribute.Name)) continue;
650650

@@ -666,7 +666,7 @@ string ToSqlValuesOrSelectUnionAllExtension103(bool isValues, Action<object, int
666666
foreach (var col in _table.Columns.Values)
667667
{
668668
//增加忽略插入的列
669-
if (ignoreColumn != null && ignoreColumn.Contains(col.CsName)) continue;
669+
if (ignoreColumn?.Contains(col.CsName) == true) continue;
670670
if (col.Attribute.IsIdentity && _insertIdentity == false && string.IsNullOrEmpty(col.DbInsertValue)) continue;
671671
if (col.Attribute.IsIdentity == false && _ignore.ContainsKey(col.Attribute.Name)) continue;
672672

FreeSql/Internal/UtilsExpressionTree.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,9 @@ public static ColumnInfo ColumnAttributeToInfo(TableInfo trytb, object entityDef
228228
if (common.CodeFirst.IsSyncStructureToLower) colattr.Name = colattr.Name.ToLower();
229229
if (common.CodeFirst.IsSyncStructureToUpper) colattr.Name = colattr.Name.ToUpper();
230230

231-
if ((colattr.IsNullable != true || colattr.IsIdentity == true || colattr.IsPrimary == true) && colattr.DbType.Contains("NOT NULL") == false && common._orm.Ado.DataType != DataType.ClickHouse && common._orm.Ado.DataType != DataType.TDengine)
231+
if ((colattr.IsNullable != true || colattr.IsIdentity == true || colattr.IsPrimary == true) && colattr.DbType.Contains("NOT NULL") == false &&
232+
common._orm.Ado.DataType != DataType.ClickHouse &&
233+
common._orm.Ado.DataType != DataType.TDengine)
232234
{
233235
colattr.IsNullable = false;
234236
colattr.DbType = Regex.Replace(colattr.DbType, @"\bNULL\b", "").Trim() + " NOT NULL";

0 commit comments

Comments
 (0)