From 6341568529721a74932a314cfa437fb3a48d6ba7 Mon Sep 17 00:00:00 2001 From: gitama Date: Thu, 3 Aug 2023 11:09:43 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E8=8E=B7=E5=8F=96=E5=8F=98=E9=87=8F?= =?UTF-8?q?=E6=8C=87=E4=BB=A4=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../opengauss/mppdbide/debuger/debug/DebugConstants.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/code/datastudio/src/org.opengauss.mppdbide.debuger/src/org/opengauss/mppdbide/debuger/debug/DebugConstants.java b/code/datastudio/src/org.opengauss.mppdbide.debuger/src/org/opengauss/mppdbide/debuger/debug/DebugConstants.java index 632036ef..b335bc72 100644 --- a/code/datastudio/src/org.opengauss.mppdbide.debuger/src/org/opengauss/mppdbide/debuger/debug/DebugConstants.java +++ b/code/datastudio/src/org.opengauss.mppdbide.debuger/src/org/opengauss/mppdbide/debuger/debug/DebugConstants.java @@ -1,4 +1,4 @@ -/* +/* * Copyright (c) 2022 Huawei Technologies Co.,Ltd. * * openGauss is licensed under Mulan PSL v2. @@ -6,7 +6,7 @@ * You may obtain a copy of Mulan PSL v2 at: * * http://license.coscl.org.cn/MulanPSL2 - * + * * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. @@ -152,7 +152,7 @@ public class DebugConstants { DBE_STEP_OUT("pldbg_step_out", 1), DBE_CONTINUE_EXEC("DBE_PLDEBUGGER.continue", 0), DBE_ABORT_TARGET("DBE_PLDEBUGGER.abort", 0), - DBE_GET_VARIABLES("DBE_PLDEBUGGER.print_var", 1), + DBE_GET_VARIABLES("DBE_PLDEBUGGER.info_locals", 0), DBE_GET_STACKS("DBE_PLDEBUGGER.backtrace", 0), DBE_GET_BREAKPOINTS("DBE_PLDEBUGGER.info_breakpoints", 0), DBE_DROP_BREAKPOINT("DBE_PLDEBUGGER.delete_breakpoint", 1), -- Gitee From 8b45b48861d2bcf3d7a0b1d64abb130b6af77f87 Mon Sep 17 00:00:00 2001 From: gitama Date: Fri, 4 Aug 2023 10:38:26 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E8=8E=B7=E5=8F=96=E6=89=80=E6=9C=89?= =?UTF-8?q?=E5=8F=82=E6=95=B0=E5=8F=98=E9=87=8F=E5=80=BC=E6=96=B9=E6=B3=95?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../debuger/service/DbeDebugService.java | 42 +++++++++++++------ 1 file changed, 29 insertions(+), 13 deletions(-) diff --git a/code/datastudio/src/org.opengauss.mppdbide.debuger/src/org/opengauss/mppdbide/debuger/service/DbeDebugService.java b/code/datastudio/src/org.opengauss.mppdbide.debuger/src/org/opengauss/mppdbide/debuger/service/DbeDebugService.java index 11f65317..774f9be5 100644 --- a/code/datastudio/src/org.opengauss.mppdbide.debuger/src/org/opengauss/mppdbide/debuger/service/DbeDebugService.java +++ b/code/datastudio/src/org.opengauss.mppdbide.debuger/src/org/opengauss/mppdbide/debuger/service/DbeDebugService.java @@ -406,22 +406,38 @@ public class DbeDebugService extends DebugService { private List getAllVariable(DebugConstants.DebugOpt debugOpt, Class clazz) throws SQLException { List vos = new ArrayList(); - map.get(getFunctionVo().oid).forEach(item -> { - try { - List inputParams = Arrays.asList(item); - try (PreparedStatement ps = getClientConn().getDebugOptPrepareStatement(debugOpt, inputParams)) { - try (ResultSet rs = ps.executeQuery()) { - if (rs.next()) { - vos.addAll(QueryResVoConvertHelper.parseList(rs, clazz, getClientConn())); - } - } catch (SQLException e) { - MPPDBIDELoggerUtility.error(e.getMessage()); + if(debugOpt.equals(DebugConstants.DebugOpt.DBE_GET_VARIABLES)) { + try (PreparedStatement ps = getClientConn().getDebugOptPrepareStatement(debugOpt, new ArrayList())) { + try (ResultSet rs = ps.executeQuery()) { + while (rs.next()) { + vos.addAll(QueryResVoConvertHelper.parseList(rs, clazz, getClientConn())); } + + } catch (SQLException e) { + MPPDBIDELoggerUtility.error(e.getMessage()); } - } catch (SQLException e) { - MPPDBIDELoggerUtility.error(e.getMessage()); } - }); + }else { + map.get(getFunctionVo().oid).forEach(item -> { + try { + List inputParams = Arrays.asList(item); + if(debugOpt.paramNum==0) { + inputParams=new ArrayList(); + } + try (PreparedStatement ps = getClientConn().getDebugOptPrepareStatement(debugOpt, inputParams)) { + try (ResultSet rs = ps.executeQuery()) { + if (rs.next()) { + vos.addAll(QueryResVoConvertHelper.parseList(rs, clazz, getClientConn())); + } + } catch (SQLException e) { + MPPDBIDELoggerUtility.error(e.getMessage()); + } + } + } catch (SQLException e) { + MPPDBIDELoggerUtility.error(e.getMessage()); + } + }); + } return vos; } -- Gitee