Skip to content

Commit f8900b7

Browse files
author
taojin
committed
修改Firebird 批量插入异常问题(BLOB SUB_TYPE BINARY需要参数化命令)。
1 parent 75edd97 commit f8900b7

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

Providers/FreeSql.Provider.Firebird/FirebirdUtils.cs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,18 @@ public override string GetNoneParamaterSqlValue(List<DbParameter> specialParams,
8888
{
8989
if (value == null) return "NULL";
9090
if (type.IsNumberType()) return string.Format(CultureInfo.InvariantCulture, "{0}", value);
91-
if (type == typeof(byte[])) return $"x'{CommonUtils.BytesSqlRaw(value as byte[])}'";
91+
if (type == typeof(byte[]))
92+
{
93+
if (col.Attribute.StringLength < 0)
94+
{
95+
var pam = AppendParamter(specialParams, $"p_{specialParams?.Count}{specialParamFlag}", null, type, value);
96+
return pam.ParameterName;
97+
}
98+
else
99+
{
100+
return $"x'{CommonUtils.BytesSqlRaw(value as byte[])}'";
101+
}
102+
}
92103
if (type == typeof(string))
93104
{
94105
if (col.Attribute.StringLength < 0)

0 commit comments

Comments
 (0)