You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by ji...@apache.org on 2023/05/22 09:03:08 UTC

[shardingsphere] branch master updated: Remove useless VariableEnum TRANSACTION_TYPE (#25837)

This is an automated email from the ASF dual-hosted git repository.

jianglongtao 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 842b6bf7cad Remove useless VariableEnum TRANSACTION_TYPE (#25837)
842b6bf7cad is described below

commit 842b6bf7cad4147d766853ec8b2ab26981bfe44f
Author: ChenJiaHao <Pa...@163.com>
AuthorDate: Mon May 22 17:02:59 2023 +0800

    Remove useless VariableEnum TRANSACTION_TYPE (#25837)
    
    * Remove useless VariableEnum TRANSACTION_TYPE
    
    * Remove document of transaction_type
    
    * Fix variable name
    
    * Fix variable name
    
    * Remove useless definition
---
 .../distsql/syntax/ral/set-dist-vairable.cn.md          | 17 +++--------------
 .../distsql/syntax/ral/set-dist-vairable.en.md          | 17 +++--------------
 .../distsql/syntax/ral/show-dist-variable.cn.md         |  4 +---
 .../distsql/syntax/ral/show-dist-variable.en.md         |  4 +---
 .../handler/distsql/ral/common/enums/VariableEnum.java  |  4 +---
 5 files changed, 9 insertions(+), 37 deletions(-)

diff --git a/docs/document/content/user-manual/shardingsphere-proxy/distsql/syntax/ral/set-dist-vairable.cn.md b/docs/document/content/user-manual/shardingsphere-proxy/distsql/syntax/ral/set-dist-vairable.cn.md
index 25aa1772288..8de0ed9a288 100644
--- a/docs/document/content/user-manual/shardingsphere-proxy/distsql/syntax/ral/set-dist-vairable.cn.md
+++ b/docs/document/content/user-manual/shardingsphere-proxy/distsql/syntax/ral/set-dist-vairable.cn.md
@@ -13,7 +13,7 @@ weight = 6
 {{% tab name="语法" %}}
 ```sql
 SetDistVariable ::=
-  'SET' 'DIST' 'VARIABLE' (proxyPropertyName '=' proxyPropertyValue | 'transaction_type' '=' transactionType | 'agent_plugins_enable' '=' agentPluginsEnable)
+  'SET' 'DIST' 'VARIABLE' (proxyPropertyName '=' proxyPropertyValue | 'agent_plugins_enabled' '=' agentPluginsEnabled)
 
 proxyPropertyName ::= 
   identifier
@@ -21,10 +21,7 @@ proxyPropertyName ::=
 proxyPropertyValue ::=
   literal
 
-transactionType ::=
-  string
-
-agentPluginsEnable ::=
+agentPluginsEnabled ::=
   boolean
 ```
 {{% /tab %}}
@@ -37,9 +34,7 @@ agentPluginsEnable ::=
 
 - `proxy_property_name` 为 `PROXY` 的[属性配置](/cn/user-manual/shardingsphere-proxy/yaml-config/props/),需使用下划线命名
 
-- `transaction_type` 为当前连接的事务类型, 支持 `LOCAL`、`XA`、`BASE`
-
-- `agent_plugins_enable` 为 `agent` 插件的启用状态,默认值 `FALSE`
+- `agent_plugins_enabled` 为 `agent` 插件的启用状态,默认值 `FALSE`
 
 - `system_log_level` 为 系统日志等级,仅影响 `PROXY` 的日志打印,默认值 `INFO`
 
@@ -51,12 +46,6 @@ agentPluginsEnable ::=
 SET DIST VARIABLE sql_show = true;
 ```
 
-- 设置当前连接的事务类型
-
-```sql
-SET DIST VARIABLE transaction_type = “XA”;
-```
-
 - 设置 `agent` 插件启用状态
 
 ```sql
diff --git a/docs/document/content/user-manual/shardingsphere-proxy/distsql/syntax/ral/set-dist-vairable.en.md b/docs/document/content/user-manual/shardingsphere-proxy/distsql/syntax/ral/set-dist-vairable.en.md
index 0e3709452c6..4815f0e2c41 100644
--- a/docs/document/content/user-manual/shardingsphere-proxy/distsql/syntax/ral/set-dist-vairable.en.md
+++ b/docs/document/content/user-manual/shardingsphere-proxy/distsql/syntax/ral/set-dist-vairable.en.md
@@ -12,7 +12,7 @@ The `SET DIST VARIABLE` syntax is used to set system variables.
 {{% tab name="Grammar" %}}
 ```sql
 SetDistVariable ::=
-  'SET' 'DIST' 'VARIABLE' (proxyPropertyName '=' proxyPropertyValue | 'transaction_type' '=' transactionType | 'agent_plugins_enable' '=' agentPluginsEnable)
+  'SET' 'DIST' 'VARIABLE' (proxyPropertyName '=' proxyPropertyValue | 'agent_plugins_enabled' '=' agentPluginsEnabled)
 
 proxyPropertyName ::= 
   identifier
@@ -20,10 +20,7 @@ proxyPropertyName ::=
 proxyPropertyValue ::=
   literal
 
-transactionType ::=
-  string
-
-agentPluginsEnable ::=
+agentPluginsEnabled ::=
   boolean
 ```
 {{% /tab %}}
@@ -36,9 +33,7 @@ agentPluginsEnable ::=
 
 - `proxy_property_name` is one of [properties configuration](/en/user-manual/shardingsphere-proxy/yaml-config/props/) of `PROXY`, name is split by underscore
 
-- `transaction_type` is use to set transaction types for current connection, supports `LOCAL`, `XA`, `BASE`
-
-- `agent_plugins_enable` is use to set the `agent` plugins enable status, the default value is `FALSE`
+- `agent_plugins_enabled` is use to set the `agent` plugins enable status, the default value is `FALSE`
 
 - `system_log_level` is the system log level, only affects the log printing of `PROXY`, the default value is `INFO`
 
@@ -50,12 +45,6 @@ agentPluginsEnable ::=
 SET DIST VARIABLE sql_show = true;
 ```
 
-- Set transaction type for current connection
-
-```sql
-SET DIST VARIABLE transaction_type = “XA”;
-```
-
 - Set `agent` plugin enable status
 
 ```sql
diff --git a/docs/document/content/user-manual/shardingsphere-proxy/distsql/syntax/ral/show-dist-variable.cn.md b/docs/document/content/user-manual/shardingsphere-proxy/distsql/syntax/ral/show-dist-variable.cn.md
index 66ff2bdf4b2..a39e6ab7729 100644
--- a/docs/document/content/user-manual/shardingsphere-proxy/distsql/syntax/ral/show-dist-variable.cn.md
+++ b/docs/document/content/user-manual/shardingsphere-proxy/distsql/syntax/ral/show-dist-variable.cn.md
@@ -63,16 +63,14 @@ mysql> SHOW DIST VARIABLES;
 | proxy_frontend_ssl_cipher             |                 |
 | proxy_frontend_ssl_enabled            | false           |
 | proxy_frontend_ssl_version            | TLSv1.2,TLSv1.3 |
-| proxy_instance_type                   | Proxy           |
 | proxy_meta_data_collector_enabled     | true            |
 | proxy_netty_backlog                   | 1024            |
 | sql_federation_type                   | NONE            |
 | sql_show                              | false           |
 | sql_simple                            | false           |
 | system_log_level                      | INFO            |
-| transaction_type                      | LOCAL           |
 +---------------------------------------+-----------------+
-23 rows in set (0.01 sec)
+21 rows in set (0.01 sec)
 ```
 
 - 查询指定 `PROXY` 系统变量配置
diff --git a/docs/document/content/user-manual/shardingsphere-proxy/distsql/syntax/ral/show-dist-variable.en.md b/docs/document/content/user-manual/shardingsphere-proxy/distsql/syntax/ral/show-dist-variable.en.md
index a6dda86e3d5..1f9ac84449e 100644
--- a/docs/document/content/user-manual/shardingsphere-proxy/distsql/syntax/ral/show-dist-variable.en.md
+++ b/docs/document/content/user-manual/shardingsphere-proxy/distsql/syntax/ral/show-dist-variable.en.md
@@ -63,16 +63,14 @@ mysql> SHOW DIST VARIABLES;
 | proxy_frontend_ssl_cipher             |                 |
 | proxy_frontend_ssl_enabled            | false           |
 | proxy_frontend_ssl_version            | TLSv1.2,TLSv1.3 |
-| proxy_instance_type                   | Proxy           |
 | proxy_meta_data_collector_enabled     | true            |
 | proxy_netty_backlog                   | 1024            |
 | sql_federation_type                   | NONE            |
 | sql_show                              | false           |
 | sql_simple                            | false           |
 | system_log_level                      | INFO            |
-| transaction_type                      | LOCAL           |
 +---------------------------------------+-----------------+
-23 rows in set (0.01 sec)
+21 rows in set (0.01 sec)
 ```
 - Query specified system variable configuration of `PROXY`
 
diff --git a/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/common/enums/VariableEnum.java b/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/common/enums/VariableEnum.java
index 0b5aad92cc6..6ca4fb3570b 100644
--- a/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/common/enums/VariableEnum.java
+++ b/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/common/enums/VariableEnum.java
@@ -24,9 +24,7 @@ import org.apache.shardingsphere.proxy.backend.exception.UnsupportedVariableExce
  */
 public enum VariableEnum {
     
-    CACHED_CONNECTIONS,
-    
-    TRANSACTION_TYPE;
+    CACHED_CONNECTIONS;
     
     /**
      * Returns the variable constant of the specified variable name.