Skip to content

Commit be7dcce

Browse files
authored
[bugfix][lib][rdbms] Fix issue that column names containing 'update' are replaced
When writing to PostgreSQL using the `ON CONFLICT` statement, columns with names that include the string 'update' were being incorrectly replaced with an empty string. This commit addresses the issue by ensuring that column names are properly handled, even if they contain the substring 'update'.
1 parent 6f33396 commit be7dcce

File tree

1 file changed

+1
-1
lines changed
  • lib/addax-rdbms/src/main/java/com/wgzhao/addax/rdbms/writer/util

1 file changed

+1
-1
lines changed

lib/addax-rdbms/src/main/java/com/wgzhao/addax/rdbms/writer/util/WriterUtil.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ else if (dataBaseType == DataBaseType.SQLServer) {
177177

178178
private static String doPostgresqlUpdate(String writeMode, List<String> columnHolders)
179179
{
180-
String conflict = writeMode.replace("update", "");
180+
String conflict = writeMode.replaceFirst("update", "");
181181
StringBuilder sb = new StringBuilder();
182182
sb.append(" ON CONFLICT ");
183183
sb.append(conflict);

0 commit comments

Comments
 (0)