You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by "sandynz (via GitHub)" <gi...@apache.org> on 2023/10/23 07:32:47 UTC
Re: [PR] Aggregate version declaration to root pom [shardingsphere]
sandynz commented on PR #28837:
URL: https://github.com/apache/shardingsphere/pull/28837#issuecomment-1774591204
Pipeline MySQL E2E error investigation:
### Problem
`MySQLMigrationGeneralE2EIT` as an example, it need to create ShardingSphereDataSource for avoiding some issue of proxy, then it'll execute sql `EXPORT DATABASE CONFIGURATION;` in proxy. And error occur from MySQL JDBC driver:
```
Caused by: java.sql.SQLException: Statement.executeQuery() cannot issue statements that do not produce result sets.
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:129)
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:97)
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:89)
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:63)
at com.mysql.cj.jdbc.StatementImpl.executeQuery(StatementImpl.java:1134)
at com.zaxxer.hikari.pool.ProxyStatement.executeQuery(ProxyStatement.java:110)
at com.zaxxer.hikari.pool.HikariProxyStatement.executeQuery(HikariProxyStatement.java)
at org.apache.shardingsphere.test.e2e.data.pipeline.cases.PipelineContainerComposer.queryForListWithLog(PipelineContainerComposer.java:424)
```
It exists from `mysql-connector-java` [8.0.27]( https://dev.mysql.com/doc/relnotes/connector-j/8.0/en/news-8-0-27.html ):
```
When Statement.executeQuery() was called, Connector/J's check for whether a statement would return results was inadequate, so that sometimes appropriate statements were rejected (for examples, SELECT statements starting with a WITH clause, statements preceded by consecutive comments, and so on) and, at other times, inappropriate statements were executed (for example, DO statements), resulting in various kinds of errors. With this fix, Connector/J performs more accurate checks by looking at the statement keywords and the context, as well as handling properly different corner cases.
```
[Related commit]( https://github.com/mysql/mysql-connector-j/commit/ade4a414fe569fa7831338a5add8632f2391542d ).
It means extended query SQL in proxy could not be executed via mysql-connector-java new version any more.
### Workaround
Workaround 1: Still use version `5.1.49` of `mysql-connector-java` in `shardingsphere-test-e2e-operation`, just in E2E module. It doesn't affect project's dependency and it's easy to do.
Workaround 2: Read related nodes value from ZooKeeper and combine them as dataSources and rules. It need much code to do it, construct DatabaseRulePersistService, DataSourceUnitPersistService, PersistRepository and etc.
--
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: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org