You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by pa...@apache.org on 2023/04/23 06:03:19 UTC

[shardingsphere] branch master updated: Remove property proxy-mysql-default-version (#25288)

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

panjuan 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 6ac98b8700a Remove property proxy-mysql-default-version (#25288)
6ac98b8700a is described below

commit 6ac98b8700a2ddfbd91cf8e5f364c76fe5231933
Author: 吴伟杰 <wu...@apache.org>
AuthorDate: Sun Apr 23 14:03:12 2023 +0800

    Remove property proxy-mysql-default-version (#25288)
    
    * Support MySQL system variable version query
    
    * Remove property proxy-mysql-default-version
    
    * Remove property proxy-mysql-default-version from config and doc
    
    * Complete ShowDistVariablesExecutorTest
---
 .../shardingsphere-proxy/yaml-config/props.cn.md   |  1 -
 .../shardingsphere-proxy/yaml-config/props.en.md   |  1 -
 .../config/props/ConfigurationPropertyKey.java     |  5 ---
 .../config/props/ConfigurationPropertiesTest.java  |  3 --
 .../queryable/ShowDistVariablesExecutorTest.java   |  2 +-
 .../admin/executor/sysvar/SystemVariable.java      |  5 ++-
 .../sysvar/provider/VersionValueProvider.java      | 35 +++++++++++++++++
 .../sysvar/provider/VersionValueProviderTest.java  | 44 ++++++++++++++++++++++
 .../bootstrap/src/main/resources/conf/server.yaml  |  1 -
 .../version/ShardingSphereProxyVersionTest.java    |  7 ----
 .../proxy/frontend/mysql/MySQLFrontendEngine.java  |  9 +----
 .../src/test/resources/env/mysql/server-5.yaml     |  1 -
 .../src/test/resources/env/mysql/server-8.yaml     |  1 -
 13 files changed, 84 insertions(+), 31 deletions(-)

diff --git a/docs/document/content/user-manual/shardingsphere-proxy/yaml-config/props.cn.md b/docs/document/content/user-manual/shardingsphere-proxy/yaml-config/props.cn.md
index 4c25bfc8b71..41e8624c7da 100644
--- a/docs/document/content/user-manual/shardingsphere-proxy/yaml-config/props.cn.md
+++ b/docs/document/content/user-manual/shardingsphere-proxy/yaml-config/props.cn.md
@@ -24,7 +24,6 @@ Apache ShardingSphere 提供了丰富的系统配置属性,用户可通过 `se
 | proxy-frontend-executor-size (?)          | int     | Proxy 前端 Netty 线程池线程数量,默认值 0 代表使用 Netty 默认值。                                                                                           | 0        | 否      |
 | proxy-frontend-max-connections (?)        | int     | 允许连接 Proxy 的最大客户端数量,默认值 0 代表不限制。                                                                                                       | 0        | 是      |
 | sql-federation-type (?)                   | String  | 联邦查询执行器类型,包括:NONE,ORIGINAL,ADVANCED。                                                                                                   | NONE     | 是      |
-| proxy-mysql-default-version (?)           | String  | Proxy 通过配置文件指定 MySQL 的版本号,默认版本:5.7.22。                                                                                                 | 5.7.22   | 否      |
 | proxy-default-port (?)                    | String  | Proxy 通过配置文件指定默认端口。                                                                                                                    | 3307     | 否      |
 | proxy-netty-backlog (?)                   | int     | Proxy 通过配置文件指定默认netty back_log参数。                                                                                                      | 1024     | 否      |
 | proxy-frontend-database-protocol-type (?) | String  | Proxy 前端协议类型,支持 MySQL,PostgreSQL 和 openGauss                                                                                           | \"\"     | 否      |
diff --git a/docs/document/content/user-manual/shardingsphere-proxy/yaml-config/props.en.md b/docs/document/content/user-manual/shardingsphere-proxy/yaml-config/props.en.md
index 48329460650..fb5d9b6c237 100644
--- a/docs/document/content/user-manual/shardingsphere-proxy/yaml-config/props.en.md
+++ b/docs/document/content/user-manual/shardingsphere-proxy/yaml-config/props.en.md
@@ -24,7 +24,6 @@ Apache ShardingSphere provides a wealth of system configuration properties, whic
 | proxy-frontend-executor-size (?)          | int         | The number of threads in the Netty thread pool of front-end Proxy.                                                                                                                                                                                                                                           | 0         | False            |
 | proxy-frontend-max-connections (?)        | int         | The maximum number of clients that can be connected to Proxy. The default value of 0 indicates that there's no limit.                                                                                                                                                                                        | 0         | True             |
 | sql-federation-type (?)                   | String      | SQL federation executor type, including: NONE, ORIGINAL, ADVANCED.                                                                                                                                                                                                                                           | NONE      | True             |
-| proxy-mysql-default-version (?)           | String      | Proxy specifies the MySQL version through configuration files, and the default verison is 5.7.22.                                                                                                                                                                                                            | 5.7.22    | False            |
 | proxy-default-port (?)                    | String      | Proxy specifies the default window through configuration files.                                                                                                                                                                                                                                              | 3307      | False            |
 | proxy-netty-backlog (?)                   | int         | Proxy specifies the default netty back_log parameter through configuration files.                                                                                                                                                                                                                            | 1024      | False            |
 | proxy-frontend-database-protocol-type (?) | String      | Proxy front-end protocol type, supports MySQL, PostgreSQL, openGauss                                                                                                                                                                                                                                         | \"\"      | False            |
diff --git a/infra/common/src/main/java/org/apache/shardingsphere/infra/config/props/ConfigurationPropertyKey.java b/infra/common/src/main/java/org/apache/shardingsphere/infra/config/props/ConfigurationPropertyKey.java
index fdda90d5d37..ccf4dc16ba9 100644
--- a/infra/common/src/main/java/org/apache/shardingsphere/infra/config/props/ConfigurationPropertyKey.java
+++ b/infra/common/src/main/java/org/apache/shardingsphere/infra/config/props/ConfigurationPropertyKey.java
@@ -98,11 +98,6 @@ public enum ConfigurationPropertyKey implements TypedPropertyKey {
      */
     PROXY_FRONTEND_MAX_CONNECTIONS("proxy-frontend-max-connections", "0", int.class, false),
     
-    /**
-     * Proxy MySQL default version.
-     */
-    PROXY_MYSQL_DEFAULT_VERSION("proxy-mysql-default-version", "5.7.22", String.class, false),
-    
     /**
      * Proxy default start port.
      */
diff --git a/infra/common/src/test/java/org/apache/shardingsphere/infra/config/props/ConfigurationPropertiesTest.java b/infra/common/src/test/java/org/apache/shardingsphere/infra/config/props/ConfigurationPropertiesTest.java
index 10268841448..586b2db6208 100644
--- a/infra/common/src/test/java/org/apache/shardingsphere/infra/config/props/ConfigurationPropertiesTest.java
+++ b/infra/common/src/test/java/org/apache/shardingsphere/infra/config/props/ConfigurationPropertiesTest.java
@@ -46,7 +46,6 @@ class ConfigurationPropertiesTest {
         assertThat(actual.getValue(ConfigurationPropertyKey.PROXY_BACKEND_QUERY_FETCH_SIZE), is(20));
         assertThat(actual.getValue(ConfigurationPropertyKey.PROXY_FRONTEND_EXECUTOR_SIZE), is(20));
         assertThat(actual.getValue(ConfigurationPropertyKey.PROXY_FRONTEND_MAX_CONNECTIONS), is(20));
-        assertThat(actual.getValue(ConfigurationPropertyKey.PROXY_MYSQL_DEFAULT_VERSION), is("5.7.22"));
         assertThat(actual.getValue(ConfigurationPropertyKey.PROXY_DEFAULT_PORT), is(3308));
         assertThat(actual.getValue(ConfigurationPropertyKey.PROXY_NETTY_BACKLOG), is(1024));
         assertThat(actual.getValue(ConfigurationPropertyKey.CDC_SERVER_PORT), is(33071));
@@ -67,7 +66,6 @@ class ConfigurationPropertiesTest {
                 new Property(ConfigurationPropertyKey.PROXY_BACKEND_QUERY_FETCH_SIZE.getKey(), "20"),
                 new Property(ConfigurationPropertyKey.PROXY_FRONTEND_EXECUTOR_SIZE.getKey(), "20"),
                 new Property(ConfigurationPropertyKey.PROXY_FRONTEND_MAX_CONNECTIONS.getKey(), "20"),
-                new Property(ConfigurationPropertyKey.PROXY_MYSQL_DEFAULT_VERSION.getKey(), "5.7.22"),
                 new Property(ConfigurationPropertyKey.PROXY_DEFAULT_PORT.getKey(), "3308"),
                 new Property(ConfigurationPropertyKey.PROXY_NETTY_BACKLOG.getKey(), "1024"),
                 new Property(ConfigurationPropertyKey.CDC_SERVER_PORT.getKey(), "33071"));
@@ -89,7 +87,6 @@ class ConfigurationPropertiesTest {
         assertThat(actual.getValue(ConfigurationPropertyKey.PROXY_BACKEND_QUERY_FETCH_SIZE), is(-1));
         assertThat(actual.getValue(ConfigurationPropertyKey.PROXY_FRONTEND_EXECUTOR_SIZE), is(0));
         assertThat(actual.getValue(ConfigurationPropertyKey.PROXY_FRONTEND_MAX_CONNECTIONS), is(0));
-        assertThat(actual.getValue(ConfigurationPropertyKey.PROXY_MYSQL_DEFAULT_VERSION), is("5.7.22"));
         assertThat(actual.getValue(ConfigurationPropertyKey.PROXY_DEFAULT_PORT), is(3307));
         assertThat(actual.getValue(ConfigurationPropertyKey.PROXY_NETTY_BACKLOG), is(1024));
         assertThat(actual.getValue(ConfigurationPropertyKey.CDC_SERVER_PORT), is(33071));
diff --git a/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/queryable/ShowDistVariablesExecutorTest.java b/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/queryable/ShowDistVariablesExecutorTest.java
index b303c0be2d8..38a108d0520 100644
--- a/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/queryable/ShowDistVariablesExecutorTest.java
+++ b/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/queryable/ShowDistVariablesExecutorTest.java
@@ -63,7 +63,7 @@ class ShowDistVariablesExecutorTest {
         when(metaData.getGlobalRuleMetaData()).thenReturn(new ShardingSphereRuleMetaData(Collections.singleton(new LoggingRule(new DefaultLoggingRuleConfigurationBuilder().build()))));
         ShowDistVariablesExecutor executor = new ShowDistVariablesExecutor();
         Collection<LocalDataQueryResultRow> actual = executor.getRows(metaData, connectionSession, mock(ShowDistVariablesStatement.class));
-        assertThat(actual.size(), is(22));
+        assertThat(actual.size(), is(21));
         LocalDataQueryResultRow row = actual.iterator().next();
         assertThat(row.getCell(1), is("agent_plugins_enabled"));
         assertThat(row.getCell(2), is("true"));
diff --git a/proxy/backend/type/mysql/src/main/java/org/apache/shardingsphere/proxy/backend/mysql/handler/admin/executor/sysvar/SystemVariable.java b/proxy/backend/type/mysql/src/main/java/org/apache/shardingsphere/proxy/backend/mysql/handler/admin/executor/sysvar/SystemVariable.java
index 9d9f35f6f50..65ababb894e 100644
--- a/proxy/backend/type/mysql/src/main/java/org/apache/shardingsphere/proxy/backend/mysql/handler/admin/executor/sysvar/SystemVariable.java
+++ b/proxy/backend/type/mysql/src/main/java/org/apache/shardingsphere/proxy/backend/mysql/handler/admin/executor/sysvar/SystemVariable.java
@@ -19,10 +19,12 @@ package org.apache.shardingsphere.proxy.backend.mysql.handler.admin.executor.sys
 
 import lombok.Getter;
 import lombok.RequiredArgsConstructor;
+import org.apache.shardingsphere.db.protocol.mysql.constant.MySQLServerInfo;
 import org.apache.shardingsphere.dialect.mysql.exception.IncorrectGlobalLocalVariableException;
 import org.apache.shardingsphere.infra.util.exception.ShardingSpherePreconditions;
 import org.apache.shardingsphere.proxy.backend.mysql.handler.admin.executor.sysvar.provider.TransactionIsolationValueProvider;
 import org.apache.shardingsphere.proxy.backend.mysql.handler.admin.executor.sysvar.provider.TransactionReadOnlyValueProvider;
+import org.apache.shardingsphere.proxy.backend.mysql.handler.admin.executor.sysvar.provider.VersionValueProvider;
 import org.apache.shardingsphere.proxy.backend.session.ConnectionSession;
 
 import java.util.Arrays;
@@ -984,8 +986,7 @@ public enum SystemVariable {
     
     VALIDATE_USER_PLUGINS(Flag.GLOBAL | Flag.READONLY | Flag.INVISIBLE, "1"),
     
-    // TODO Get version of ShardingSphere-Proxy
-    VERSION(Flag.GLOBAL | Flag.READONLY, ""),
+    VERSION(Flag.GLOBAL | Flag.READONLY, MySQLServerInfo.getDefaultServerVersion(), new VersionValueProvider()),
     
     VERSION_COMMENT(Flag.GLOBAL | Flag.READONLY, "Source distribution"),
     
diff --git a/proxy/backend/type/mysql/src/main/java/org/apache/shardingsphere/proxy/backend/mysql/handler/admin/executor/sysvar/provider/VersionValueProvider.java b/proxy/backend/type/mysql/src/main/java/org/apache/shardingsphere/proxy/backend/mysql/handler/admin/executor/sysvar/provider/VersionValueProvider.java
new file mode 100644
index 00000000000..7e9a74fbfe9
--- /dev/null
+++ b/proxy/backend/type/mysql/src/main/java/org/apache/shardingsphere/proxy/backend/mysql/handler/admin/executor/sysvar/provider/VersionValueProvider.java
@@ -0,0 +1,35 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.shardingsphere.proxy.backend.mysql.handler.admin.executor.sysvar.provider;
+
+import org.apache.shardingsphere.db.protocol.mysql.constant.MySQLServerInfo;
+import org.apache.shardingsphere.proxy.backend.mysql.handler.admin.executor.sysvar.Scope;
+import org.apache.shardingsphere.proxy.backend.mysql.handler.admin.executor.sysvar.SystemVariable;
+import org.apache.shardingsphere.proxy.backend.mysql.handler.admin.executor.sysvar.SystemVariableValueProvider;
+import org.apache.shardingsphere.proxy.backend.session.ConnectionSession;
+
+/**
+ * MySQL version provider.
+ */
+public final class VersionValueProvider implements SystemVariableValueProvider {
+    
+    @Override
+    public String get(final Scope scope, final ConnectionSession connectionSession, final SystemVariable variable) {
+        return MySQLServerInfo.getServerVersion(connectionSession.getDefaultDatabaseName());
+    }
+}
diff --git a/proxy/backend/type/mysql/src/test/java/org/apache/shardingsphere/proxy/backend/mysql/handler/admin/executor/sysvar/provider/VersionValueProviderTest.java b/proxy/backend/type/mysql/src/test/java/org/apache/shardingsphere/proxy/backend/mysql/handler/admin/executor/sysvar/provider/VersionValueProviderTest.java
new file mode 100644
index 00000000000..3e34cc156ce
--- /dev/null
+++ b/proxy/backend/type/mysql/src/test/java/org/apache/shardingsphere/proxy/backend/mysql/handler/admin/executor/sysvar/provider/VersionValueProviderTest.java
@@ -0,0 +1,44 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.shardingsphere.proxy.backend.mysql.handler.admin.executor.sysvar.provider;
+
+import io.netty.util.DefaultAttributeMap;
+import org.apache.shardingsphere.db.protocol.mysql.constant.MySQLServerInfo;
+import org.apache.shardingsphere.infra.database.type.dialect.MySQLDatabaseType;
+import org.apache.shardingsphere.proxy.backend.mysql.handler.admin.executor.sysvar.Scope;
+import org.apache.shardingsphere.proxy.backend.mysql.handler.admin.executor.sysvar.SystemVariable;
+import org.apache.shardingsphere.proxy.backend.session.ConnectionSession;
+import org.apache.shardingsphere.transaction.api.TransactionType;
+import org.hamcrest.MatcherAssert;
+import org.junit.jupiter.api.Test;
+import org.mockito.MockedStatic;
+import org.mockito.Mockito;
+
+import static org.hamcrest.CoreMatchers.is;
+
+class VersionValueProviderTest {
+    
+    @Test
+    void assertGetValue() {
+        try (MockedStatic<MySQLServerInfo> mockedStatic = Mockito.mockStatic(MySQLServerInfo.class)) {
+            mockedStatic.when(() -> MySQLServerInfo.getServerVersion(null)).thenReturn("8.0");
+            ConnectionSession connectionSession = new ConnectionSession(new MySQLDatabaseType(), TransactionType.LOCAL, new DefaultAttributeMap());
+            MatcherAssert.assertThat(new VersionValueProvider().get(Scope.GLOBAL, connectionSession, SystemVariable.VERSION), is("8.0"));
+        }
+    }
+}
diff --git a/proxy/bootstrap/src/main/resources/conf/server.yaml b/proxy/bootstrap/src/main/resources/conf/server.yaml
index 872bed96992..5cb0a59792b 100644
--- a/proxy/bootstrap/src/main/resources/conf/server.yaml
+++ b/proxy/bootstrap/src/main/resources/conf/server.yaml
@@ -79,7 +79,6 @@
 #  proxy-frontend-max-connections: 0 # Less than or equal to 0 means no limitation.
 #    # Available sql federation type: NONE (default), ORIGINAL, ADVANCED
 #  sql-federation-type: NONE
-#  proxy-mysql-default-version: 5.7.22 # In the absence of schema name, the default version will be used.
 #  proxy-default-port: 3307 # Proxy default port.
 #  proxy-netty-backlog: 1024 # Proxy netty backlog.
 #  cdc-server-port: 33071 # CDC server port
diff --git a/proxy/bootstrap/src/test/java/org/apache/shardingsphere/proxy/version/ShardingSphereProxyVersionTest.java b/proxy/bootstrap/src/test/java/org/apache/shardingsphere/proxy/version/ShardingSphereProxyVersionTest.java
index 97b18ec30a5..51c09f4c3ae 100644
--- a/proxy/bootstrap/src/test/java/org/apache/shardingsphere/proxy/version/ShardingSphereProxyVersionTest.java
+++ b/proxy/bootstrap/src/test/java/org/apache/shardingsphere/proxy/version/ShardingSphereProxyVersionTest.java
@@ -18,7 +18,6 @@
 package org.apache.shardingsphere.proxy.version;
 
 import org.apache.shardingsphere.db.protocol.mysql.constant.MySQLServerInfo;
-import org.apache.shardingsphere.infra.config.props.ConfigurationPropertyKey;
 import org.apache.shardingsphere.infra.database.type.DatabaseType;
 import org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabase;
 import org.apache.shardingsphere.infra.metadata.database.resource.ShardingSphereResourceMetaData;
@@ -27,7 +26,6 @@ import org.apache.shardingsphere.mode.manager.ContextManager;
 import org.apache.shardingsphere.proxy.backend.context.ProxyContext;
 import org.apache.shardingsphere.test.mock.AutoMockExtension;
 import org.apache.shardingsphere.test.mock.StaticMockSettings;
-import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.Test;
 import org.junit.jupiter.api.extension.ExtendWith;
 import org.mockito.junit.jupiter.MockitoSettings;
@@ -50,11 +48,6 @@ import static org.mockito.Mockito.when;
 @MockitoSettings(strictness = Strictness.LENIENT)
 class ShardingSphereProxyVersionTest {
     
-    @BeforeEach
-    void setUp() {
-        when(ProxyContext.getInstance().getContextManager().getMetaDataContexts().getMetaData().getProps().getValue(ConfigurationPropertyKey.PROXY_MYSQL_DEFAULT_VERSION)).thenReturn("5.7.22");
-    }
-    
     @Test
     void assertSetVersionWhenStorageTypeSameWithProtocolType() throws SQLException {
         ShardingSphereProxyVersion.setVersion(mockContextManager("MySQL", "5.7.22"));
diff --git a/proxy/frontend/type/mysql/src/main/java/org/apache/shardingsphere/proxy/frontend/mysql/MySQLFrontendEngine.java b/proxy/frontend/type/mysql/src/main/java/org/apache/shardingsphere/proxy/frontend/mysql/MySQLFrontendEngine.java
index 15c5eb2eab0..5fd08a44dff 100644
--- a/proxy/frontend/type/mysql/src/main/java/org/apache/shardingsphere/proxy/frontend/mysql/MySQLFrontendEngine.java
+++ b/proxy/frontend/type/mysql/src/main/java/org/apache/shardingsphere/proxy/frontend/mysql/MySQLFrontendEngine.java
@@ -23,16 +23,14 @@ import org.apache.shardingsphere.db.protocol.codec.DatabasePacketCodecEngine;
 import org.apache.shardingsphere.db.protocol.mysql.codec.MySQLPacketCodecEngine;
 import org.apache.shardingsphere.db.protocol.mysql.constant.MySQLConstants;
 import org.apache.shardingsphere.db.protocol.mysql.constant.MySQLServerInfo;
+import org.apache.shardingsphere.db.protocol.mysql.netty.MySQLSequenceIDInboundHandler;
 import org.apache.shardingsphere.db.protocol.mysql.packet.MySQLPacket;
-import org.apache.shardingsphere.infra.config.props.ConfigurationPropertyKey;
-import org.apache.shardingsphere.proxy.backend.context.ProxyContext;
 import org.apache.shardingsphere.proxy.backend.session.ConnectionSession;
 import org.apache.shardingsphere.proxy.frontend.authentication.AuthenticationEngine;
 import org.apache.shardingsphere.proxy.frontend.command.CommandExecuteEngine;
 import org.apache.shardingsphere.proxy.frontend.mysql.authentication.MySQLAuthenticationEngine;
 import org.apache.shardingsphere.proxy.frontend.mysql.command.MySQLCommandExecuteEngine;
 import org.apache.shardingsphere.proxy.frontend.mysql.command.query.binary.MySQLStatementIDGenerator;
-import org.apache.shardingsphere.db.protocol.mysql.netty.MySQLSequenceIDInboundHandler;
 import org.apache.shardingsphere.proxy.frontend.netty.FrontendChannelInboundHandler;
 import org.apache.shardingsphere.proxy.frontend.spi.DatabaseProtocolFrontendEngine;
 
@@ -50,11 +48,6 @@ public final class MySQLFrontendEngine implements DatabaseProtocolFrontendEngine
     
     private final DatabasePacketCodecEngine<MySQLPacket> codecEngine = new MySQLPacketCodecEngine();
     
-    public MySQLFrontendEngine() {
-        MySQLServerInfo.setDefaultMysqlVersion(ProxyContext.getInstance()
-                .getContextManager().getMetaDataContexts().getMetaData().getProps().getValue(ConfigurationPropertyKey.PROXY_MYSQL_DEFAULT_VERSION));
-    }
-    
     @Override
     public void initChannel(final Channel channel) {
         channel.attr(MySQLConstants.MYSQL_SEQUENCE_ID).set(new AtomicInteger());
diff --git a/test/e2e/operation/pipeline/src/test/resources/env/mysql/server-5.yaml b/test/e2e/operation/pipeline/src/test/resources/env/mysql/server-5.yaml
index e5640cae2fc..56bbfca0663 100644
--- a/test/e2e/operation/pipeline/src/test/resources/env/mysql/server-5.yaml
+++ b/test/e2e/operation/pipeline/src/test/resources/env/mysql/server-5.yaml
@@ -41,5 +41,4 @@ props:
   proxy-hint-enabled: true
   sql-show: false
   sql-federation-type: ADVANCED
-  proxy-mysql-default-version: 5.7.22 
   cdc-server-port: 33071 # CDC server port
diff --git a/test/e2e/operation/pipeline/src/test/resources/env/mysql/server-8.yaml b/test/e2e/operation/pipeline/src/test/resources/env/mysql/server-8.yaml
index b4192b07cdd..56bbfca0663 100644
--- a/test/e2e/operation/pipeline/src/test/resources/env/mysql/server-8.yaml
+++ b/test/e2e/operation/pipeline/src/test/resources/env/mysql/server-8.yaml
@@ -41,5 +41,4 @@ props:
   proxy-hint-enabled: true
   sql-show: false
   sql-federation-type: ADVANCED
-  proxy-mysql-default-version: 8.0.11
   cdc-server-port: 33071 # CDC server port