Skip to content

Commit efb54bf

Browse files
authored
throw exception when failed to get server version from login result (#248)
1 parent 8ab77ee commit efb54bf

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/main/java/com/alipay/oceanbase/rpc/bolt/transport/ObTableConnection.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,8 +173,12 @@ private void login() throws Exception {
173173
credential = result.getCredential();
174174
tenantId = result.getTenantId();
175175
// Set version if missing
176-
if (ObGlobal.obVsnMajor() == 0 && !result.getServerVersion().isEmpty()) {
176+
if (ObGlobal.obVsnMajor() == 0) {
177177
// version should be set before login when direct mode
178+
if (result.getServerVersion().isEmpty()) {
179+
throw new RuntimeException(
180+
"Failed to get server version from login result");
181+
}
178182
LocationUtil.parseObVerionFromLogin(result.getServerVersion());
179183
LOGGER.info("The OB_VERSION parsed from login result is: {}",
180184
ObGlobal.OB_VERSION);

0 commit comments

Comments
 (0)