Issue 1:
Please answer these questions before submitting your issue. Thanks!

第一次使用 ， 求教 ：

Which version of Sharding-Jdbc do you using?

1.5.4 1.5.4.1 ... 等 都有

Expected behavior

Actual behavior

Steps to reproduce the behavior

Please provide the reproduce example codes (such as github link) if possible.

使用官方提供的jdbc用例，

private static void executeUpdate(final DataSource dataSource, final String sql) throws SQLException {

Connection conn = null;

PreparedStatement preparedStatement = null;

try {

conn = dataSource.getConnection();

preparedStatement = conn.prepareStatement(sql);

System.out.println(sql);

preparedStatement.executeUpdate();

} catch (Exception e) {

e.printStackTrace();

} finally {

// DDL 操作不会释放 可能是分表时DDL操作 改写的问题。

System.out.println("----------------------");

preparedStatement.close();

conn.close();

}

}

场景： 仅分表 。

DML类型的SQL 可以正常释放 归还到连接池。

DDL类型的SQL 没有正常释放。

Issue 2:
Bug Report

in version 5.1.2,The SQL clause 'LIKE' is unsupported in encrypt rule,I dont konw why

Which version of ShardingSphere did you use?

5.1.2

Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?

ShardingSphere-JDBC

Expected behavior

support 'like'

Actual behavior

Caused by: org.apache.shardingsphere.infra.exception.ShardingSphereException: The SQL clause 'LIKE' is unsupported in encrypt rule.
at org.apache.shardingsphere.encrypt.rewrite.condition.EncryptConditionEngine.createBinaryEncryptCondition(EncryptConditionEngine.java:143)
at org.apache.shardingsphere.encrypt.rewrite.condition.EncryptConditionEngine.createEncryptCondition(EncryptConditionEngine.java:126)
at org.apache.shardingsphere.encrypt.rewrite.condition.EncryptConditionEngine.addEncryptConditions(EncryptConditionEngine.java:119)
at org.apache.shardingsphere.encrypt.rewrite.condition.EncryptConditionEngine.addEncryptConditions(EncryptConditionEngine.java:107)
at org.apache.shardingsphere.encrypt.rewrite.condition.EncryptConditionEngine.createEncryptConditions(EncryptConditionEngine.java:97)
at org.apache.shardingsphere.encrypt.rewrite.context.EncryptSQLRewriteContextDecorator.createEncryptConditions(EncryptSQLRewriteContextDecorator.java:73)
at org.apache.shardingsphere.encrypt.rewrite.context.EncryptSQLRewriteContextDecorator.decorate(EncryptSQLRewriteContextDecorator.java:53)
at org.apache.shardingsphere.encrypt.rewrite.context.EncryptSQLRewriteContextDecorator.decorate(EncryptSQLRewriteContextDecorator.java:44)
at org.apache.shardingsphere.infra.rewrite.SQLRewriteEntry.decorate(SQLRewriteEntry.java:86)
at org.apache.shardingsphere.infra.rewrite.SQLRewriteEntry.createSQLRewriteContext(SQLRewriteEntry.java:78)
at org.apache.shardingsphere.infra.rewrite.SQLRewriteEntry.rewrite(SQLRewriteEntry.java:67)
at org.apache.shardingsphere.infra.context.kernel.KernelProcessor.rewrite(KernelProcessor.java:59)
at org.apache.shardingsphere.infra.context.kernel.KernelProcessor.generateExecutionContext(KernelProcessor.java:47)
at org.apache.shardingsphere.driver.jdbc.core.statement.ShardingSpherePreparedStatement.createExecutionContext(ShardingSpherePreparedStatement.java:471)
at org.apache.shardingsphere.driver.jdbc.core.statement.ShardingSpherePreparedStatement.execute(ShardingSpherePreparedStatement.java:364)
at sun.reflect.GeneratedMethodAccessor339.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.ibatis.logging.jdbc.PreparedStatementLogger.invoke(PreparedStatementLogger.java:59)
at com.sun.proxy.$Proxy680.execute(Unknown Source)
at org.apache.ibatis.executor.statement.PreparedStatementHandler.query(PreparedStatementHandler.java:64)
at org.apache.ibatis.executor.statement.RoutingStatementHandler.query(RoutingStatementHandler.java:79)
at sun.reflect.GeneratedMethodAccessor347.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.ibatis.plugin.Plugin.invoke(Plugin.java:63)
at com.sun.proxy.$Proxy678.query(Unknown Source)
at com.baomidou.mybatisplus.core.executor.MybatisSimpleExecutor.doQuery(MybatisSimpleExecutor.java:69)
at org.apache.ibatis.executor.BaseExecutor.queryFromDatabase(BaseExecutor.java:325)
at org.apache.ibatis.executor.BaseExecutor.query(BaseExecutor.java:156)
at com.baomidou.mybatisplus.core.executor.MybatisCachingExecutor.query(MybatisCachingExecutor.java:165)
at com.baomidou.mybatisplus.core.executor.MybatisCachingExecutor.query(MybatisCachingExecutor.java:92)
at sun.reflect.GeneratedMethodAccessor329.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.ibatis.plugin.Plugin.invoke(Plugin.java:63)
at com.sun.proxy.$Proxy677.query(Unknown Source)
at sun.reflect.GeneratedMethodAccessor329.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.ibatis.plugin.Plugin.invoke(Plugin.java:63)
at com.sun.proxy.$Proxy677.query(Unknown Source)
at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:147)

Reason analyze (If you can)

static {
LOGICAL_OPERATOR.add("AND");
LOGICAL_OPERATOR.add("&&");
LOGICAL_OPERATOR.add("OR");
LOGICAL_OPERATOR.add("||");
SUPPORTED_COMPARE_OPERATOR.add("=");
SUPPORTED_COMPARE_OPERATOR.add("<>");
SUPPORTED_COMPARE_OPERATOR.add("!=");
SUPPORTED_COMPARE_OPERATOR.add(">");
SUPPORTED_COMPARE_OPERATOR.add("<");
SUPPORTED_COMPARE_OPERATOR.add(">=");
SUPPORTED_COMPARE_OPERATOR.add("<=");
SUPPORTED_COMPARE_OPERATOR.add("IS");
}
private Optional<EncryptCondition> createBinaryEncryptCondition(final BinaryOperationExpression expression, final String tableName) {
String operator = expression.getOperator();
if (!LOGICAL_OPERATOR.contains(operator)) {
if (SUPPORTED_COMPARE_OPERATOR.contains(operator)) {
return createCompareEncryptCondition(tableName, expression, expression.getRight());
}
throw new ShardingSphereException("The SQL clause '%s' is unsupported in encrypt rule.", operator);
}
return Optional.empty();
}

Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc.

Example codes for reproduce this issue (such as a github link).