sandynz opened a new issue, #24243:
URL: https://github.com/apache/shardingsphere/issues/24243
## Feature Request
### Is your feature request related to a problem?
Yes
### Describe the feature you would like.
There's branch database type, e.g. MariaDBDatabaseType, its trunk database
is MySQL.
Currently, there's no branch database pipeline job E2E, I'm trying to add
one. I found some error when testing.
MariaDB 10.11 is installed on local docker.
MariaDB JDBC driver dependency:
```
<dependency>
<groupId>org.mariadb.jdbc</groupId>
<artifactId>mariadb-java-client</artifactId>
<version>2.7.8</version>
</dependency>
```
mysql-connecter version is 5.1.47.
Test code:
```
public class MariaDBClientTest {
public static void main(String[] args) throws Exception {
// port 3306 is MariaDB, port 3307 is proxy
try (Connection connection =
DriverManager.getConnection("jdbc:mariadb://localhost:3307", "root", "root");
Statement statement = connection.createStatement()) {
ResultSet resultSet = statement.executeQuery("SELECT now()");
resultSet.next();
Object now = resultSet.getObject(1);
System.out.println("now=" + now);
}
}
}
```
It works when connection with `jdbc:mariadb://localhost:3306` or
`jdbc:mysql://localhost:3306`.
When connecting with `jdbc:mariadb://localhost:3307`, there's exception:
```
Exception in thread "main" java.lang.NumberFormatException: For input
string: ""
at
java.base/java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
at java.base/java.lang.Integer.parseInt(Integer.java:662)
at java.base/java.lang.Integer.parseInt(Integer.java:770)
at
org.mariadb.jdbc.internal.protocol.AbstractConnectProtocol.postConnectionQueries(AbstractConnectProtocol.java:908)
at
org.mariadb.jdbc.internal.protocol.AbstractConnectProtocol.createConnection(AbstractConnectProtocol.java:610)
at
org.mariadb.jdbc.internal.protocol.AbstractConnectProtocol.connectWithoutProxy(AbstractConnectProtocol.java:1399)
at org.mariadb.jdbc.internal.util.Utils.retrieveProxy(Utils.java:635)
at
org.mariadb.jdbc.MariaDbConnection.newConnection(MariaDbConnection.java:150)
at org.mariadb.jdbc.Driver.connect(Driver.java:89)
at java.sql/java.sql.DriverManager.getConnection(DriverManager.java:677)
at java.sql/java.sql.DriverManager.getConnection(DriverManager.java:228)
at MariaDBClientTest.main(MariaDBClientTest.java:10)
```
Related code in `org.mariadb.jdbc.internal.protocol.AbstractConnectProtocol`:
```
writer.setMaxAllowedPacket(Integer.parseInt(serverData.get("max_allowed_packet")));
```
When connecting with `jdbc:mysql://localhost:3307`, there's warning log:
```
Sun Feb 19 18:59:21 CST 2023 WARN: Invalid value '' for server variable
named 'auto_increment_increment', falling back to sane default of '1'.
Sun Feb 19 18:59:21 CST 2023 WARN: Invalid value '' for server variable
named 'max_allowed_packet', falling back to sane default of '-1'.
Sun Feb 19 18:59:21 CST 2023 WARN: Invalid value '' for server variable
named 'net_buffer_length', falling back to sane default of '16,384'.
```
Maybe proxy respond invalid server variable to client.
--
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]