This is an automated email from the ASF dual-hosted git repository.
zhonghongsheng 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 4ff24038705 Refactor constructor of CloseStatement to empty
buildAttributes (#38292)
4ff24038705 is described below
commit 4ff2403870579f9043ea0a4039e07eb30d249cd3
Author: Liang Zhang <[email protected]>
AuthorDate: Mon Mar 2 18:38:53 2026 +0800
Refactor constructor of CloseStatement to empty buildAttributes (#38292)
* Refactor constructor of CloseStatement to empty buildAttributes
* Refactor constructor of UnsetVariableStatement to empty buildAttributes
---
.../statement/core/statement/type/dal/UnsetVariableStatement.java | 4 ++--
.../sql/parser/statement/core/statement/type/ddl/CloseStatement.java | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git
a/parser/sql/statement/core/src/main/java/org/apache/shardingsphere/sql/parser/statement/core/statement/type/dal/UnsetVariableStatement.java
b/parser/sql/statement/core/src/main/java/org/apache/shardingsphere/sql/parser/statement/core/statement/type/dal/UnsetVariableStatement.java
index f96c7cfedab..c96fc241490 100644
---
a/parser/sql/statement/core/src/main/java/org/apache/shardingsphere/sql/parser/statement/core/statement/type/dal/UnsetVariableStatement.java
+++
b/parser/sql/statement/core/src/main/java/org/apache/shardingsphere/sql/parser/statement/core/statement/type/dal/UnsetVariableStatement.java
@@ -32,16 +32,16 @@ public final class UnsetVariableStatement extends
DALStatement {
private final String variableName;
- private SQLStatementAttributes attributes;
+ private final SQLStatementAttributes attributes;
public UnsetVariableStatement(final DatabaseType databaseType, final
String scope, final String variableName) {
super(databaseType);
this.scope = scope;
this.variableName = variableName;
+ attributes = new SQLStatementAttributes(new
AllowNotUseDatabaseSQLStatementAttribute(true));
}
@Override
public void buildAttributes() {
- attributes = new SQLStatementAttributes(new
AllowNotUseDatabaseSQLStatementAttribute(true));
}
}
diff --git
a/parser/sql/statement/core/src/main/java/org/apache/shardingsphere/sql/parser/statement/core/statement/type/ddl/CloseStatement.java
b/parser/sql/statement/core/src/main/java/org/apache/shardingsphere/sql/parser/statement/core/statement/type/ddl/CloseStatement.java
index ef8d4ad0b44..da513d58ec1 100644
---
a/parser/sql/statement/core/src/main/java/org/apache/shardingsphere/sql/parser/statement/core/statement/type/ddl/CloseStatement.java
+++
b/parser/sql/statement/core/src/main/java/org/apache/shardingsphere/sql/parser/statement/core/statement/type/ddl/CloseStatement.java
@@ -33,16 +33,16 @@ public final class CloseStatement extends DDLStatement {
private final boolean closeAll;
- private SQLStatementAttributes attributes;
+ private final SQLStatementAttributes attributes;
public CloseStatement(final DatabaseType databaseType, final
CursorNameSegment cursorName, final boolean closeAll) {
super(databaseType);
this.cursorName = cursorName;
this.closeAll = closeAll;
+ attributes = new SQLStatementAttributes(new
CursorSQLStatementAttribute(cursorName));
}
@Override
public void buildAttributes() {
- attributes = new SQLStatementAttributes(new
CursorSQLStatementAttribute(cursorName));
}
}