pokersu opened a new issue #15763:
URL: https://github.com/apache/shardingsphere/issues/15763
### Suggest:
In Release 5.1.0, The regex pattern in class
org.apache.shardingsphere.infra.database.metadata.dialect.OracleDataSourceMetaData
has some issue.
```
private final Pattern thinUrlPattern =
Pattern.compile("jdbc:oracle:(thin|oci|kprb):@(//)?([\\w\\-\\.]+):?([0-9]*)[:/]([\\w\\-]+)",
Pattern.CASE_INSENSITIVE);
private final Pattern connectDescriptorUrlPattern =
Pattern.compile("jdbc:oracle:(thin|oci|kprb):@[(\\w\\s=)]+HOST\\s*=\\s*(\\d+(\\."
+
"((2(5[0-5]|[0-4]\\d))|[0-1]?\\d{1,2})){3}).*PORT\\s*=\\s*(\\d+).*SERVICE_NAME\\s*=\\s*(\\w+)\\)");
public OracleDataSourceMetaData(final String url, final String username)
{
List<Matcher> matcherList =
Arrays.asList(thinUrlPattern.matcher(url),
connectDescriptorUrlPattern.matcher(url));
Optional<Matcher> matcherOptional =
matcherList.stream().filter(Matcher::find).findAny();
if (!matcherOptional.isPresent()) {
throw new UnrecognizedDatabaseURLException(url,
thinUrlPattern.pattern());
}
```
In this class, thinUrlPattern and connectDescriptorUrlPattern just match
when Host is IP address, not support domain. and ServiceName has similar issue,
ServiceName not support some format as blow:
`axxx.frex.cc`
hope this issue will be fix, thanks
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]