1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 package org.apache.shardingsphere.proxy.backend.mysql.handler.admin.executor.sysvar.provider;
19
20 import org.apache.shardingsphere.db.protocol.constant.DatabaseProtocolServerInfo;
21 import org.apache.shardingsphere.infra.database.core.type.DatabaseType;
22 import org.apache.shardingsphere.infra.spi.type.typed.TypedSPILoader;
23 import org.apache.shardingsphere.proxy.backend.mysql.handler.admin.executor.sysvar.MySQLSystemVariable;
24 import org.apache.shardingsphere.proxy.backend.mysql.handler.admin.executor.sysvar.MySQLSystemVariableValueProvider;
25 import org.apache.shardingsphere.proxy.backend.mysql.handler.admin.executor.sysvar.Scope;
26 import org.apache.shardingsphere.proxy.backend.session.ConnectionSession;
27
28
29
30
31 public final class VersionValueProvider implements MySQLSystemVariableValueProvider {
32
33 @Override
34 public String get(final Scope scope, final ConnectionSession connectionSession, final MySQLSystemVariable variable) {
35 return DatabaseProtocolServerInfo.getProtocolVersion(connectionSession.getDefaultDatabaseName(), TypedSPILoader.getService(DatabaseType.class, "MySQL"));
36 }
37 }