Skip to content

Commit 3614e8e

Browse files
authored
Merge pull request #181 from oceanbase/fix-missing-parameters-handling
fix: Avoid JSON generation when configsMap is empty
2 parents 056ed84 + 12073f0 commit 3614e8e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,9 @@ private void login() throws Exception {
149149
request.setTenantName(obTable.getTenantName());
150150
request.setUserName(obTable.getUserName());
151151
request.setDatabaseName(obTable.getDatabase());
152-
if (loginWithConfigs) {
152+
// When the caller doesn't provide any parameters, configsMap is empty.
153+
// In this case, we don't generate any JSON to avoid creating an empty object.
154+
if (loginWithConfigs && !obTable.getConfigs().isEmpty()) {
153155
JSONObject json = new JSONObject(obTable.getConfigs());
154156
request.setConfigsStr(json.toJSONString());
155157
loginWithConfigs = false;

0 commit comments

Comments
 (0)