Skip to content

Commit 52a5306

Browse files
author
duwenink
committed
修改敏感数据处理中的 SQL 表达式逻辑
在 `GaussDBLikeTranslator.cs` 文件中,更新了 `sensitive` 条件下的 SQL 表达式生成逻辑。将原本使用的空字符串常量更改为反斜杠字符 `"\\"`,确保在处理敏感数据时,`Like` 和 `ILike` 方法的调用能够正确反映匹配模式的要求。
1 parent df72b28 commit 52a5306

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/EFCore.GaussDB/Query/ExpressionTranslators/Internal/GaussDBLikeTranslator.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ public GaussDBLikeTranslator(GaussDBSqlExpressionFactory sqlExpressionFactory)
8787
}
8888

8989
return sensitive
90-
? _sqlExpressionFactory.Like(match, pattern, _sqlExpressionFactory.Constant(string.Empty))
91-
: _sqlExpressionFactory.ILike(match, pattern, _sqlExpressionFactory.Constant(string.Empty));
90+
? _sqlExpressionFactory.Like(match, pattern, _sqlExpressionFactory.Constant("\\"))
91+
: _sqlExpressionFactory.ILike(match, pattern, _sqlExpressionFactory.Constant("\\"));
9292
}
9393
}

0 commit comments

Comments
 (0)