TeslaCN commented on issue #11090:
URL:
https://github.com/apache/shardingsphere/issues/11090#issuecomment-972641752
The `begin` statement can not be prepared, but the `commit` still can be
prepared.
I found this issue can be reproduced by the following code.
```java
public class MySQLPrepareTCL {
public static void main(String[] args) throws Exception {
try (Connection connection = getConnection()) {
Statement statement = connection.createStatement();
statement.execute("begin");
PreparedStatement commit = connection.prepareStatement("commit");
commit.execute();
statement.execute("select 1");
}
}
@SneakyThrows
private static Connection getConnection() {
return
DriverManager.getConnection("jdbc:mysql://127.0.0.1:13306/sbtest?useServerPrepStmts=true",
"root", "root");
}
}
```
--
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]