You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by zh...@apache.org on 2021/05/01 05:15:39 UTC
[shardingsphere] branch master updated: Fix exception message
missing format in JDBCLockEngine (#10195)
This is an automated email from the ASF dual-hosted git repository.
zhangliang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shardingsphere.git
The following commit(s) were added to refs/heads/master by this push:
new 3d48e2c Fix exception message missing format in JDBCLockEngine (#10195)
3d48e2c is described below
commit 3d48e2c3a4d984fd5d64868514528bb0ba34b0e5
Author: DreamSaddle <31...@users.noreply.github.com>
AuthorDate: Sat May 1 13:15:04 2021 +0800
Fix exception message missing format in JDBCLockEngine (#10195)
* Fix exception message missing format in JDBCLockEngine
* Restore code format and fix exception message missing format in JDBCLockEngine
* Make sure the code format is fixed
---
.../org/apache/shardingsphere/driver/executor/JDBCLockEngine.java | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/shardingsphere-jdbc/shardingsphere-jdbc-core/src/main/java/org/apache/shardingsphere/driver/executor/JDBCLockEngine.java b/shardingsphere-jdbc/shardingsphere-jdbc-core/src/main/java/org/apache/shardingsphere/driver/executor/JDBCLockEngine.java
index ba3e671..71c08b1 100644
--- a/shardingsphere-jdbc/shardingsphere-jdbc-core/src/main/java/org/apache/shardingsphere/driver/executor/JDBCLockEngine.java
+++ b/shardingsphere-jdbc/shardingsphere-jdbc-core/src/main/java/org/apache/shardingsphere/driver/executor/JDBCLockEngine.java
@@ -70,7 +70,7 @@ public final class JDBCLockEngine {
* @throws SQLException SQL exception
*/
public <T> List<T> execute(final ExecutionGroupContext<JDBCExecutionUnit> executionGroupContext, final SQLStatementContext<?> sqlStatementContext,
- final Collection<RouteUnit> routeUnits, final JDBCExecutorCallback<T> callback) throws SQLException {
+ final Collection<RouteUnit> routeUnits, final JDBCExecutorCallback<T> callback) throws SQLException {
SQLStatement sqlStatement = sqlStatementContext.getSqlStatement();
if (metaDataContexts.getLock().isPresent()) {
ShardingSphereLock lock = metaDataContexts.getLock().get();
@@ -103,12 +103,12 @@ public final class JDBCLockEngine {
private void checkTableLock(final ShardingSphereLock lock, final Collection<String> tableNames) throws SQLException {
for (String tableName : tableNames) {
if (lock.isLocked(LockNameUtil.getTableLockName(DefaultSchema.LOGIC_NAME, tableName))) {
- throw new SQLException("Table %s is locked");
+ throw new SQLException(String.format("Table %s is locked", tableName));
}
}
}
- private <T> List<T> doExecute(final ExecutionGroupContext<JDBCExecutionUnit> executionGroupContext, final Collection<RouteUnit> routeUnits,
+ private <T> List<T> doExecute(final ExecutionGroupContext<JDBCExecutionUnit> executionGroupContext, final Collection<RouteUnit> routeUnits,
final JDBCExecutorCallback<T> callback, final SQLStatement sqlStatement) throws SQLException {
List<T> results = jdbcExecutor.execute(executionGroupContext, callback);
refreshMetadata(sqlStatement, routeUnits);