@@ -2507,18 +2507,24 @@ public static void parseObVerionFromLogin(String serverVersion)
25072507 throws FeatureNotSupportedException {
25082508 Pattern pattern ;
25092509 if (serverVersion .startsWith ("OceanBase_CE" )) {
2510- // serverVersion in CE is like "OceanBase_CE 4.0.0.0"
2511- pattern = Pattern .compile ("OceanBase_CE\\ s+(\\ d+)\\ .(\\ d+)\\ .(\\ d+)\\ .(\\ d+)" );
2510+ // serverVersion in CE is like "OceanBase_CE 4.0.0.0 (+ Obproxy 4.3.6.0), content in () is optional and valid after Obproxy 4.3.5 "
2511+ pattern = Pattern .compile ("OceanBase_CE\\ s+(\\ d+)\\ .(\\ d+)\\ .(\\ d+)\\ .(\\ d+)( \\ s+ \\ + \\ s+(Obproxy) \\ s+( \\ d+) \\ .( \\ d+) \\ .( \\ d+) \\ .( \\ d+))? " );
25122512 } else {
2513- // serverVersion is like "OceanBase 4.0.0.0"
2514- pattern = Pattern .compile ("OceanBase\\ s+(\\ d+)\\ .(\\ d+)\\ .(\\ d+)\\ .(\\ d+)" );
2513+ // serverVersion is like "OceanBase 4.0.0.0 (+ Obproxy 4.3.6.0), content in () is optional and valid after Obproxy 4.3.5 "
2514+ pattern = Pattern .compile ("OceanBase\\ s+(\\ d+)\\ .(\\ d+)\\ .(\\ d+)\\ .(\\ d+)( \\ s+ \\ + \\ s+(Obproxy) \\ s+( \\ d+) \\ .( \\ d+) \\ .( \\ d+) \\ .( \\ d+))? " );
25152515 }
25162516 Matcher matcher = pattern .matcher (serverVersion );
25172517 if (matcher .find () && ObGlobal .OB_VERSION == 0 ) {
25182518 ObGlobal .OB_VERSION = ObGlobal .calcVersion (Integer .parseInt (matcher .group (1 )),
25192519 (short ) Integer .parseInt (matcher .group (2 )),
25202520 (byte ) Integer .parseInt (matcher .group (3 )),
25212521 (byte ) Integer .parseInt (matcher .group (4 )));
2522+ if (matcher .group (5 ) != null && matcher .group (6 ) != null ) { // Obproxy part
2523+ ObGlobal .OB_PROXY_VERSION = ObGlobal .calcVersion (Integer .parseInt (matcher .group (7 )),
2524+ (short ) Integer .parseInt (matcher .group (8 )),
2525+ (byte ) Integer .parseInt (matcher .group (9 )),
2526+ (byte ) Integer .parseInt (matcher .group (10 )));
2527+ }
25222528 if (ObGlobal .obVsnMajor () < 4 ) {
25232529 throw new FeatureNotSupportedException (
25242530 "The current client version supports only server version greater than or equal to 4.0.0.0" );
0 commit comments