- 兼容 SqlServer varchar/nvarchar 表达式解析,分别解析为:N'' 和 '';

This commit is contained in:
28810
2019-11-20 03:34:55 +08:00
parent b338efc8a2
commit efdc7c8c5d
27 changed files with 440 additions and 86 deletions

View File

@ -130,11 +130,11 @@ namespace FreeSql.Odbc.PostgreSQL
if (left.StartsWith("(") || left.EndsWith(")")) left = $"array[{left.TrimStart('(').TrimEnd(')')}]";
return $"(case when {left} is null then 0 else array_length({left},1) end > 0)";
case "Contains":
tsc?.SetMapTypeTmp(null);
tsc.SetMapColumnTmp(null);
var args1 = getExp(callExp.Arguments[argIndex]);
var oldMapType = tsc?.SetMapTypeReturnOld(tsc?.mapTypeTmp);
var oldMapType = tsc.SetMapTypeReturnOld(tsc.mapTypeTmp);
left = objExp == null ? null : getExp(objExp);
tsc.SetMapTypeReturnOld(oldMapType);
tsc.SetMapColumnTmp(null).SetMapTypeReturnOld(oldMapType);
//判断 in 或 array @> array
if (left.StartsWith("array[") || left.EndsWith("]"))
return $"{args1} in ({left.Substring(6, left.Length - 7)})";