mirror of
https://github.com/dotnetcore/FreeSql.git
synced 2025-12-19 18:06:53 +08:00
- 修复 Oracle CodeFirst nclob cast 转换问题;
This commit is contained in:
@@ -354,7 +354,7 @@ and not exists(select 1 from all_constraints where constraint_name = a.index_nam
|
||||
if (tbcol.Attribute.DbType.StartsWith(tbstructcol.sqlType, StringComparison.CurrentCultureIgnoreCase) == false)
|
||||
{
|
||||
var dbtypeNoneNotNull = Regex.Replace(tbcol.Attribute.DbType, @"(NOT\s+)?NULL", "").Trim();
|
||||
if (dbtypeNoneNotNull != "CLOB" && dbtypeNoneNotNull != "BLOB")
|
||||
if (dbtypeNoneNotNull != "CLOB" && dbtypeNoneNotNull != "NCLOB" && dbtypeNoneNotNull != "BLOB")
|
||||
insertvalue = $"cast({insertvalue} as {dbtypeNoneNotNull})";
|
||||
}
|
||||
if (tbcol.Attribute.IsNullable != tbstructcol.is_nullable)
|
||||
|
||||
@@ -362,7 +362,7 @@ and not exists(select 1 from all_constraints where index_name = a.index_name and
|
||||
var charMatch = Regex.Match(dbtypeNoneNotNull, "(N?)VARCHAR(2?)\\((?<precision>[0-9]+)\\)");
|
||||
if (charMatch != null && ushort.TryParse(charMatch.Groups["precision"]?.Value, out var precision))
|
||||
dbtypeNoneNotNull = Regex.Replace(dbtypeNoneNotNull, $"\\(({precision})\\)", $"");
|
||||
if (dbtypeNoneNotNull != "CLOB" && dbtypeNoneNotNull != "BLOB")
|
||||
if (dbtypeNoneNotNull != "CLOB" && dbtypeNoneNotNull != "NCLOB" && dbtypeNoneNotNull != "BLOB")
|
||||
insertvalue = $"cast({insertvalue} as {dbtypeNoneNotNull})";
|
||||
}
|
||||
if (tbcol.Attribute.IsNullable != tbstructcol.is_nullable)
|
||||
|
||||
@@ -356,7 +356,7 @@ and not exists(select 1 from all_constraints where constraint_name = a.index_nam
|
||||
if (tbcol.Attribute.DbType.StartsWith(tbstructcol.sqlType, StringComparison.CurrentCultureIgnoreCase) == false)
|
||||
{
|
||||
var dbtypeNoneNotNull = Regex.Replace(tbcol.Attribute.DbType, @"(NOT\s+)?NULL", "").Trim();
|
||||
if (dbtypeNoneNotNull != "CLOB" && dbtypeNoneNotNull != "BLOB")
|
||||
if (dbtypeNoneNotNull != "CLOB" && dbtypeNoneNotNull != "NCLOB" && dbtypeNoneNotNull != "BLOB")
|
||||
insertvalue = $"cast({insertvalue} as {dbtypeNoneNotNull})";
|
||||
}
|
||||
if (tbcol.Attribute.IsNullable != tbstructcol.is_nullable)
|
||||
|
||||
@@ -391,7 +391,7 @@ and not exists(select 1 from all_constraints where constraint_name = a.index_nam
|
||||
if (tbcol.Attribute.DbType.StartsWith(tbstructcol.sqlType, StringComparison.CurrentCultureIgnoreCase) == false)
|
||||
{
|
||||
var dbtypeNoneNotNull = Regex.Replace(tbcol.Attribute.DbType, @"(NOT\s+)?NULL", "").Trim();
|
||||
if (dbtypeNoneNotNull != "CLOB" && dbtypeNoneNotNull != "BLOB")
|
||||
if (dbtypeNoneNotNull != "CLOB" && dbtypeNoneNotNull != "NCLOB" && dbtypeNoneNotNull != "BLOB")
|
||||
insertvalue = $"cast({insertvalue} as {dbtypeNoneNotNull})";
|
||||
}
|
||||
if (tbcol.Attribute.IsNullable != tbstructcol.is_nullable)
|
||||
|
||||
Reference in New Issue
Block a user