Skip to content

Commit

Permalink
[bugfix][lib][rdbms] Fix issue that column names containing 'update' …
Browse files Browse the repository at this point in the history
…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'.
  • Loading branch information
kingronjan authored Nov 11, 2024
1 parent 6f33396 commit be7dcce
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ else if (dataBaseType == DataBaseType.SQLServer) {

private static String doPostgresqlUpdate(String writeMode, List<String> columnHolders)
{
String conflict = writeMode.replace("update", "");
String conflict = writeMode.replaceFirst("update", "");
StringBuilder sb = new StringBuilder();
sb.append(" ON CONFLICT ");
sb.append(conflict);
Expand Down

0 comments on commit be7dcce

Please sign in to comment.