Skip to content

Commit

Permalink
[#3088] Improvement(jdbc-doris): Improve greedy regular expressions f…
Browse files Browse the repository at this point in the history
…or DorisExceptionConverter (#3120)

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

#3088

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

Fix: #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
BSSsunny and yuqi1129 authored Jun 3, 2024
1 parent c8dabb7 commit 863d42d
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 863d42d

Please sign in to comment.