Skip to content

Commit

Permalink
[apache#3088] Improvement(jdbc-doris): Improve greedy regular express…
Browse files Browse the repository at this point in the history
…ions for DorisExceptionConverter (apache#3120)

### What changes were proposed in this pull request?

apache#3088

### Why are the changes needed?
In DorisExceptionConverter.java we have a greedy regular expression that
could potentially cause issues

Fix: apache#3088

### Does this PR introduce _any_ user-facing change?
No
### How was this patch tested?
 IT&UT

Co-authored-by: Qi Yu <[email protected]>
  • Loading branch information
2 people authored and diqiu50 committed Jun 13, 2024
1 parent 0359aa4 commit d3971a3
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public class DorisExceptionConverter extends JdbcExceptionConverter {
static final int CODE_OTHER = 1105;

private static final String DATABASE_ALREADY_EXISTS_PATTERN_STRING =
".*detailMessage = Can't create database '.*'; database exists";
".*?detailMessage = Can't create database '.*?'; database exists";
private static final Pattern DATABASE_ALREADY_EXISTS_PATTERN =
Pattern.compile(DATABASE_ALREADY_EXISTS_PATTERN_STRING);

Expand Down

0 comments on commit d3971a3

Please sign in to comment.