sandynz commented on code in PR #22864:
URL: https://github.com/apache/shardingsphere/pull/22864#discussion_r1048349818
##########
infra/common/src/main/java/org/apache/shardingsphere/infra/database/metadata/url/StandardJdbcUrlParser.java:
##########
@@ -31,7 +31,7 @@
*/
public final class StandardJdbcUrlParser {
- private static final String SCHEMA_PATTERN = "(?<schema>[\\w+:%]+)\\s*";
+ private static final String SCHEMA_PATTERN =
"(?<schema>[(\\w-.)+:%]+)\\s*";
Review Comment:
It's better to remove `(` and `)` for now. Since:
1. It's uncommon in JDBC URL, I didn't find `(` and `)` definition in JDBC
specificaiton and real driver url.
2. They have special meaning in regex, it looks confusing in the pattern.
From
https://download.oracle.com/otn-pub/jcp/jdbc-4_1-mrel-spec/jdbc4.1-fr-spec.pdf
```
The format of a JDBC URL is :
■ jdbc:<subprotocol>:<subname>
where subprotocol defines the kind of database connectivity mechanism that
may be supported by one or more drivers. The contents and syntax of the subname
will depend on the subprotocol.
Note – A JDBC URL is not required to fully adhere to the URI syntax as
defined in RFC 3986, Uniform Resource Identifier (URI): Generic Syntax.
```
From
https://docs.oracle.com/cd/E17952_01/connector-j-8.0-en/connector-j-reference-jdbc-url-format.html
No `(` and `)` is found.
--
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]