diff --git a/3rd_src/pom.xml b/3rd_src/pom.xml index 1a190a06552f1c2d789e1e284fdddb28c51efba8..7ee27804fc830bc455064cd0be0537aaf2a12d8c 100644 --- a/3rd_src/pom.xml +++ b/3rd_src/pom.xml @@ -18,6 +18,11 @@ win + + org.jsoup + jsoup + 1.14.3 + org.antlr antlr4-runtime diff --git a/README.en.md b/README.en.md index 4dca8a09491388d1567583aee82a0d7f22dcbb9b..e0993509a5467cca308506b371a84d01ae5bd715 100644 --- a/README.en.md +++ b/README.en.md @@ -2,7 +2,7 @@ ## Version introduction -This version is version 3.0.0 of opengauss Data Studio, which mainly provides the following functions: +This version is version 3.1.0 of opengauss Data Studio, which mainly provides the following functions: - Manage / create database objects (functions, stored procedures, tables, views, sequences, triggers, etc.) - Execute SQL statements or SQL scripts diff --git a/README.md b/README.md index e79bc4c7c9df0335cd7ee7c83e90be6631377b9f..23f6a46d1dfa4f231a98389ca3d496e73f4dbc2f 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ ## 版本介绍 -本版本为openGauss Data Studio的3.0.0版本,主要提供如下功能: +本版本为openGauss Data Studio的3.1.0版本,主要提供如下功能: - 管理/创建数据库对象(函数、存储过程、表、视图、序列、触发器等) - 执行SQL语句或者SQL脚本 diff --git a/Third_Party_Open_Source_Software_List.yaml b/Third_Party_Open_Source_Software_List.yaml new file mode 100644 index 0000000000000000000000000000000000000000..419348db31335204931c862126654e353e52bc24 --- /dev/null +++ b/Third_Party_Open_Source_Software_List.yaml @@ -0,0 +1,316 @@ +antlr4-runtime: + cpeName: antlr4-runtime + groupId: org.antlr + url: null + version: 4.9.2 +commons-lang3: + cpeName: commons-lang3 + groupId: org.apache.commons + url: null + version: 3.12.0 +commons-collections4: + cpeName: commons-collections4 + groupId: org.apache.commons + url: null + version: 4.4 +commons-compress: + cpeName: commons-compress + groupId: org.apache.commons + url: null + version: 1.21 +commons-math3: + cpeName: commons-math3 + groupId: org.apache.commons + url: null + version: 3.6.1 +commons-io: + cpeName: commons-io + groupId: commons-io + url: null + version: 2.11.0 +log4j-core: + cpeName: log4j-core + groupId: org.apache.logging.log4j + url: null + version: 2.17.1 +log4j-api: + cpeName: log4j-api + groupId: org.apache.logging.log4j + url: null + version: 2.17.1 +poi-ooxml: + cpeName: poi-ooxml + groupId: org.apache.poi + url: null + version: 4.1.2 +xmlbeans: + cpeName: xmlbeans + groupId: org.apache.xmlbeans + url: null + version: 3.1.0 +commons-csv: + cpeName: commons-csv + groupId: org.apache.commons + url: null + version: 1.9.0 +guava: + cpeName: guava + groupId: com.google.guava + url: null + version: 30.1.1-jre +guice: + cpeName: guice + groupId: com.google.inject + url: null + version: 4.2.0 +gson: + cpeName: gson + groupId: com.google.code.gson + url: null + version: 2.8.6 +commons-codec: + cpeName: commons-codec + groupId: commons-codec + url: null + version: 1.15 +jsqlparser: + cpeName: jsqlparser + groupId: com.github.jsqlparser + url: null + version: 3.2 +hamcrest-api: + cpeName: hamcrest-api + groupId: org.hamcrest + url: null + version: 1.0 +junit: + cpeName: junit + groupId: junit + url: null + version: 4.11 +log4j: + cpeName: log4j + groupId: log4j + url: null + version: 1.2.15 +commons-logging: + cpeName: commons-logging + groupId: commons-logging + url: null + version: 1.0.4 +oro: + cpeName: oro + groupId: oro + url: null + version: 2.0.8 +jdom: + cpeName: jdom + groupId: org.jdom + url: null + version: 2.0.2 +mockrunner-jdbc: + cpeName: mockrunner-jdbc + groupId: com.mockrunner + url: null + version: 2.0.6 +xml-apis: + cpeName: xml-apis + groupId: xml-apis + url: null + version: 1.0.b2 +cglib-nodep: + cpeName: cglib-nodep + groupId: cglib + url: null + version: 3.3.0 +easymock: + cpeName: easymock + groupId: org.easymock + url: null + version: 4.3 +objenesis: + cpeName: objenesis + groupId: org.objenesis + url: null + version: 3.2 +org.eclipse.osgi: + cpeName: org.eclipse.osgi + groupId: org.eclipse.tycho + url: null + version: 3.9.1.v20130814-1242 +powermock-api-mockito: + cpeName: powermock-api-mockito + groupId: org.powermock + url: null + version: 1.6.6 +powermock-api-mockito-common: + cpeName: powermock-api-mockito-common + groupId: org.powermock + url: null + version: 1.6.6 +powermock-api-support: + cpeName: powermock-api-support + groupId: org.powermock + url: null + version: 1.6.6 +powermock-core: + cpeName: powermock-core + groupId: org.powermock + url: null + version: 1.6.6 +powermock-api-easymock: + cpeName: powermock-api-easymock + groupId: org.powermock + url: null + version: 1.6.6 +powermock-api-mockito2: + cpeName: powermock-api-mockito2 + groupId: org.powermock + url: null + version: 1.6.6 +powermock-module-javaagent: + cpeName: powermock-module-javaagent + groupId: org.powermock + url: null + version: 1.6.6 +powermock-module-junit4: + cpeName: powermock-module-junit4 + groupId: org.powermock + url: null + version: 1.6.6 +powermock-module-junit4-common: + cpeName: powermock-module-junit4-common + groupId: org.powermock + url: null + version: 1.6.6 +powermock-module-junit4-legacy: + cpeName: powermock-module-junit4-legacy + groupId: org.powermock + url: null + version: 1.6.6 +powermock-module-testng: + cpeName: powermock-module-testng + groupId: org.powermock + url: null + version: 1.6.6 +powermock-module-testng-common: + cpeName: powermock-module-testng-common + groupId: org.powermock + url: null + version: 1.6.6 +powermock-classloading-base: + cpeName: powermock-classloading-base + groupId: org.powermock + url: null + version: 1.6.6 +powermock-module-junit4-rule-agent: + cpeName: powermock-module-junit4-rule-agent + groupId: org.powermock + url: null + version: 1.6.6 +powermock-module-testng-agent: + cpeName: powermock-module-testng-agent + groupId: org.powermock + url: null + version: 1.6.6 +powermock-reflect: + cpeName: powermock-reflect + groupId: org.powermock + url: null + version: 1.6.6 +bsh: + cpeName: bsh + groupId: bsh + url: null + version: 2.0b4 +javassist: + cpeName: javassist + groupId: org.javassist + url: null + version: 3.20.0-GA +jcommander: + cpeName: jcommander + groupId: com.beust + url: null + version: 1.27 +mockito-all: + cpeName: mockito-all + groupId: org.mockito + url: null + version: 1.10.19 +snakeyaml: + cpeName: snakeyaml + groupId: org.yaml + url: null + version: 1.30 +org.eclipse.core.contenttype: + cpeName: org.eclipse.core.contenttype + groupId: org.eclipse.core + url: null + version: 3.4.100 +org.eclipse.core.jobs: + cpeName: org.eclipse.core.jobs + groupId: org.eclipse.core + url: null + version: 3.5.100 +org.eclipse.core.runtime: + cpeName: org.eclipse.core.runtime + groupId: org.eclipse.core + url: null + version: 3.7.0 +org.eclipse.e4.core.services: + cpeName: org.eclipse.e4.core.services + groupId: org.eclipse.platform + url: null + version: 2.0.100 +org.eclipse.e4.core.di: + cpeName: org.eclipse.e4.core.di + groupId: org.eclipse.platform + url: null + version: 1.8.100 +org.eclipse.equinox.app: + cpeName: org.eclipse.equinox.app + groupId: org.eclipse.equinox + url: null + version: 1.3.100 +org.eclipse.equinox.common: + cpeName: org.eclipse.equinox.common + groupId: org.eclipse.equinox + url: null + version: 3.6.0 +org.eclipse.equinox.preferences: + cpeName: org.eclipse.equinox.preferences + groupId: org.eclipse.platform + url: null + version: 3.6.1 +org.eclipse.equinox.registry: + cpeName: org.eclipse.equinox.registry + groupId: org.eclipse.platform + url: null + version: 3.6.100 +org.eclipse.osgi.services: + cpeName: org.eclipse.osgi.services + groupId: org.eclipse.platform + url: null + version: 3.5.100 +runtime_registry_compatibility: + cpeName: runtime_registry_compatibility + groupId: com.anaptecs.jeaf.owalibs + url: null + version: 4.3.1 +javafx-base: + cpeName: javafx-base + groupId: org.openjfx + url: null + version: 18-ea+2 +javafx-controls: + cpeName: javafx-controls + groupId: org.openjfx + url: null + version: 18-ea+2 +javafx-graphics: + cpeName: javafx-graphics + groupId: org.openjfx + url: null + version: 18-ea+2 + diff --git a/code/datastudio/src/copyExternalsToBuild.bat b/code/datastudio/src/copyExternalsToBuild.bat index b6b8bc23cecdfb242edf6fd0a83753a963c352c8..0be7b37bc0210bfce3878973b8780e42a8115a97 100644 --- a/code/datastudio/src/copyExternalsToBuild.bat +++ b/code/datastudio/src/copyExternalsToBuild.bat @@ -48,6 +48,7 @@ xcopy %SOURCE%\3rd_src\target\dependency\guava-30.1.1-jre.jar %DEST%\org.opengau xcopy %SOURCE%\3rd_src\target\dependency\javafx-base-18-ea+2-win.jar %DEST%\org.opengauss.mppdbide.view\. /Y /S /E xcopy %SOURCE%\3rd_src\target\dependency\javafx-controls-18-ea+2-win.jar %DEST%\org.opengauss.mppdbide.view\. /Y /S /E xcopy %SOURCE%\3rd_src\target\dependency\javafx-graphics-18-ea+2-win.jar %DEST%\org.opengauss.mppdbide.view\. /Y /S /E +xcopy %SOURCE%\3rd_src\target\dependency\jsoup-1.14.3.jar %DEST%\org.opengauss.mppdbide.view\. /Y /S /E xcopy %SOURCE%\platform\Gauss200\gs_jdbc\gsjdbc4.jar %DEST%\org.opengauss.dbdriver.jdbc.gauss\. /Y /S /E rmdir /Q /S %TEST%\org.opengauss.mppdbide.adapter.test.fragment\lib diff --git a/code/datastudio/src/copyExternalsToBuild.sh b/code/datastudio/src/copyExternalsToBuild.sh index 9c2d20c883895edcb0e20838729024cbc16d52b1..b23aead61171ef0fa8c72f1584b0fbeea026bd72 100644 --- a/code/datastudio/src/copyExternalsToBuild.sh +++ b/code/datastudio/src/copyExternalsToBuild.sh @@ -49,6 +49,7 @@ cp $SOURCE/3rd_src/target/dependency/guava-30.1.1-jre.jar $DEST/org.opengauss.mp cp $SOURCE/3rd_src/target/dependency/javafx-base-18-ea+2-win.jar $DEST/org.opengauss.mppdbide.view/. cp $SOURCE/3rd_src/target/dependency/javafx-controls-18-ea+2-win.jar $DEST/org.opengauss.mppdbide.view/. cp $SOURCE/3rd_src/target/dependency/javafx-graphics-18-ea+2-win.jar $DEST/org.opengauss.mppdbide.view/. +cp $SOURCE/3rd_src/target/dependency/jsoup-1.14.3.jar $DEST/org.opengauss.mppdbide.view/. cp $SOURCE/platform/Gauss200/gs_jdbc/gsjdbc4.jar $DEST/org.opengauss.dbdriver.jdbc.gauss/. rm -rf $TEST/org.opengauss.mppdbide.adapter.test.fragment/lib diff --git a/code/datastudio/src/org.opengauss.mppdbide.bl/src/org/opengauss/mppdbide/bl/serverdatacache/DebugObjects.java b/code/datastudio/src/org.opengauss.mppdbide.bl/src/org/opengauss/mppdbide/bl/serverdatacache/DebugObjects.java index b32769dd9fb27ad0b6ad34e2435683253da0e47a..0b95a949502842e6126648015673acfadabca64a 100644 --- a/code/datastudio/src/org.opengauss.mppdbide.bl/src/org/opengauss/mppdbide/bl/serverdatacache/DebugObjects.java +++ b/code/datastudio/src/org.opengauss.mppdbide.bl/src/org/opengauss/mppdbide/bl/serverdatacache/DebugObjects.java @@ -43,6 +43,9 @@ import org.opengauss.mppdbide.utils.logger.MPPDBIDELoggerUtility; */ public class DebugObjects extends BatchDropServerObject implements ObjectChange, GaussOLAPDBMSObject, IDebugObject { + + private static String coverageHint; + private boolean isDebugable; private String executeTemplate; private String executionQuery; @@ -88,6 +91,7 @@ public class DebugObjects extends BatchDropServerObject implements ObjectChange, */ public void setUsagehint(String usagehint) { this.usageHint = usagehint; + this.coverageHint = usagehint; } /** @@ -869,6 +873,9 @@ public class DebugObjects extends BatchDropServerObject implements ObjectChange, hasout = createTemplateFromParams(params, parameterObject.getTemplateParams(), template, parameterObject.getOutParams()); + if (MessageConfigLoader.getProperty(IMessagesConstants.COVERAGE_HINT).equalsIgnoreCase(coverageHint)) { + usagehint.append(coverageHint + MPPDBIDEConstants.LINE_SEPARATOR); + } if (hasout) { usagehint.append(MessageConfigLoader.getProperty(IMessagesConstants.EXEC_DEBUG_DIALOG_OUT_PARA_MSG) + MPPDBIDEConstants.LINE_SEPARATOR); diff --git a/code/datastudio/src/org.opengauss.mppdbide.bl/src/org/opengauss/mppdbide/bl/serverdatacache/IDebugObject.java b/code/datastudio/src/org.opengauss.mppdbide.bl/src/org/opengauss/mppdbide/bl/serverdatacache/IDebugObject.java index 3dc740b00f3cd1b31ef4f0acad3c1ec6b184de06..c8ca8768153fee881309e7828e78c14ed71b8645 100644 --- a/code/datastudio/src/org.opengauss.mppdbide.bl/src/org/opengauss/mppdbide/bl/serverdatacache/IDebugObject.java +++ b/code/datastudio/src/org.opengauss.mppdbide.bl/src/org/opengauss/mppdbide/bl/serverdatacache/IDebugObject.java @@ -259,6 +259,13 @@ public interface IDebugObject { */ ArrayList getTemplateParameters(); + /** + * Gets the parameters. + * + * @return the parameters + */ + ObjectParameter[] getObjectParameters(); + /** * Clear template parameter values. */ diff --git a/code/datastudio/src/org.opengauss.mppdbide.debuger/META-INF/MANIFEST.MF b/code/datastudio/src/org.opengauss.mppdbide.debuger/META-INF/MANIFEST.MF index 2a29a9e20ed5a232f17618256d37a9cb0e1212a3..9fb82c430e9edccf9b45cf9e1f52f58bab881a0f 100644 --- a/code/datastudio/src/org.opengauss.mppdbide.debuger/META-INF/MANIFEST.MF +++ b/code/datastudio/src/org.opengauss.mppdbide.debuger/META-INF/MANIFEST.MF @@ -20,7 +20,8 @@ Export-Package: org.opengauss.mppdbide.common, org.opengauss.mppdbide.debuger.service, org.opengauss.mppdbide.debuger.service.chain, org.opengauss.mppdbide.debuger.thread, - org.opengauss.mppdbide.debuger.vo + org.opengauss.mppdbide.debuger.vo, + org.opengauss.mppdbide.debuger.vo.dbe Bundle-ClassPath: . Import-Package: org.postgresql.core, org.postgresql.jdbc, diff --git a/code/datastudio/src/org.opengauss.mppdbide.debuger/src/org/opengauss/mppdbide/common/ConvertHandleUtil.java b/code/datastudio/src/org.opengauss.mppdbide.debuger/src/org/opengauss/mppdbide/common/ConvertHandleUtil.java new file mode 100644 index 0000000000000000000000000000000000000000..f68efb6d4d7484eb5bf36d0a818da2a102726f72 --- /dev/null +++ b/code/datastudio/src/org.opengauss.mppdbide.debuger/src/org/opengauss/mppdbide/common/ConvertHandleUtil.java @@ -0,0 +1,58 @@ +/* + * Copyright (c) 2022 Huawei Technologies Co.,Ltd. + * + * openGauss is licensed under Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * 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. + * See the Mulan PSL v2 for more details. + */ + +package org.opengauss.mppdbide.common; + +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.List; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; + +import org.opengauss.mppdbide.debuger.service.BreakPointHandle; +import org.opengauss.mppdbide.debuger.service.BreakPointListHandle; +import org.opengauss.mppdbide.debuger.service.IQueryResConvertService; +import org.opengauss.mppdbide.debuger.service.StackVoHandle; +import org.opengauss.mppdbide.debuger.service.VariableVoHandle; + +/** + * Description: ConvertHandleUtil + * + * @since 3.0.0 + */ +public class ConvertHandleUtil { + private static Map strategiesDictionary = + new ConcurrentHashMap(); + + static { + strategiesDictionary.put(ConvertVoEnum.BREAK_POINT, new BreakPointHandle()); + strategiesDictionary.put(ConvertVoEnum.BREAK_POINT_LIST, new BreakPointListHandle()); + strategiesDictionary.put(ConvertVoEnum.STACK, new StackVoHandle()); + strategiesDictionary.put(ConvertVoEnum.VARIABLE, new VariableVoHandle()); + } + + /** + * process + * + * @param type the type + * @param rs the rs + * @param the generic type + * @return the return value + * @throws SQLException the exception + */ + public static List process(ConvertVoEnum type, ResultSet rs) throws SQLException { + return strategiesDictionary.get(type).covertList(rs); + } +} diff --git a/code/datastudio/src/org.opengauss.mppdbide.debuger/src/org/opengauss/mppdbide/common/ConvertVoEnum.java b/code/datastudio/src/org.opengauss.mppdbide.debuger/src/org/opengauss/mppdbide/common/ConvertVoEnum.java new file mode 100644 index 0000000000000000000000000000000000000000..97c93918c14c705a3ac763e12b6dbe8adee7725f --- /dev/null +++ b/code/datastudio/src/org.opengauss.mppdbide.debuger/src/org/opengauss/mppdbide/common/ConvertVoEnum.java @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2022 Huawei Technologies Co.,Ltd. + * + * openGauss is licensed under Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * 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. + * See the Mulan PSL v2 for more details. + */ + +package org.opengauss.mppdbide.common; + +import java.util.stream.Stream; + +import org.opengauss.mppdbide.debuger.vo.BreakPointListVo; +import org.opengauss.mppdbide.debuger.vo.BreakpointVo; +import org.opengauss.mppdbide.debuger.vo.StackVo; +import org.opengauss.mppdbide.debuger.vo.VariableVo; + +/** + * Description: ConvertVoEnum + * + * @since 3.0.0 + */ +public enum ConvertVoEnum { + BREAK_POINT_LIST("BreakPointListVo", BreakPointListVo.class), + BREAK_POINT("BreakpointVo", BreakpointVo.class), + STACK("StackVo", StackVo.class), + VARIABLE("VariableVo", VariableVo.class); + + private String name; + private Class clazz; + + ConvertVoEnum(String name, Class clazz) { + this.name = name; + this.clazz = clazz; + } + + /** + * getType + * + * @param clazz the class + * @return the ConvertVoEnum + */ + public static ConvertVoEnum getType(Class clazz) { + return Stream.of(ConvertVoEnum.values()) + .filter(item -> clazz.getSimpleName().equalsIgnoreCase(item.clazz.getSimpleName())).findFirst().get(); + } +} diff --git a/code/datastudio/src/org.opengauss.mppdbide.debuger/src/org/opengauss/mppdbide/common/QueryResVoConvertHelper.java b/code/datastudio/src/org.opengauss.mppdbide.debuger/src/org/opengauss/mppdbide/common/QueryResVoConvertHelper.java new file mode 100644 index 0000000000000000000000000000000000000000..d3df0c59c6ea51ee8b392d2a84d4d305bef71ce5 --- /dev/null +++ b/code/datastudio/src/org.opengauss.mppdbide.debuger/src/org/opengauss/mppdbide/common/QueryResVoConvertHelper.java @@ -0,0 +1,137 @@ +/* + * Copyright (c) 2022 Huawei Technologies Co.,Ltd. + * + * openGauss is licensed under Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * 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. + * See the Mulan PSL v2 for more details. + */ + +package org.opengauss.mppdbide.common; + +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.List; +import java.util.stream.Collectors; + +import org.opengauss.mppdbide.debuger.annotation.ParseVo; +import org.opengauss.mppdbide.debuger.debug.DebugConstants; +import org.opengauss.mppdbide.debuger.vo.SourceCodeVo; +import org.opengauss.mppdbide.debuger.vo.VersionVo; +import org.opengauss.mppdbide.debuger.vo.dbe.InfoCodeVo; + +/** + * Convert openGauss 3.0 vo to openGauss2.0 vo + * + * @author gitam + * @since 3.0.0 + */ +public class QueryResVoConvertHelper { + /** + * Convert results to vo + * + * @param rs the rs + * @param clazz the class + * @param conn the connection + * @param the Generics + * @return return value + * @throws SQLException the exception + */ + public static T parse(ResultSet rs, Class clazz, IConnection conn) throws SQLException { + VersionVo version = VersionHelper.getDebuggerVersion(conn); + return parse(rs, clazz, version); + } + + /** + * Convert parse vo + * + * @param rs the rs + * @param clazz the class + * @param versionVo the vo param + * @param the Generics + * @return the converted value + * @throws SQLException the exception + */ + public static T parse(ResultSet rs, Class clazz, VersionVo versionVo) throws SQLException { + T obj = null; + // if openGauss2.0 command do not need to convert + if (!getConvert(versionVo.getDebuggerVersion())) { + obj = ParseVo.parse(rs, clazz); + } else { + if (SourceCodeVo.class.equals(clazz)) { + obj = convertToSourceCodeVo(rs); + } + } + return obj; + } + + /** + * Covert list + * + * @param rs the rs + * @param clazz the class + * @param conn the connection + * @param the Generics + * @return the converted value + * @throws SQLException the exception + */ + public static List parseList(ResultSet rs, Class clazz, IConnection conn) throws SQLException { + VersionVo version = VersionHelper.getDebuggerVersion(conn); + return parseList(rs, clazz, version); + } + + /** + * Convert list + * + * @param rs the rs + * @param clazz the class + * @param versionVo the param + * @param the Generics + * @return the converted value + * @throws SQLException the exception + */ + public static List parseList(ResultSet rs, Class clazz, VersionVo versionVo) throws SQLException { + List list = null; + // if openGauss2.0 command do not need to convert + if (!getConvert(versionVo.getDebuggerVersion())) { + list = ParseVo.parseList(rs, clazz); + } else { + list = ConvertHandleUtil.process(ConvertVoEnum.getType(clazz), rs); + } + return list; + } + + /** + * Convert vo by class + * + * @param rs the rs + * @param the Generics + * @return the converted value + * @throws SQLException the exception + */ + public static T convertToSourceCodeVo(ResultSet rs) throws SQLException { + List infos = ParseVo.parseList(rs, InfoCodeVo.class); + List infoCodeList = infos.stream().filter(item -> item.lineno != null).collect(Collectors.toList()); + StringBuffer buffer = new StringBuffer(); + infoCodeList.forEach(infoItem -> { + if (!infoItem.query.endsWith("\n")) { + infoItem.query = infoItem.query + "\n"; + } + buffer.append(infoItem.query); + }); + SourceCodeVo sourceCodeVo = new SourceCodeVo(); + sourceCodeVo.setCodes(infoCodeList); + sourceCodeVo.setSourceCode(buffer.toString()); + return (T) sourceCodeVo; + } + + private static boolean getConvert(String version) { + return DebugConstants.DBE_DEBUGGER.equalsIgnoreCase(version); + } +} diff --git a/code/datastudio/src/org.opengauss.mppdbide.debuger/src/org/opengauss/mppdbide/common/VersionHelper.java b/code/datastudio/src/org.opengauss.mppdbide.debuger/src/org/opengauss/mppdbide/common/VersionHelper.java new file mode 100644 index 0000000000000000000000000000000000000000..3daaa6c4069e850f9430e44bf9804cac241b2630 --- /dev/null +++ b/code/datastudio/src/org.opengauss.mppdbide.debuger/src/org/opengauss/mppdbide/common/VersionHelper.java @@ -0,0 +1,81 @@ +/* + * Copyright (c) 2022 Huawei Technologies Co.,Ltd. + * + * openGauss is licensed under Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * 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. + * See the Mulan PSL v2 for more details. + */ + +package org.opengauss.mppdbide.common; + +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; + +import org.opengauss.mppdbide.debuger.debug.DebugConstants; +import org.opengauss.mppdbide.debuger.debug.DebugConstants.DebugOpt; +import org.opengauss.mppdbide.debuger.vo.VersionVo; +import org.opengauss.mppdbide.utils.logger.MPPDBIDELoggerUtility; + +/** + * Title: class + *

+ * Description: check version. + * + * @since 3.0.0 + */ +public class VersionHelper { + /** + * Description: get openGauss debugger version + * + * @param serverConn database connection + * @return pl_debugger or dbe_debugger + * @throws SQLException the exception + */ + public static VersionVo getDebuggerVersion(IConnection serverConn) throws SQLException { + if (serverConn == null) { + throw new SQLException("serverConn is null!"); + } + String sql = DebugConstants.getDbVersionSql(); + VersionVo versionVo = new VersionVo(); + try (PreparedStatement ps = serverConn.getStatement(sql)) { + try (ResultSet rs = ps.executeQuery()) { + if (rs.next()) { + // (openGauss 2.1.0 build 590b0f8e) openGauss version info + String version = rs.getObject(1).toString(); + MPPDBIDELoggerUtility.debug("openGauss db info version:" + version); + versionVo.version = version; + } + MPPDBIDELoggerUtility.debug("openGauss db info is empty!"); + return versionVo; + } + } + } + + /** + * Description: get getDebugOptByDebuggerVersion + * + * @param serverConn database connection + * @param debugOpt param + * @return the return value + * @throws SQLException the exception + */ + public static DebugOpt getDebugOptByDebuggerVersion(IConnection serverConn, DebugOpt debugOpt) throws SQLException { + if (serverConn == null) { + return debugOpt; + } + VersionVo versionVo = getDebuggerVersion(serverConn); + DebugOpt res = DebugConstants.getDebugOptByDebuggerVersion(debugOpt, versionVo.getDebuggerVersion()); + if (res == null) { + return debugOpt; + } + return res; + } +} 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 8e28d5218d2c168aee52829c67bb63d46389b188..632036efdfc11fd47bed27a25357792201dcbfdd 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 @@ -15,7 +15,10 @@ package org.opengauss.mppdbide.debuger.debug; +import java.util.HashMap; +import java.util.LinkedHashMap; import java.util.Locale; +import java.util.Map; import java.util.stream.Stream; /** @@ -29,13 +32,99 @@ public class DebugConstants { */ public static final int DEFAULT_STRING_BUILD_LEN = 128; + /** + * default PL_DEBUGGER name + */ + public static final String PL_DEBUGGER = "pl_debugger"; + + /** + * default DBE_DEBUGGER name + */ + public static final String DBE_DEBUGGER = "dbe_debugger"; + + /** + * default version + */ + public static final Integer DBE_DEBUGGER_MIN_VERSION = 300; + + /** + * enumMap + */ + public static final LinkedHashMap ENUM_MAP = getEnumMap(DebugOpt.class); + + /** + * store dataType + */ + private static final Map DATA_TYPE = new HashMap<>(); + + /** + * dataTypes + */ + static { + DATA_TYPE.put("bpchar", "char"); + DATA_TYPE.put("bool", "boolean"); + DATA_TYPE.put("float", "binary double"); + DATA_TYPE.put("int2", "smallint"); + DATA_TYPE.put("int4", "integer"); + DATA_TYPE.put("int8", "bigint"); + DATA_TYPE.put("float8", "double precision"); + DATA_TYPE.put("float4", "real"); + DATA_TYPE.put("timetz", "time with time zone"); + DATA_TYPE.put("timestamptz", "timestamp with time zone"); + DATA_TYPE.put("time", "time without time zone"); + DATA_TYPE.put("bpchar", "timestamp"); + } + + /** + * getDataType + * + * @param data dataType + * @return the data type string + */ + public static String getDataType(String data) { + return DATA_TYPE.get(data); + } + + /** + * get DebugOpt by different debugger + * + * @param debugOpt the debugOpt + * @param debuggerVersion the version + * @return DebugOpt the return value + */ + public static DebugOpt getDebugOptByDebuggerVersion(DebugOpt debugOpt, String debuggerVersion) { + if (PL_DEBUGGER.equalsIgnoreCase(debuggerVersion)) { + return debugOpt; + } else { + String optName = debugOpt.name(); + optName = "DBE_" + optName; + return ENUM_MAP.get(optName); + } + } + + /** + * get name and all enum map + * + * @param + * @param enumClass the enumclass + * @return LinkedHashMap + */ + public static > LinkedHashMap getEnumMap(final Class enumClass) { + final LinkedHashMap map = new LinkedHashMap<>(); + for (final E e : enumClass.getEnumConstants()) { + map.put(e.name(), e); + } + return map; + } + /** * Title: the DebugOpt enum use to descript debuger interface */ public static enum DebugOpt { + // pldebugger command DEBUG_ON("pldbg_on", 0), DEBUG_OFF("pldbg_off", 0), - DEBUG_VERSION("pldbg_get_proxy_info", 0), + DEBUG_VERSION("version", 0), GET_SOURCE_CODE("pldbg_get_source", 1), GET_TOTAL_SOURCE_CODE("pg_get_functiondef", 1), START_SESSION("plpgsql_oid_debug", 1), @@ -49,7 +138,29 @@ public class DebugConstants { GET_STACKS("pldbg_get_stack", 1), GET_BREAKPOINTS("pldbg_get_breakpoints", 1), DROP_BREAKPOINT("pldbg_drop_breakpoint", 3), - SET_BREAKPOINT("pldbg_set_breakpoint", 3); + SET_BREAKPOINT("pldbg_set_breakpoint", 3), + // dbe_debugger command + DBE_DEBUG_ON("DBE_PLDEBUGGER.turn_on", 1), + DBE_DEBUG_OFF("DBE_PLDEBUGGER.turn_off", 1), + DBE_DEBUG_VERSION("version", 0), + DBE_GET_SOURCE_CODE("DBE_PLDEBUGGER.info_code", 1), + DBE_GET_TOTAL_SOURCE_CODE("pg_get_functiondef", 1), + DBE_START_SESSION("DBE_PLDEBUGGER.turn_on", 1), + DBE_ATTACH_SESSION("DBE_PLDEBUGGER.attach", 2), + DBE_STEP_INTO("DBE_PLDEBUGGER.step", 1), + DBE_STEP_OVER("DBE_PLDEBUGGER.next", 0), + 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_STACKS("DBE_PLDEBUGGER.backtrace", 0), + DBE_GET_BREAKPOINTS("DBE_PLDEBUGGER.info_breakpoints", 0), + DBE_DROP_BREAKPOINT("DBE_PLDEBUGGER.delete_breakpoint", 1), + DBE_SET_BREAKPOINT("DBE_PLDEBUGGER.add_breakpoint", 2), + DBE_REMARK_INFO_SET("DBE_PLDEBUGGER.remark_info_set", 2), + DBE_REMARK_INFO_GET("DBE_PLDEBUGGER.remark_info_get", 1), + DBE_COVERAGE_INFO_GET("DBE_PLDEBUGGER.coverage_info_get", 1), + DBE_COVERAGE_INFO_DEL("DBE_PLDEBUGGER.coverage_info_del", 2); /** * opt of interface @@ -95,4 +206,13 @@ public class DebugConstants { paramReplace ); } + + /** + * get openGauss db version sql + * + * @return String query sql + */ + public static String getDbVersionSql() { + return "select version()"; + } } diff --git a/code/datastudio/src/org.opengauss.mppdbide.debuger/src/org/opengauss/mppdbide/debuger/service/BreakPointHandle.java b/code/datastudio/src/org.opengauss.mppdbide.debuger/src/org/opengauss/mppdbide/debuger/service/BreakPointHandle.java new file mode 100644 index 0000000000000000000000000000000000000000..c78df5292452d4edc2c56fb63504b960d2319136 --- /dev/null +++ b/code/datastudio/src/org.opengauss.mppdbide.debuger/src/org/opengauss/mppdbide/debuger/service/BreakPointHandle.java @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2022 Huawei Technologies Co.,Ltd. + * + * openGauss is licensed under Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * 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. + * See the Mulan PSL v2 for more details. + */ + +package org.opengauss.mppdbide.debuger.service; + +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.List; + +import org.opengauss.mppdbide.debuger.annotation.ParseVo; +import org.opengauss.mppdbide.debuger.vo.PositionVo; +import org.opengauss.mppdbide.debuger.vo.dbe.InfoBreakPointsVo; + +/** + * Description: BreakPointHandle + * + * @since 3.0.0 + */ +public class BreakPointHandle implements IQueryResConvertService { + /** + * covertList + * + * @param rs the rs + * @param + * @return the return value + * @throws SQLException the SQL exception + */ + @Override + public List covertList(ResultSet rs) throws SQLException { + List list = new ArrayList(); + List infos = ParseVo.parseList(rs, InfoBreakPointsVo.class); + infos.forEach(item -> { + PositionVo vo = new PositionVo(); + vo.func = item.funcoid; + vo.linenumber = item.lineno; + vo.breakpointno = item.breakpointno; + list.add((T) vo); + }); + return list; + } +} diff --git a/code/datastudio/src/org.opengauss.mppdbide.debuger/src/org/opengauss/mppdbide/debuger/service/BreakPointListHandle.java b/code/datastudio/src/org.opengauss.mppdbide.debuger/src/org/opengauss/mppdbide/debuger/service/BreakPointListHandle.java new file mode 100644 index 0000000000000000000000000000000000000000..fac81825b58a9c2db4e6715fdc7fbfaa69baf64d --- /dev/null +++ b/code/datastudio/src/org.opengauss.mppdbide.debuger/src/org/opengauss/mppdbide/debuger/service/BreakPointListHandle.java @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2022 Huawei Technologies Co.,Ltd. + * + * openGauss is licensed under Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * 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. + * See the Mulan PSL v2 for more details. + */ + +package org.opengauss.mppdbide.debuger.service; + +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.List; + +import org.opengauss.mppdbide.debuger.annotation.ParseVo; +import org.opengauss.mppdbide.debuger.vo.BreakPointListVo; + +/** + * Description: BreakPointListHandle + * + * @since 3.0.0 + */ +public class BreakPointListHandle implements IQueryResConvertService { + /** + * covertList + * + * @param rs the rs + * @param + * @return the return value + * @throws SQLException the SQL exception + */ + @Override + public List covertList(ResultSet rs) throws SQLException { + List list = new ArrayList(); + List pointList = ParseVo.parseList(rs, BreakPointListVo.class); + pointList.forEach(item -> { + BreakPointListVo breakPointListVo = new BreakPointListVo(); + breakPointListVo.breakpointno = item.breakpointno; + breakPointListVo.enable = item.enable; + breakPointListVo.funcoid = item.funcoid; + breakPointListVo.lineno = item.lineno; + breakPointListVo.query = item.query; + list.add((T) breakPointListVo); + }); + return list; + } +} 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 new file mode 100644 index 0000000000000000000000000000000000000000..9dda765b60336ffa9ee728f18cd267ee5dd82efd --- /dev/null +++ b/code/datastudio/src/org.opengauss.mppdbide.debuger/src/org/opengauss/mppdbide/debuger/service/DbeDebugService.java @@ -0,0 +1,413 @@ +/* + * Copyright (c) 2022 Huawei Technologies Co.,Ltd. + * + * openGauss is licensed under Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * 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. + * See the Mulan PSL v2 for more details. + */ + +package org.opengauss.mppdbide.debuger.service; + +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.sql.SQLWarning; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.Timer; +import java.util.TimerTask; +import java.util.concurrent.ConcurrentHashMap; + +import org.opengauss.mppdbide.common.QueryResVoConvertHelper; +import org.opengauss.mppdbide.common.VersionHelper; +import org.opengauss.mppdbide.debuger.annotation.ParseVo; +import org.opengauss.mppdbide.debuger.debug.DebugConstants; +import org.opengauss.mppdbide.debuger.debug.DebugConstants.DebugOpt; +import org.opengauss.mppdbide.debuger.exception.DebugExitException; +import org.opengauss.mppdbide.debuger.vo.BreakPointListVo; +import org.opengauss.mppdbide.debuger.vo.PositionVo; +import org.opengauss.mppdbide.debuger.vo.StackVo; +import org.opengauss.mppdbide.debuger.vo.VariableVo; +import org.opengauss.mppdbide.debuger.vo.dbe.AttachVo; +import org.opengauss.mppdbide.debuger.vo.dbe.TurnOnVo; +import org.opengauss.mppdbide.utils.DebuggerStartVariable; +import org.opengauss.mppdbide.utils.VariableRunLine; +import org.opengauss.mppdbide.utils.logger.MPPDBIDELoggerUtility; +import org.opengauss.mppdbide.utils.vo.DebuggerStartInfoVo; + +/** + * Title: the DbeDebugService class + * + * @since 3.0.0 + */ +public class DbeDebugService extends DebugService { + /** + * save parameters + */ + public static final Map> map = new ConcurrentHashMap<>(); + + private TurnOnVo turnOnVo = null; + private DebuggerReportService reportService = DebuggerReportService.getInstance(); + + /** + * prepare to debug + * + * @return void + * @throws SQLException the exp + */ + @Override + public void prepareDebug() throws SQLException { + List inputsParams = Arrays.asList(getFunctionVo().oid); + try (PreparedStatement ps = getServerConn().getDebugOptPrepareStatement( + DebugConstants.DebugOpt.DBE_DEBUG_ON, inputsParams)) { + ResultSet rs = ps.executeQuery(); + if (rs.next()) { + turnOnVo = ParseVo.parse(rs, TurnOnVo.class); + SQLWarning sql = new SQLWarning("Pldebugger is started successfully, you are SERVER now."); + noticeReceived(sql); + } + } + } + + /** + * when server backthread started, this will callback + * + * @param args input args to function + * @return Optional the function result + * @throws SQLException the exp + */ + @Override + public Optional serverDebugCallBack(List args) throws SQLException { + try { + getServerCallBackBegin(); + String sql = DebugConstants.getSql(getFunctionVo().proname, args.size()); + try (PreparedStatement ps = getServerConn().getStatement(sql)) { + for (int i = 1; i < args.size() + 1; i++) { + ps.setObject(i, args.get(i - 1)); + } + Timer timer = new Timer(); + timer.schedule(new TimerTask() { + /** + * run + */ + public void run() { + SQLWarning sqlWarning = new SQLWarning("YOUR PROXY PORT ID IS:" + turnOnVo.port); + noticeReceived(sqlWarning); + } + }, 2000); + try (ResultSet rs = ps.executeQuery()) { + if (rs.next()) { + return Optional.ofNullable(rs.getObject(1)); + } + return Optional.empty(); + } + } + } finally { + getServerCallBackEnd(); + } + } + + /** + * client attach debug + * + * @return void + * @throws SQLException the exp + */ + @Override + public void attachDebug() throws SQLException { + try { + Thread.sleep(getDelay()); + } catch (InterruptedException e) { + MPPDBIDELoggerUtility.error(e.getMessage()); + } + getWaitServerStart(); + List inputParams = Arrays.asList(turnOnVo.nodename, getSessionVo().serverPort); + DebugOpt opt = VersionHelper.getDebugOptByDebuggerVersion(getClientConn(), + DebugConstants.DebugOpt.ATTACH_SESSION); + try (PreparedStatement ps = getClientConn().getDebugOptPrepareStatement(opt, inputParams)) { + try (ResultSet rs = ps.executeQuery()) { + if (rs.next()) { + getClientState().attached(); + AttachVo attachVo = ParseVo.parse(rs, AttachVo.class); + getSessionVo().clientPort = attachVo.lineno; + return; + } + } catch (SQLException e) { + MPPDBIDELoggerUtility.error(e.getMessage()); + } + } + throw new SQLException("client attach failed, please check"); + } + + /** + * server set debug session off + * + * @return void + * @throws SQLException the exp + */ + @Override + public void debugOff() throws SQLException { + List inputParams = new ArrayList(1); + DebugOpt opt = DebugConstants.DebugOpt.DBE_DEBUG_OFF; + inputParams = Arrays.asList(getFunctionVo().oid); + try (PreparedStatement ps = getClientConn().getDebugOptPrepareStatement(opt, inputParams)) { + ps.execute(); + } + } + + /** + * client abort debug + * + * @return Optional true if success + * @throws SQLException the exp + */ + @Override + public Optional abortDebug() throws SQLException { + if (getClientState().isStopped()) { + return Optional.empty(); + } + List inputParams = new ArrayList(); + DebugConstants.DebugOpt opt = VersionHelper.getDebugOptByDebuggerVersion(getClientConn(), + DebugConstants.DebugOpt.ABORT_TARGET); + try (PreparedStatement ps = getClientConn().getDebugOptPrepareStatement(opt, inputParams)) { + getClientState().stop(); + getClientState().stateLocked(); + try (ResultSet rs = ps.executeQuery()) { + Boolean hasResult = false; + if (rs.next()) { + hasResult = rs.getBoolean(1); + } + return Optional.of(hasResult); + } catch (SQLException e) { + return Optional.of(true); + } + } + } + + /** + * step run common command + * + * @param debugOpt which opteration to exec + * @return Optional the breakpoint line position + * @throws SQLException the exp + * @throws DebugExitException the debug exit exp + */ + @Override + public Optional getPositionVo(DebugOpt debugOpt) throws SQLException, DebugExitException { + getClientState().running(); + if (debugOpt == DebugOpt.STEP_OUT) { + throw new SQLException("not support method!"); + } + List inputParams = new ArrayList(); + DebugOpt opt = VersionHelper.getDebugOptByDebuggerVersion(getClientConn(), debugOpt); + try (PreparedStatement ps = getClientConn().getDebugOptPrepareStatement(opt, inputParams)) { + try (ResultSet rs = ps.executeQuery()) { + if (!getServerState().isRunning()) { + throw new DebugExitException(); + } + PositionVo positionVo = null; + if (rs.next()) { + AttachVo vo = new AttachVo(); + vo = ParseVo.parse(rs, AttachVo.class); + positionVo = new PositionVo(vo.funcoid, vo.lineno, vo.funcname); + } + return Optional.ofNullable(positionVo); + } catch (SQLException e) { + return Optional.empty(); + } + } + } + + /** + * get cur variables + * + * @return List all variables + * @throws SQLException the exp + */ + @Override + public List getVariables() throws SQLException { + return getAllVariable(DebugConstants.DebugOpt.DBE_GET_VARIABLES, VariableVo.class); + } + + /** + * get cur stacks + * + * @return List all stacks + * @throws SQLException the exp + */ + @Override + public List getStacks() throws SQLException { + return getDbeListVos(DebugConstants.DebugOpt.GET_STACKS, StackVo.class, new ArrayList<>()); + } + + /** + * get cur breakpoints + * + * @return List all breakpoints + * @throws SQLException the exp + */ + @Override + public List getBreakPoints() throws SQLException { + List list = getDbeListVos(DebugConstants.DebugOpt.DBE_GET_BREAKPOINTS, + BreakPointListVo.class, new ArrayList<>()); + List vos = new ArrayList<>(); + list.forEach(item -> { + PositionVo vo = new PositionVo(); + vo.breakpointno = item.breakpointno; + vo.isEnable = item.enable; + vo.func = item.funcoid; + vo.linenumber = item.lineno; + vo.targetname = item.query; + vos.add(vo); + }); + return vos; + } + + /** + * set breakpoint + * + * @param positionVo which line will set breakpoint + * @return boolean true if success + * @throws SQLException the exp + */ + @Override + public boolean setBreakPoint(PositionVo positionVo) throws SQLException { + return disposeDbeBreakpoint(DebugConstants.DebugOpt.DBE_SET_BREAKPOINT, positionVo, false); + } + + /** + * delete breakpoint + * + * @param positionVo which line will set breakpoint + * @return boolean true if success + * @throws SQLException the exp + */ + @Override + public boolean dropBreakPoint(PositionVo positionVo) throws SQLException { + return disposeDbeBreakpoint(DebugConstants.DebugOpt.DBE_DROP_BREAKPOINT, positionVo, true); + } + + /** + * close all connection + * + * @return void + */ + @Override + public void closeService() { + super.closeService(); + if (reportService != null) { + reportService.close(); + } + } + + + /** + * begin debug + * + * @param args function input args + * @return void + * @throws SQLException sql exception + */ + @Override + public void begin(List args) throws SQLException { + VariableRunLine.isContinue = null; + VariableRunLine.isPldebugger = null; + VariableRunLine.passLine.clear(); + VariableRunLine.isTerminate = true; + DebuggerStartInfoVo startInfo = DebuggerStartVariable.getStartInfo(getFunctionVo().oid); + startInfo.args = args; + startInfo.oid = getFunctionVo().oid; + startInfo.isMakeReport = true; + DebuggerStartVariable.setStartInfo(getFunctionVo().oid, startInfo); + getVersion(); + super.begin(args); + } + + /** + * get version + * + * @return the version + */ + public boolean getVersion() { + if (VariableRunLine.isPldebugger == null) { + try { + VariableRunLine.isPldebugger = VersionHelper.getDebuggerVersion(getClientConn()).isPldebugger(); + } catch (SQLException e) { + MPPDBIDELoggerUtility.error(e.getMessage()); + } + } + return VariableRunLine.isPldebugger; + } + + private boolean disposeDbeBreakpoint(DebugOpt debugOpt, PositionVo positionVo, Boolean isDelete) + throws SQLException { + if (positionVo.func == null || positionVo.func.intValue() == 0) { + positionVo.func = getFunctionVo().oid; + } + List inputParams; + if (isDelete) { + List res = getBreakPoints(); + Optional vo = res.stream() + .filter(item -> item.linenumber.equals(positionVo.linenumber)).findFirst(); + inputParams = new ArrayList<>(); + if (vo.isPresent()) { + inputParams = Arrays.asList(vo.get().getBreakpointno()); + } + } else { + inputParams = Arrays.asList(positionVo.func, positionVo.linenumber); + } + getValidCheckForConnection(); + try (PreparedStatement ps = getClientConn().getDebugOptPrepareStatement(debugOpt, inputParams)) { + try (ResultSet rs = ps.executeQuery()) { + boolean hasResult = false; + if (rs.next() && getVersion()) { + hasResult = rs.getBoolean(1); + } + return hasResult; + } + } + } + + 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()); + } + } + } catch (SQLException e) { + MPPDBIDELoggerUtility.error(e.getMessage()); + } + }); + return vos; + } + + private List getDbeListVos(DebugConstants.DebugOpt debugOpt, Class clazz, List inputParams) + throws SQLException { + DebugOpt opt = VersionHelper.getDebugOptByDebuggerVersion(getClientConn(), debugOpt); + try (PreparedStatement ps = getClientConn().getDebugOptPrepareStatement(opt, inputParams)) { + try (ResultSet rs = ps.executeQuery()) { + return QueryResVoConvertHelper.parseList(rs, clazz, getClientConn()); + } catch (SQLException e) { + return new ArrayList(); + } + } + } +} diff --git a/code/datastudio/src/org.opengauss.mppdbide.debuger/src/org/opengauss/mppdbide/debuger/service/DebugService.java b/code/datastudio/src/org.opengauss.mppdbide.debuger/src/org/opengauss/mppdbide/debuger/service/DebugService.java index b5278971ccd1d1827a98178a1a13ae6b3fff0b3f..0fa9e4e483d38ea98f7a21d7b0c64758cb23eceb 100644 --- a/code/datastudio/src/org.opengauss.mppdbide.debuger/src/org/opengauss/mppdbide/debuger/service/DebugService.java +++ b/code/datastudio/src/org.opengauss.mppdbide.debuger/src/org/opengauss/mppdbide/debuger/service/DebugService.java @@ -694,4 +694,103 @@ public class DebugService implements NoticeListener, EventHander, IDebugService throw new SQLException("debug connection already disconnect!"); } } + + /** + * getFunctionVo + * + * @return FunctionVo functionVo + */ + FunctionVo getFunctionVo() { + return functionVo; + } + + /** + * getClientConn + * + * @return IConnection iConnection + */ + IConnection getClientConn() { + return clientConn; + } + + /** + * getServerConn + * + * @return IConnection iConnection + */ + IConnection getServerConn() { + return serverConn; + } + + /** + * getSessionVo + * + * @return SessionVo sessionVo + */ + SessionVo getSessionVo() { + return sessionVo; + } + + /** + * getDelay + * + * @return delay delay + */ + int getDelay() { + return DEFAULT_WAIT_LOCK_TIME; + } + + /** + * get client state + * + * @return DebugState debugState + */ + DebugState getClientState() { + return clientState; + } + + /** + * get server state + * + * @return DebugState debugState + */ + DebugState getServerState() { + return serverState; + } + + /** + * getValidCheckForConnection + * + * @throws SQLException sql exception + */ + void getValidCheckForConnection() throws SQLException { + validCheckForConnection(); + } + + /** + * getWaitServerStart + * + * @throws SQLException sql exception + */ + void getWaitServerStart() throws SQLException { + waitServerStart(); + } + + /** + * getServerCallBackEnd + * + * @throws SQLException sql exception + */ + void getServerCallBackEnd() throws SQLException { + serverCallBackEnd(); + } + + /** + * getServerCallBackBegin + * + * @throws SQLException sql exception + */ + void getServerCallBackBegin() throws SQLException { + serverCallBackBegin(); + } } diff --git a/code/datastudio/src/org.opengauss.mppdbide.debuger/src/org/opengauss/mppdbide/debuger/service/DebuggerReportService.java b/code/datastudio/src/org.opengauss.mppdbide.debuger/src/org/opengauss/mppdbide/debuger/service/DebuggerReportService.java new file mode 100644 index 0000000000000000000000000000000000000000..14a393eac70cf84da96cec4c109b0168b9088d42 --- /dev/null +++ b/code/datastudio/src/org.opengauss.mppdbide.debuger/src/org/opengauss/mppdbide/debuger/service/DebuggerReportService.java @@ -0,0 +1,325 @@ +/* + * Copyright (c) 2022 Huawei Technologies Co.,Ltd. + * + * openGauss is licensed under Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * 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. + * See the Mulan PSL v2 for more details. + */ + +package org.opengauss.mppdbide.debuger.service; + +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.TimeUnit; + +import org.opengauss.mppdbide.common.IConnection; +import org.opengauss.mppdbide.common.IConnectionProvider; +import org.opengauss.mppdbide.debuger.annotation.ParseVo; +import org.opengauss.mppdbide.debuger.debug.DebugConstants; +import org.opengauss.mppdbide.debuger.debug.DebugConstants.DebugOpt; +import org.opengauss.mppdbide.debuger.exception.DebugPositionNotFoundException; +import org.opengauss.mppdbide.debuger.service.SourceCodeService.CodeDescription; +import org.opengauss.mppdbide.debuger.vo.FunctionVo; +import org.opengauss.mppdbide.debuger.vo.dbe.AttachVo; +import org.opengauss.mppdbide.debuger.vo.dbe.TurnOnVo; +import org.opengauss.mppdbide.utils.DebuggerStartVariable; +import org.opengauss.mppdbide.utils.VariableRunLine; +import org.opengauss.mppdbide.utils.logger.MPPDBIDELoggerUtility; +import org.opengauss.mppdbide.utils.vo.DebuggerEndInfoVo; +import org.opengauss.mppdbide.utils.vo.DebuggerStartInfoVo; + +/** + * Description: Coverage record generation + * + * @since 3.0.0 + */ +public class DebuggerReportService { + /** + * default offset value + */ + public static final int CODE_BASE_OFFSET = 1; + private static final String CREAT_TABLE = "CREATE TABLE IF NOT EXISTS his_coverage( oid BIGINT,"; + private static final String TABLE_FIELD_ONE = " cid BIGINT, coverageLines VARCHAR, remarkLines VARCHAR, "; + private static final String TABLE_FIELD_TWO = "endTime BIGINT, sourceCode VARCHAR, params VARCHAR);"; + private static final String INSERT = "insert into his_coverage VALUES(?,?,?,?,?,?,?);"; + + /** + * default value + */ + private static DebuggerReportService debuggerReportService = new DebuggerReportService(); + + private IConnection serverConn; + private IConnection clientConn; + private FunctionVo functionVo; + private TurnOnVo turnOnVo; + private DebuggerStartInfoVo startInfo; + private CodeDescription baseCodeDesc = null; + private CodeDescription totalCodeDesc = null; + + private DebuggerReportService() { + + } + + /** + * Gets the single instance of DebuggerReportService. + * + * @return single instance of DebuggerReportService + */ + public static DebuggerReportService getInstance() { + return debuggerReportService; + } + + /** + * set base code + * + * @param baseCodeDesc the baseCodeDesc + */ + public void setBaseCode(CodeDescription baseCodeDesc) { + this.baseCodeDesc = baseCodeDesc; + } + + /** + * set total code + * + * @param totalCodeDesc the code + */ + public void setTotalCode(CodeDescription totalCodeDesc) { + this.totalCodeDesc = totalCodeDesc; + } + + private String getCurLine(int breakPointLine) { + try { + return String.valueOf(codeLine2ShowLine(breakPointLine)); + } catch (DebugPositionNotFoundException dbgExp) { + MPPDBIDELoggerUtility.error("receive invalid position:" + dbgExp.toString()); + } + return "-1"; + } + + private String getCurLine() { + try { + return String.valueOf(getBeginDebugCodeLine()); + } catch (DebugPositionNotFoundException debugExp) { + MPPDBIDELoggerUtility.error("receive invalid position:" + debugExp.toString()); + } + return "-1"; + } + + /** + * set attribute value + * + * @param connectProvider the connect provider + * @param functionVo the function + */ + public void setAttr(IConnectionProvider connectProvider, FunctionVo functionVo) { + try { + this.serverConn = connectProvider.getValidFreeConnection(); + this.clientConn = connectProvider.getValidFreeConnection(); + this.functionVo = functionVo; + } catch (SQLException e) { + MPPDBIDELoggerUtility.error(e.getMessage()); + } + } + + /** + * set server connection + * + * @param serverConn connection to set of server + * @return void + */ + public void setServerConn(IConnection serverConn) { + this.serverConn = serverConn; + } + + /** + * set client connection + * + * @param clientConn connection + * @return void + */ + public void setClientConn(IConnection clientConn) { + this.clientConn = clientConn; + } + + /** + * close connection + * + * @return void + */ + public void close() { + try { + if (serverConn != null) { + serverConn.close(); + serverConn = null; + } + } catch (SQLException sqlErr) { + MPPDBIDELoggerUtility.warn("reportService serverConn close failed, err=" + sqlErr.toString()); + } + try { + if (clientConn != null) { + clientConn.close(); + clientConn = null; + } + } catch (SQLException sqlErr) { + MPPDBIDELoggerUtility.warn("reportService clientConn close failed, err=" + sqlErr.toString()); + } + } + + /** + * set function vo + * + * @param functionVo function vo + * @return void + */ + public void setFunctionVo(FunctionVo functionVo) { + this.functionVo = functionVo; + } + + /** + * make dbedebugger report info + */ + public void makeReport() { + startInfo = DebuggerStartVariable.getStartInfo(functionVo.oid); + if (!startInfo.isMakeReport) { + return; + } + List inputsParams = Arrays.asList(functionVo.oid); + ResultSet rs = null; + try { + // DBE_DEBUG_OFF + DebugOpt opt = DebugConstants.DebugOpt.DBE_DEBUG_OFF; + rs = serverConn.getDebugOptPrepareStatement(opt, inputsParams).executeQuery(); + opt = DebugConstants.DebugOpt.DBE_START_SESSION; + rs = serverConn.getDebugOptPrepareStatement(opt, inputsParams).executeQuery(); + if (rs.next()) { + turnOnVo = ParseVo.parse(rs, TurnOnVo.class); + } + + // call proc + List args = startInfo.args; + String sql = DebugConstants.getSql(functionVo.proname, args.size()); + try (PreparedStatement ps = serverConn.getStatement(sql)) { + for (int i = 1; i < args.size() + 1; i++) { + ps.setObject(i, args.get(i - 1)); + } + CompletableFuture.delayedExecutor(100, TimeUnit.MILLISECONDS).execute(() -> { + doClient(); + }); + ps.executeQuery(); + } + } catch (SQLException e) { + MPPDBIDELoggerUtility.error(e.getMessage()); + } finally { + try { + if (rs != null) { + rs.close(); + } + } catch (SQLException e) { + MPPDBIDELoggerUtility.error(e.getMessage()); + } + } + } + + private void doClient() { + VariableRunLine.runList.clear(); + // attach + List inputsParams = new ArrayList(); + inputsParams.add(turnOnVo.nodename); + inputsParams.add(turnOnVo.port); + DebugOpt opt = DebugConstants.DebugOpt.DBE_ATTACH_SESSION; + try (ResultSet rs = clientConn.getDebugOptPrepareStatement(opt, inputsParams).executeQuery()) { + MPPDBIDELoggerUtility.info("attach start..."); + } catch (SQLException e) { + MPPDBIDELoggerUtility.error(e.getMessage()); + } + List runLinks = new ArrayList(); + runLinks.add(getCurLine()); + // next + inputsParams = new ArrayList(); + opt = DebugConstants.DebugOpt.DBE_STEP_OVER; + Boolean hasNext = true; + while (hasNext) { + try (ResultSet rs = clientConn.getDebugOptPrepareStatement(opt, inputsParams).executeQuery()) { + if (rs.next()) { + AttachVo attachVo = ParseVo.parse(rs, AttachVo.class); + Integer lineNo = attachVo.lineno; + if (lineNo > 1) { + runLinks.add(getCurLine(lineNo)); + } + } else { + hasNext = false; + } + } catch (SQLException e) { + hasNext = false; + } + } + VariableRunLine.runList.addAll(runLinks); + DebuggerEndInfoVo endInfo = new DebuggerEndInfoVo(); + String runStr = String.join(",", runLinks); + endInfo.runStr = runStr; + endInfo.setInfo(startInfo); + List historyList = DebuggerStartVariable.getHistoryList(functionVo.oid); + historyList.add(endInfo); + DebuggerStartVariable.setHistoryList(functionVo.oid, historyList); + createTbale(endInfo); + } + + private void createTbale(DebuggerEndInfoVo endInfo) { + StringBuffer sb = new StringBuffer(); + sb.append(CREAT_TABLE); + sb.append(TABLE_FIELD_ONE + TABLE_FIELD_TWO); + String createTableSql = sb.toString(); + try { + clientConn.getStatement(createTableSql).execute(); + PreparedStatement preparedStatement = clientConn.getStatement(INSERT); + preparedStatement.setObject(1, endInfo.oid); + preparedStatement.setObject(2, endInfo.cid); + preparedStatement.setObject(3, endInfo.runStr); + preparedStatement.setObject(4, endInfo.remarLinesStr); + preparedStatement.setObject(5, endInfo.endDateLong); + preparedStatement.setObject(6, endInfo.sourceCode); + if (endInfo.args != null) { + preparedStatement.setObject(7, endInfo.args.toString()); + } + preparedStatement.execute(); + } catch (SQLException e) { + MPPDBIDELoggerUtility.error(e.getMessage()); + } + } + + private int getBeginDebugCodeLine() throws DebugPositionNotFoundException { + return getFirstValidDebugPos() + getBeginTotalAndBaseDiff(); + } + + private int getFirstValidDebugPos() throws DebugPositionNotFoundException { + return getBeignOfBaseCode() + CODE_BASE_OFFSET; + } + + private int codeLine2ShowLine(int codeLine) throws DebugPositionNotFoundException { + return codeLine + getBeginTotalAndBaseDiff() - CODE_BASE_OFFSET; + } + + private int getBeginTotalAndBaseDiff() throws DebugPositionNotFoundException { + return getBeignfTotalCode() - getBeignOfBaseCode(); + } + + private int getBeignOfBaseCode() throws DebugPositionNotFoundException { + return this.baseCodeDesc.getBeginPosition(); + } + + private int getBeignfTotalCode() throws DebugPositionNotFoundException { + return this.totalCodeDesc.getBeginPosition(); + } +} diff --git a/code/datastudio/src/org.opengauss.mppdbide.debuger/src/org/opengauss/mppdbide/debuger/service/IQueryResConvertService.java b/code/datastudio/src/org.opengauss.mppdbide.debuger/src/org/opengauss/mppdbide/debuger/service/IQueryResConvertService.java new file mode 100644 index 0000000000000000000000000000000000000000..3e7bc45774a4aab648e0ed02ee2499e02e995aeb --- /dev/null +++ b/code/datastudio/src/org.opengauss.mppdbide.debuger/src/org/opengauss/mppdbide/debuger/service/IQueryResConvertService.java @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2022 Huawei Technologies Co.,Ltd. + * + * openGauss is licensed under Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * 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. + * See the Mulan PSL v2 for more details. + */ + +package org.opengauss.mppdbide.debuger.service; + +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.List; + +/** + * Description: IQueryResConvertService + * + * @since 3.0.0 + */ +public interface IQueryResConvertService { + /** + * covertList + * + * @param rs the rs + * @param + * @return the return value + * @throws SQLException the SQL exception + */ + List covertList(ResultSet rs) throws SQLException; +} diff --git a/code/datastudio/src/org.opengauss.mppdbide.debuger/src/org/opengauss/mppdbide/debuger/service/QueryService.java b/code/datastudio/src/org.opengauss.mppdbide.debuger/src/org/opengauss/mppdbide/debuger/service/QueryService.java index 810bbf6cb0ff23720519ec040545df368afa1b63..a77e991df5dc45114be6e4d567e61e401dda20df 100644 --- a/code/datastudio/src/org.opengauss.mppdbide.debuger/src/org/opengauss/mppdbide/debuger/service/QueryService.java +++ b/code/datastudio/src/org.opengauss.mppdbide.debuger/src/org/opengauss/mppdbide/debuger/service/QueryService.java @@ -15,15 +15,6 @@ package org.opengauss.mppdbide.debuger.service; -import org.opengauss.mppdbide.debuger.dao.FunctionDao; -import org.opengauss.mppdbide.debuger.annotation.ParseVo; -import org.opengauss.mppdbide.debuger.debug.DebugConstants; -import org.opengauss.mppdbide.debuger.vo.FunctionVo; -import org.opengauss.mppdbide.debuger.vo.SourceCodeVo; -import org.opengauss.mppdbide.debuger.vo.TotalSourceCodeVo; -import org.opengauss.mppdbide.common.IConnection; -import org.opengauss.mppdbide.utils.logger.MPPDBIDELoggerUtility; - import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; @@ -31,6 +22,17 @@ import java.util.Arrays; import java.util.List; import java.util.Optional; +import org.opengauss.mppdbide.common.IConnection; +import org.opengauss.mppdbide.common.QueryResVoConvertHelper; +import org.opengauss.mppdbide.common.VersionHelper; +import org.opengauss.mppdbide.debuger.dao.FunctionDao; +import org.opengauss.mppdbide.debuger.debug.DebugConstants; +import org.opengauss.mppdbide.debuger.debug.DebugConstants.DebugOpt; +import org.opengauss.mppdbide.debuger.vo.FunctionVo; +import org.opengauss.mppdbide.debuger.vo.SourceCodeVo; +import org.opengauss.mppdbide.debuger.vo.TotalSourceCodeVo; +import org.opengauss.mppdbide.utils.logger.MPPDBIDELoggerUtility; + /** * Title: the QueryService class * @@ -66,9 +68,10 @@ public class QueryService implements IService { * @throws SQLException sql exp */ public Optional getSourceCode(Long oid) throws SQLException { - return getTempSourceCode(oid, - DebugConstants.DebugOpt.GET_SOURCE_CODE, - SourceCodeVo.class); + DebugOpt opt = VersionHelper.getDebugOptByDebuggerVersion(conn, DebugConstants.DebugOpt.GET_SOURCE_CODE); + Optional sourceCodeVo = getTempSourceCode(oid, opt, SourceCodeVo.class); + String sourceCode = sourceCodeVo.get().getSourceCode(); + return sourceCodeVo; } /** @@ -93,7 +96,7 @@ public class QueryService implements IService { debugOpt, inputParams)) { try (ResultSet rs = ps.executeQuery()) { if (rs.next()) { - return Optional.of(ParseVo.parse(rs, clazz)); + return Optional.of(QueryResVoConvertHelper.parse(rs, clazz, conn)); } return Optional.empty(); } diff --git a/code/datastudio/src/org.opengauss.mppdbide.debuger/src/org/opengauss/mppdbide/debuger/service/ServiceFactory.java b/code/datastudio/src/org.opengauss.mppdbide.debuger/src/org/opengauss/mppdbide/debuger/service/ServiceFactory.java index f6f19ba1d5b6319749e7185251d2b8603a785837..2c0f771e9f00d83aa3640421a7b9d78d3dbf13c3 100644 --- a/code/datastudio/src/org.opengauss.mppdbide.debuger/src/org/opengauss/mppdbide/debuger/service/ServiceFactory.java +++ b/code/datastudio/src/org.opengauss.mppdbide.debuger/src/org/opengauss/mppdbide/debuger/service/ServiceFactory.java @@ -21,7 +21,9 @@ import org.opengauss.mppdbide.debuger.debug.DebugConstants; import org.opengauss.mppdbide.debuger.vo.FunctionVo; import org.opengauss.mppdbide.common.IConnection; import org.opengauss.mppdbide.common.IConnectionProvider; +import org.opengauss.mppdbide.common.VersionHelper; import org.opengauss.mppdbide.debuger.vo.VersionVo; +import org.opengauss.mppdbide.utils.VariableRunLine; import org.opengauss.mppdbide.utils.logger.MPPDBIDELoggerUtility; import java.sql.PreparedStatement; @@ -118,13 +120,25 @@ public class ServiceFactory { FunctionVo functionVo, IConnection serverConn, IConnection clientConn) { - DebugService debugService = new DebugService(); + DebugService debugService = getDebugService(clientConn); debugService.setFunctionVo(functionVo); debugService.setServerConn(serverConn); debugService.setClientConn(clientConn); return debugService; } + private static DebugService getDebugService(IConnection conn) { + try { + VariableRunLine.isPldebugger = VersionHelper.getDebuggerVersion(conn).isPldebugger(); + } catch (SQLException e) { + MPPDBIDELoggerUtility.error(e.getMessage()); + } + if (!VariableRunLine.isPldebugger) { + return new DbeDebugService(); + } + return new DebugService(); + } + private static QueryService createQueryService(IConnection conn) { QueryService queryService = new QueryService(); queryService.setFunctionDao(new FunctionDao()); diff --git a/code/datastudio/src/org.opengauss.mppdbide.debuger/src/org/opengauss/mppdbide/debuger/service/SourceCodeService.java b/code/datastudio/src/org.opengauss.mppdbide.debuger/src/org/opengauss/mppdbide/debuger/service/SourceCodeService.java index 717547e4bf1f928f963032c1c1982c93d4adecc0..57a4f516075de5ca36601c1ec653b3aecf7d81f3 100644 --- a/code/datastudio/src/org.opengauss.mppdbide.debuger/src/org/opengauss/mppdbide/debuger/service/SourceCodeService.java +++ b/code/datastudio/src/org.opengauss.mppdbide.debuger/src/org/opengauss/mppdbide/debuger/service/SourceCodeService.java @@ -17,6 +17,7 @@ package org.opengauss.mppdbide.debuger.service; import org.opengauss.mppdbide.debuger.exception.DebugPositionNotFoundException; +import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.Locale; @@ -32,6 +33,9 @@ public class SourceCodeService implements IService { * the offset of show code and base code */ public static final int CODE_BASE_OFFSET = 1; + private static final String BEGIN = "BEGIN"; + private static final String END = "END;"; + private CodeDescription baseCodeDesc = null; private CodeDescription totalCodeDesc = null; @@ -226,9 +230,71 @@ public class SourceCodeService implements IService { return Arrays.stream(srcCode.split("[\\n]")).collect(Collectors.toList()); } + /** + * get code to run lines + * + * @param srcCode the code + * @return the run line num + */ + public static List getRunLines(String srcCode) { + List totalLines = getLines(srcCode); + Boolean isStart = false; + Boolean isEnd = false; + Boolean isBegin = false; + List runLines = new ArrayList(); + for (String line : totalLines) { + if (!isStart) { + isStart = line.toUpperCase(Locale.ENGLISH).contains(BEGIN); + } + isEnd = line.toUpperCase(Locale.ENGLISH).contains(END); + if (isEnd) { + break; + } + if (isStart) { + isBegin = line.toUpperCase(Locale.ENGLISH).contains(BEGIN); + if (!isBegin) { + runLines.add(line); + } + } + } + return runLines; + } + + /** + * get line num by code + * + * @param srcCode the code + * @return the line num + */ + public static List getRunLinesNums(String srcCode) { + List totalLines = getLines(srcCode); + Boolean isStart = false; + Boolean isEnd = false; + Boolean isBegin = false; + List runLines = new ArrayList(); + Integer count = 0; + for (String line : totalLines) { + count++; + if (!isStart) { + isStart = line.toUpperCase(Locale.ENGLISH).contains(BEGIN); + } + isEnd = line.toUpperCase(Locale.ENGLISH).contains(END); + if (isEnd) { + break; + } + if (isStart) { + isBegin = line.toUpperCase(Locale.ENGLISH).contains(BEGIN); + if (!isBegin) { + runLines.add(count.toString()); + } + } + } + return runLines; + } + private int getBeginFromCode(List lines) { - for (int i = 0; i < lines.size(); i ++) { - if (lines.get(i).toUpperCase(Locale.ENGLISH).startsWith("BEGIN")) { + for (int i = 0; i < lines.size(); i++) { + if (lines.get(i).toUpperCase(Locale.ENGLISH).trim().startsWith("BEGIN")) { return i; } } diff --git a/code/datastudio/src/org.opengauss.mppdbide.debuger/src/org/opengauss/mppdbide/debuger/service/StackVoHandle.java b/code/datastudio/src/org.opengauss.mppdbide.debuger/src/org/opengauss/mppdbide/debuger/service/StackVoHandle.java new file mode 100644 index 0000000000000000000000000000000000000000..d4a302bdf7249227f4ca3770f9e7c391b794ad83 --- /dev/null +++ b/code/datastudio/src/org.opengauss.mppdbide.debuger/src/org/opengauss/mppdbide/debuger/service/StackVoHandle.java @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2022 Huawei Technologies Co.,Ltd. + * + * openGauss is licensed under Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * 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. + * See the Mulan PSL v2 for more details. + */ + +package org.opengauss.mppdbide.debuger.service; + +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.List; + +import org.opengauss.mppdbide.debuger.annotation.ParseVo; +import org.opengauss.mppdbide.debuger.vo.StackVo; +import org.opengauss.mppdbide.debuger.vo.dbe.BackTraceVo; + +/** + * Description: StackVoHandle + * + * @since 3.0.0 + */ +public class StackVoHandle implements IQueryResConvertService { + /** + * covertList + * + * @param rs the rs + * @param the type + * @return the return value + * @throws SQLException the SQL exception + */ + @Override + public List covertList(ResultSet rs) throws SQLException { + List list = new ArrayList(); + List infos = ParseVo.parseList(rs, BackTraceVo.class); + infos.forEach(item -> { + StackVo vo = new StackVo(); + vo.func = item.funcoid; + vo.linenumber = item.lineno; + vo.level = 0; + vo.targetname = item.query; + list.add((T) vo); + }); + return list; + } +} diff --git a/code/datastudio/src/org.opengauss.mppdbide.debuger/src/org/opengauss/mppdbide/debuger/service/VariableVoHandle.java b/code/datastudio/src/org.opengauss.mppdbide.debuger/src/org/opengauss/mppdbide/debuger/service/VariableVoHandle.java new file mode 100644 index 0000000000000000000000000000000000000000..eb6556c4cc349645b0dbadd210f42fbc1e2ba96b --- /dev/null +++ b/code/datastudio/src/org.opengauss.mppdbide.debuger/src/org/opengauss/mppdbide/debuger/service/VariableVoHandle.java @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2022 Huawei Technologies Co.,Ltd. + * + * openGauss is licensed under Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * 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. + * See the Mulan PSL v2 for more details. + */ + +package org.opengauss.mppdbide.debuger.service; + +import java.sql.ResultSet; +import java.util.ArrayList; +import java.util.List; + +import org.opengauss.mppdbide.debuger.annotation.ParseVo; +import org.opengauss.mppdbide.debuger.vo.VariableVo; +import org.opengauss.mppdbide.debuger.vo.dbe.VariablesVo; + +/** + * Description: VariableVoHandle + * + * @since 3.0.0 + */ +public class VariableVoHandle implements IQueryResConvertService { + /** + * covertList + * + * @param rs the rs + * @param + * @return the return value + */ + @Override + public List covertList(ResultSet rs) { + List list = new ArrayList(); + VariablesVo item = ParseVo.parse(rs, VariablesVo.class); + VariableVo vo = new VariableVo(); + vo.name = item.getVarname(); + vo.isconst = item.getIsConst(); + vo.value = item.getValue(); + vo.dtype = item.getDtype(); + list.add((T) vo); + return list; + } +} diff --git a/code/datastudio/src/org.opengauss.mppdbide.debuger/src/org/opengauss/mppdbide/debuger/vo/BreakPointListVo.java b/code/datastudio/src/org.opengauss.mppdbide.debuger/src/org/opengauss/mppdbide/debuger/vo/BreakPointListVo.java new file mode 100644 index 0000000000000000000000000000000000000000..b262b39409fff39b5235ba13b700ae05fc2b15c6 --- /dev/null +++ b/code/datastudio/src/org.opengauss.mppdbide.debuger/src/org/opengauss/mppdbide/debuger/vo/BreakPointListVo.java @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2022 Huawei Technologies Co.,Ltd. + * + * openGauss is licensed under Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * 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. + * See the Mulan PSL v2 for more details. + */ + +package org.opengauss.mppdbide.debuger.vo; + +import org.opengauss.mppdbide.debuger.annotation.DumpFiled; + +/** + * Title: class + * Description: The Class BreakPointListVo. + * + * @since 3.0.0 + */ +public class BreakPointListVo { + /** + * value of function + */ + @DumpFiled + public int breakpointno; + + /** + * value of function + */ + @DumpFiled + public Long funcoid; + + /** + * value of function + */ + @DumpFiled + public int lineno; + + /** + * value of function + */ + @DumpFiled + public String query; + + /** + * value of function + */ + @DumpFiled + public Boolean enable; +} diff --git a/code/datastudio/src/org.opengauss.mppdbide.debuger/src/org/opengauss/mppdbide/debuger/vo/BreakpointList.java b/code/datastudio/src/org.opengauss.mppdbide.debuger/src/org/opengauss/mppdbide/debuger/vo/BreakpointList.java index 294a36e36e938c3eb0b44b8941ff690d7d0d7500..677da32dc4e2ce42d56f487e04621dd6d6ac8ab6 100644 --- a/code/datastudio/src/org.opengauss.mppdbide.debuger/src/org/opengauss/mppdbide/debuger/vo/BreakpointList.java +++ b/code/datastudio/src/org.opengauss.mppdbide.debuger/src/org/opengauss/mppdbide/debuger/vo/BreakpointList.java @@ -36,6 +36,9 @@ public class BreakpointList { * @return Map the instance of BreakpointList */ public static Map getInstance() { + if (breakpointList == null) { + initialInstance(); + } return breakpointList; } diff --git a/code/datastudio/src/org.opengauss.mppdbide.debuger/src/org/opengauss/mppdbide/debuger/vo/PositionVo.java b/code/datastudio/src/org.opengauss.mppdbide.debuger/src/org/opengauss/mppdbide/debuger/vo/PositionVo.java index 7c2250faa006746c8768537df70fe254243d4a4c..27be208cf2682b0a59609ecd5488b1da4198e745 100644 --- a/code/datastudio/src/org.opengauss.mppdbide.debuger/src/org/opengauss/mppdbide/debuger/vo/PositionVo.java +++ b/code/datastudio/src/org.opengauss.mppdbide.debuger/src/org/opengauss/mppdbide/debuger/vo/PositionVo.java @@ -30,6 +30,16 @@ public class PositionVo { */ public static final String FORMAT = "%8s %20s"; + /** + * the format of this vo + */ + public Boolean isEnable; + + /** + * the format of this vo + */ + public Integer breakpointno; + /** * func of positionvo */ @@ -58,6 +68,15 @@ public class PositionVo { this.targetname = targetname; } + /** + * getBreakpointno + * + * @return breakpointno of value + */ + public Integer getBreakpointno() { + return breakpointno; + } + /** * format this vo title * diff --git a/code/datastudio/src/org.opengauss.mppdbide.debuger/src/org/opengauss/mppdbide/debuger/vo/SourceCodeVo.java b/code/datastudio/src/org.opengauss.mppdbide.debuger/src/org/opengauss/mppdbide/debuger/vo/SourceCodeVo.java index 967e572f621cf92a99d731739bb62fa115c59ced..89227aea03d3a5339a3bc6db6f1e4aad101d1782 100644 --- a/code/datastudio/src/org.opengauss.mppdbide.debuger/src/org/opengauss/mppdbide/debuger/vo/SourceCodeVo.java +++ b/code/datastudio/src/org.opengauss.mppdbide.debuger/src/org/opengauss/mppdbide/debuger/vo/SourceCodeVo.java @@ -15,7 +15,13 @@ package org.opengauss.mppdbide.debuger.vo; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + import org.opengauss.mppdbide.debuger.annotation.DumpFiled; +import org.opengauss.mppdbide.debuger.vo.dbe.InfoCodeVo; /** * Title: the SourceCodeVo class @@ -29,6 +35,8 @@ public class SourceCodeVo { @DumpFiled public String pldbg_get_source; + private List codes; + /** * get source code * @@ -37,4 +45,19 @@ public class SourceCodeVo { public String getSourceCode() { return pldbg_get_source; } + + public void setSourceCode(String sourceCode) { + this.pldbg_get_source = sourceCode; + } + + public Map getCodes() { + if (codes == null) { + return Collections.emptyMap(); + } + return codes.stream().collect(Collectors.toMap(InfoCodeVo::getLineno, InfoCodeVo::getQuery)); + } + + public void setCodes(List codes) { + this.codes = codes; + } } diff --git a/code/datastudio/src/org.opengauss.mppdbide.debuger/src/org/opengauss/mppdbide/debuger/vo/VersionVo.java b/code/datastudio/src/org.opengauss.mppdbide.debuger/src/org/opengauss/mppdbide/debuger/vo/VersionVo.java index aebe21855b3ceb9a56e44e5fbd28c5bfe0ed3a52..1bf3625a9b863a6ee72f9fe3096bae88f4bb0998 100644 --- a/code/datastudio/src/org.opengauss.mppdbide.debuger/src/org/opengauss/mppdbide/debuger/vo/VersionVo.java +++ b/code/datastudio/src/org.opengauss.mppdbide.debuger/src/org/opengauss/mppdbide/debuger/vo/VersionVo.java @@ -16,6 +16,7 @@ package org.opengauss.mppdbide.debuger.vo; import org.opengauss.mppdbide.debuger.annotation.DumpFiled; +import org.opengauss.mppdbide.debuger.debug.DebugConstants; /** * Title: VersionVo for use @@ -27,23 +28,59 @@ public class VersionVo { * this is version str */ @DumpFiled + public String version; + + /** + * this is debuggerVersion + */ + public String debuggerVersion; + + /** + * this is version str + */ public String serverversionstr; /** * this is version number */ - @DumpFiled public Integer serverversionnum; /** * this is proxy api version */ - @DumpFiled public Integer proxyapiver; /** * this is server process id */ - @DumpFiled public Long serverprocessid; + + /** + * get version + * + * @return the version string + */ + public String getDebuggerVersion() { + String versionStr = this.version; + Integer start = versionStr.indexOf("openGauss") + 9; + Integer end = versionStr.indexOf("build"); + versionStr = versionStr.substring(start, end); + versionStr = versionStr.replaceAll("\\.", "").trim(); + Integer ver = Integer.valueOf(versionStr); + if (ver < DebugConstants.DBE_DEBUGGER_MIN_VERSION) { + return DebugConstants.PL_DEBUGGER; + } else { + return DebugConstants.DBE_DEBUGGER; + } + } + + /** + * check version + * + * @return check version + */ + public boolean isPldebugger() { + this.debuggerVersion = getDebuggerVersion(); + return debuggerVersion.equalsIgnoreCase(DebugConstants.PL_DEBUGGER); + } } diff --git a/code/datastudio/src/org.opengauss.mppdbide.debuger/src/org/opengauss/mppdbide/debuger/vo/dbe/AttachVo.java b/code/datastudio/src/org.opengauss.mppdbide.debuger/src/org/opengauss/mppdbide/debuger/vo/dbe/AttachVo.java new file mode 100644 index 0000000000000000000000000000000000000000..7abe919b795daf840c034ecb4470d8fefc327afb --- /dev/null +++ b/code/datastudio/src/org.opengauss.mppdbide.debuger/src/org/opengauss/mppdbide/debuger/vo/dbe/AttachVo.java @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2022 Huawei Technologies Co.,Ltd. + * + * openGauss is licensed under Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * 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. + * See the Mulan PSL v2 for more details. + */ + +package org.opengauss.mppdbide.debuger.vo.dbe; + +import org.opengauss.mppdbide.debuger.annotation.DumpFiled; + +/** + * Title: the AttachVo class + * + * @since 3.0.0 + */ +public class AttachVo { + /** + * funcoid of function + */ + @DumpFiled + public long funcoid; + + /** + * funcname of function + */ + @DumpFiled + public String funcname; + + /** + * lineno of function + */ + @DumpFiled + public int lineno; + + /** + * query of function + */ + @DumpFiled + public String query; +} diff --git a/code/datastudio/src/org.opengauss.mppdbide.debuger/src/org/opengauss/mppdbide/debuger/vo/dbe/BackTraceVo.java b/code/datastudio/src/org.opengauss.mppdbide.debuger/src/org/opengauss/mppdbide/debuger/vo/dbe/BackTraceVo.java new file mode 100644 index 0000000000000000000000000000000000000000..4cdca62c61d3988726fc6815c64cd6f643b1557e --- /dev/null +++ b/code/datastudio/src/org.opengauss.mppdbide.debuger/src/org/opengauss/mppdbide/debuger/vo/dbe/BackTraceVo.java @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2022 Huawei Technologies Co.,Ltd. + * + * openGauss is licensed under Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * 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. + * See the Mulan PSL v2 for more details. + */ + +package org.opengauss.mppdbide.debuger.vo.dbe; + +import org.opengauss.mppdbide.debuger.annotation.DumpFiled; + +/** + * Title: the BackTraceVo class + * + * @since 3.0.0 + */ +public class BackTraceVo { + /** + * frameno of function + */ + @DumpFiled + public Integer frameno; + + /** + * funcname of function + */ + @DumpFiled + public String funcname; + + /** + * lineno of function + */ + @DumpFiled + public Integer lineno; + + /** + * query of function + */ + @DumpFiled + public String query; + + /** + * funcoid of function + */ + @DumpFiled + public long funcoid; +} diff --git a/code/datastudio/src/org.opengauss.mppdbide.debuger/src/org/opengauss/mppdbide/debuger/vo/dbe/ExportParamVo.java b/code/datastudio/src/org.opengauss.mppdbide.debuger/src/org/opengauss/mppdbide/debuger/vo/dbe/ExportParamVo.java new file mode 100644 index 0000000000000000000000000000000000000000..280085f1a2a36e2a8f4e4e90f8d92da6dc6b1502 --- /dev/null +++ b/code/datastudio/src/org.opengauss.mppdbide.debuger/src/org/opengauss/mppdbide/debuger/vo/dbe/ExportParamVo.java @@ -0,0 +1,62 @@ +/* + * Copyright (c) 2022 Huawei Technologies Co.,Ltd. + * + * openGauss is licensed under Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * 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. + * See the Mulan PSL v2 for more details. + */ + +package org.opengauss.mppdbide.debuger.vo.dbe; + +import java.util.List; +import java.util.Map; +import java.util.Set; + +/** + * Title: the InfoCodeVo class + * + * @since 3.0.0 + */ +public class ExportParamVo { + /** + * oid of function + */ + public Long oid; + + /** + * index of function + */ + public String index; + + /** + * executeSql of function + */ + public Map executeSql; + + /** + * remarkLines of function + */ + public Set remarkLines; + + /** + * coveragePassLines of function + */ + public Set coveragePassLines; + + /** + * list of function + */ + public List list; + + /** + * html of function + */ + public String html; +} diff --git a/code/datastudio/src/org.opengauss.mppdbide.debuger/src/org/opengauss/mppdbide/debuger/vo/dbe/InfoBreakPointsVo.java b/code/datastudio/src/org.opengauss.mppdbide.debuger/src/org/opengauss/mppdbide/debuger/vo/dbe/InfoBreakPointsVo.java new file mode 100644 index 0000000000000000000000000000000000000000..9e49f1d49ea932fc98a9b8c5238803a46864ddec --- /dev/null +++ b/code/datastudio/src/org.opengauss.mppdbide.debuger/src/org/opengauss/mppdbide/debuger/vo/dbe/InfoBreakPointsVo.java @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2022 Huawei Technologies Co.,Ltd. + * + * openGauss is licensed under Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * 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. + * See the Mulan PSL v2 for more details. + */ + +package org.opengauss.mppdbide.debuger.vo.dbe; + +import org.opengauss.mppdbide.debuger.annotation.DumpFiled; + +/** + * Title: the InfoBreakPointsVo class + * + * @since 3.0.0 + */ +public class InfoBreakPointsVo { + /** + * breakpointno of function + */ + @DumpFiled + public Integer breakpointno; + + /** + * funcoid of function + */ + @DumpFiled + public long funcoid; + + /** + * lineno of function + */ + @DumpFiled + public Integer lineno; + + /** + * query of function + */ + @DumpFiled + public String query; + + /** + * enable of function + */ + @DumpFiled + public Boolean enable; +} diff --git a/code/datastudio/src/org.opengauss.mppdbide.debuger/src/org/opengauss/mppdbide/debuger/vo/dbe/InfoCodeVo.java b/code/datastudio/src/org.opengauss.mppdbide.debuger/src/org/opengauss/mppdbide/debuger/vo/dbe/InfoCodeVo.java new file mode 100644 index 0000000000000000000000000000000000000000..8c34f272659fa8a0ac88a40cad35236f55b4c0df --- /dev/null +++ b/code/datastudio/src/org.opengauss.mppdbide.debuger/src/org/opengauss/mppdbide/debuger/vo/dbe/InfoCodeVo.java @@ -0,0 +1,61 @@ +/* + * Copyright (c) 2022 Huawei Technologies Co.,Ltd. + * + * openGauss is licensed under Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * 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. + * See the Mulan PSL v2 for more details. + */ + +package org.opengauss.mppdbide.debuger.vo.dbe; + +import org.opengauss.mppdbide.debuger.annotation.DumpFiled; + +/** + * Title: the InfoCodeVo class + * + * @since 3.0.0 + */ +public class InfoCodeVo { + /** + * lineno of function + */ + @DumpFiled + public Integer lineno; + + /** + * query of function + */ + @DumpFiled + public String query; + + /** + * canbreak of function + */ + @DumpFiled + public boolean canbreak; + + /** + * get lineno + * + * @return the lineno + */ + public Integer getLineno() { + return lineno; + } + + /** + * get query + * + * @return the sourceCode + */ + public String getQuery() { + return query; + } +} diff --git a/code/datastudio/src/org.opengauss.mppdbide.debuger/src/org/opengauss/mppdbide/debuger/vo/dbe/ServerInfoVo.java b/code/datastudio/src/org.opengauss.mppdbide.debuger/src/org/opengauss/mppdbide/debuger/vo/dbe/ServerInfoVo.java new file mode 100644 index 0000000000000000000000000000000000000000..d6ba830d106d74dee060cdcb56f9aac6cb240c40 --- /dev/null +++ b/code/datastudio/src/org.opengauss.mppdbide.debuger/src/org/opengauss/mppdbide/debuger/vo/dbe/ServerInfoVo.java @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2022 Huawei Technologies Co.,Ltd. + * + * openGauss is licensed under Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * 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. + * See the Mulan PSL v2 for more details. + */ + +package org.opengauss.mppdbide.debuger.vo.dbe; + +import org.opengauss.mppdbide.debuger.annotation.DumpFiled; + +/** + * Title: the ServerInfoVo class + * + * @since 3.0.0 + */ +public class ServerInfoVo { + /** + * nodename of function + */ + @DumpFiled + String nodename; + + /** + * port of function + */ + @DumpFiled + Long port; + + /** + * funcoid of function + */ + @DumpFiled + Long funcoid; +} diff --git a/code/datastudio/src/org.opengauss.mppdbide.debuger/src/org/opengauss/mppdbide/debuger/vo/dbe/TurnOnVo.java b/code/datastudio/src/org.opengauss.mppdbide.debuger/src/org/opengauss/mppdbide/debuger/vo/dbe/TurnOnVo.java new file mode 100644 index 0000000000000000000000000000000000000000..da185f6f006ee893b6857ddb9da1ac9668d715f5 --- /dev/null +++ b/code/datastudio/src/org.opengauss.mppdbide.debuger/src/org/opengauss/mppdbide/debuger/vo/dbe/TurnOnVo.java @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2022 Huawei Technologies Co.,Ltd. + * + * openGauss is licensed under Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * 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. + * See the Mulan PSL v2 for more details. + */ + +package org.opengauss.mppdbide.debuger.vo.dbe; + +import org.opengauss.mppdbide.debuger.annotation.DumpFiled; + +/** + * Title: the TurnOnVo class + * + * @since 3.0.0 + */ +public class TurnOnVo { + /** + * nodename of function + */ + @DumpFiled + public String nodename; + + /** + * port of function + */ + @DumpFiled + public int port; +} diff --git a/code/datastudio/src/org.opengauss.mppdbide.debuger/src/org/opengauss/mppdbide/debuger/vo/dbe/VariablesVo.java b/code/datastudio/src/org.opengauss.mppdbide.debuger/src/org/opengauss/mppdbide/debuger/vo/dbe/VariablesVo.java new file mode 100644 index 0000000000000000000000000000000000000000..e1ea2a438b405249cf3858b270dce8310b31dc90 --- /dev/null +++ b/code/datastudio/src/org.opengauss.mppdbide.debuger/src/org/opengauss/mppdbide/debuger/vo/dbe/VariablesVo.java @@ -0,0 +1,133 @@ +/* + * Copyright (c) 2022 Huawei Technologies Co.,Ltd. + * + * openGauss is licensed under Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * 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. + * See the Mulan PSL v2 for more details. + */ + +package org.opengauss.mppdbide.debuger.vo.dbe; + +import java.util.Map; +import java.util.Map.Entry; + +import org.opengauss.mppdbide.adapter.gauss.Datatype; +import org.opengauss.mppdbide.adapter.gauss.GaussDatatypeUtils; +import org.opengauss.mppdbide.debuger.annotation.DumpFiled; +import org.opengauss.mppdbide.debuger.debug.DebugConstants; +import org.opengauss.mppdbide.utils.logger.MPPDBIDELoggerUtility; + +/** + * Title: the VariablesVo class + * + * @since 3.0.0 + */ +public class VariablesVo { + /** + * varname of function + */ + @DumpFiled + public String varname; + + /** + * vartype of function + */ + @DumpFiled + public String vartype; + + /** + * value of function + */ + @DumpFiled + public String value; + + /** + * package_name of function + */ + @DumpFiled + public String package_name; + + /** + * isconst of function + */ + @DumpFiled + public Boolean isconst; + + /** + * dtype of function + */ + public Long dtype; + + /** + * get Dtype + * + * @return the return value + */ + public Long getDtype() { + String type = DebugConstants.getDataType(this.vartype); + if (type == null) { + MPPDBIDELoggerUtility.error("not supported type!"); + return 0L; + } + Map map = GaussDatatypeUtils.getDataTypeHashMap(); + for (Entry entry : map.entrySet()) { + if (type.equalsIgnoreCase(entry.getValue().getTypename())) { + this.dtype = Long.valueOf(entry.getKey()); + break; + } + } + return dtype; + } + + /** + * get varname + * + * @return the return value + */ + public String getVarname() { + return varname; + } + + /** + * get type + * + * @return the return value + */ + public String getVartype() { + return vartype; + } + + /** + * get value + * + * @return the return value + */ + public String getValue() { + return value; + } + + /** + * get package name + * + * @return the return value + */ + public String getPackageName() { + return package_name; + } + + /** + * get isConst + * + * @return the return value + */ + public Boolean getIsConst() { + return isconst; + } +} diff --git a/code/datastudio/src/org.opengauss.mppdbide.repository/mppdbide.product b/code/datastudio/src/org.opengauss.mppdbide.repository/mppdbide.product index 5d4a6f6a60330116e02b02b8cb869b3c5eff8307..38f9938de56df89cf6e4cb3a9d6938a39b72ba11 100644 --- a/code/datastudio/src/org.opengauss.mppdbide.repository/mppdbide.product +++ b/code/datastudio/src/org.opengauss.mppdbide.repository/mppdbide.product @@ -1,7 +1,7 @@ - + diff --git a/code/datastudio/src/org.opengauss.mppdbide.utils/META-INF/MANIFEST.MF b/code/datastudio/src/org.opengauss.mppdbide.utils/META-INF/MANIFEST.MF index 34b3e4418c4ee2d14be19364f30e837ec31ad71a..c5b38b942c93cfae1c5e36dc06b6dc7021ab22b6 100644 --- a/code/datastudio/src/org.opengauss.mppdbide.utils/META-INF/MANIFEST.MF +++ b/code/datastudio/src/org.opengauss.mppdbide.utils/META-INF/MANIFEST.MF @@ -24,7 +24,8 @@ Export-Package: ., org.opengauss.mppdbide.utils.messaging, org.opengauss.mppdbide.utils.observer, org.opengauss.mppdbide.utils.security, - org.opengauss.mppdbide.utils.stringparse + org.opengauss.mppdbide.utils.stringparse, + org.opengauss.mppdbide.utils.vo Import-Package: net.sf.jsqlparser.schema Bundle-ClassPath: ., log4j-api-2.17.1.jar, diff --git a/code/datastudio/src/org.opengauss.mppdbide.utils/src/messages.properties b/code/datastudio/src/org.opengauss.mppdbide.utils/src/messages.properties index b80200b1119005ab79aaf415c85b090f97418c05..af1785cb3731ce7e81bcd9a34b009eefa444644a 100644 --- a/code/datastudio/src/org.opengauss.mppdbide.utils/src/messages.properties +++ b/code/datastudio/src/org.opengauss.mppdbide.utils/src/messages.properties @@ -285,7 +285,7 @@ ERR_DUPLICATE_INDEX_NAME = Index name already exists. Enter different name. ERR_INDEX_COLS_EMPTY = Select at least one column. -COPYRIGHT_MSG_HUAWEI = Copyright \u00a9 2016-2020 Huawei Technologies Co. Ltd. +COPYRIGHT_MSG_HUAWEI = Copyright \u00A9 2016-2020 Huawei Technologies Co. Ltd. RIGHTS_RESERVRED_MSG_HUAWEI = All Rights Reserved. ABOUT_DATA_STUDIO_MSG= About Data Studio VERSION_NO_MSG=Version: @@ -3178,4 +3178,28 @@ CREATE_VIEW_UI_ADD = Add CREATE_VIEW_UI_DELETE = Delete CREATE_VIEW_UI_MATERVIEW = Materialized view CREATE_VIEW_UI_VIEW = View -CREATE_VIEW_UI_NAME_NOT_EMPTY = View name cann't be empty! \ No newline at end of file +CREATE_VIEW_UI_NAME_NOT_EMPTY = View name cann't be empty! +REMARK_SHORTCUT_KEY_BINDING_TOGGLE_LINE_COMMENTS=remark Line /UnRemark Line (coverage) +OID=Oid +TOTAL_LINE=Total rows +TOTAL_RUN_LINE_NUM=Total running lines +TOTAL_COVERAGE=Total Coverage +REMARK_LINE=Mark Row +REMARK_RUM_LINE_NUM=Mark execution line number +REMARK_COVERAGE=Remark Coverage +DELETE_COVERAGE=Select Delete +DELETE_COVERAGE_ALL=Delete All +EXPORT_REPORT=Export Report +SURE_EXPORT_REPORT=Are you sure you want to export coverage reports? +COVERAGE_REPORT_NOT_EXIST=Coverage report does not exist +COVERAGE_REPORT_TO_SELECT=Please select a record +COVERAGE_HISTORY_TITLE=Coverage_Report - {0} +DELETE_COVERAGE_REPORT_TITLE=Delete Stored Procedure +DELETE_SELECTED_COVERAGE_HISTORY_ALERT=Are you sure you want to delete the selected stored procedure query history for the {0} connection profile? +DELETE_ALL_COVERAGE_HISTORY_ALERT=Are you sure you want to delete the stored procedure query history for the {0} connection profile? +UPDATE_TIME=Update time +DEBUG_POSITION_LABEL_PASS=pass +DEBUG_POSITION_LABEL_FAIL=fail +COVERAGE_HINT=To view the coverage report, please execute Debug! +EXPORT_PATH = The report has been downloaded to: {0} +COVERAGE_CHECK = This version does not support this function! \ No newline at end of file diff --git a/code/datastudio/src/org.opengauss.mppdbide.utils/src/messages_zh_CN.properties b/code/datastudio/src/org.opengauss.mppdbide.utils/src/messages_zh_CN.properties index 01f4f4595fc9360ad1fcb2722aa59227a00a953b..ce94248b592aa06887c267246996156d8decce72 100644 --- a/code/datastudio/src/org.opengauss.mppdbide.utils/src/messages_zh_CN.properties +++ b/code/datastudio/src/org.opengauss.mppdbide.utils/src/messages_zh_CN.properties @@ -4,7 +4,7 @@ ENTER_CLIENT_SSLPVT_KEYFILE = \u8F93\u5165\u5BA2\u6237\u7AEFSSL\u79C1\u94A5\u658 BTN_CLIENT_PVTKEY = *.key INVALID_SSL_KEY = SSL\u5BC6\u94A5\u6587\u4EF6\u65E0\u6548 -COLUMN_DEFAULT_VALUE_EXPRESSION = \u7f3a\u7701\u8868\u8FBE\u5F0F +COLUMN_DEFAULT_VALUE_EXPRESSION = \u7F3A\u7701\u8868\u8FBE\u5F0F MULTISORT_POPUP_WINDOW_TITLE = \u591A\u5217\u6392\u5E8F COLUMN_PRIORITY = \u4F18\u5148\u7EA7 COLUMN_COLUMN_NAME = \u5217\u540D @@ -214,7 +214,7 @@ STATUS_MSG_ADD_COLUMN = \u6DFB\u52A0\u5217... STATUS_MSG_ADD_CONSTRAINT = \u6DFB\u52A0\u7EA6\u675F... -STATUS_MSG_SET_COLUMN_DEFAULT_VALUE = \u8BBE\u7F6E\u7f3a\u7701\u503C... +STATUS_MSG_SET_COLUMN_DEFAULT_VALUE = \u8BBE\u7F6E\u7F3A\u7701\u503C... STATUS_MSG_ANALYSE_TABLE = \u5206\u6790\u8868... @@ -270,7 +270,7 @@ ERR_DUPLICATE_INDEX_NAME = \u7D22\u5F15\u540D\u79F0\u5DF2\u7ECF\u5B58\u5728.\u8B ERR_INDEX_COLS_EMPTY = \u8BF7\u81F3\u5C11\u9009\u62E9\u4E00\u5217. -COPYRIGHT_MSG_HUAWEI = \u7248\u6743\u6240\u6709 \u00a9 \u534E\u4E3A\u6280\u672F\u6709\u9650\u516C\u53F82016-2020\u3002 +COPYRIGHT_MSG_HUAWEI = \u7248\u6743\u6240\u6709 \u00A9 \u534E\u4E3A\u6280\u672F\u6709\u9650\u516C\u53F82016-2020\u3002 RIGHTS_RESERVRED_MSG_HUAWEI = \u4FDD\u7559\u4E00\u5207\u6743\u5229\u3002 ABOUT_DATA_STUDIO_MSG= \u5173\u4E8E Data Studio VERSION_NO_MSG=\u7248\u672C: @@ -394,7 +394,7 @@ RENAME_TABLE_TO= \u5DF2\u5C06{0}\u8868\u91CD\u547D\u540D\u4E3A {1}.{2}\u3002 RENAME_TABLE_NEW=\u4E3A\u6A21\u5F0F\u4E2D\u7684{0}\u5206\u533A\u8868\u8F93\u5165\u65B0\u540D\u79F0 RENAME_TABLE_TITLE=\u91CD\u547D\u540D -RENAME_TRIGGER_WAIT =\u91CD\u547D\u540D{0}\u89e6\u53d1\u5668\uFF0C\u6B63\u5728\u5904\u7406\u4E2D... +RENAME_TRIGGER_WAIT =\u91CD\u547D\u540D{0}\u89E6\u53D1\u5668\uFF0C\u6B63\u5728\u5904\u7406\u4E2D... SET_COLUMN_TOGGLE_TITLE=\u5207\u6362\u975E\u7A7A\u5C5E\u6027 SET_COLUMN_TOGGLE_MSG=\u60A8\u786E\u5B9A\u8981\u5207\u6362{0}\u5217\u4E3A\u975E\u7A7A\u5C5E\u6027\uFF1F @@ -437,7 +437,7 @@ EXEC_PLAN_OK=\u786E\u5B9A SET_TABLESPACE=\u8868\u7A7A\u95F4 SET_TABLE_FROM_TABLESPACE=\u8BE5\u8868\u5DF2\u4ECE {0}\u79FB\u52A8\u5230{1}.{2}\u3002 -SET_TABLE_FROM_TABLESPACE_NULL=\u8be5\u8868 {0} \u5df2\u4ece {1} \u79fb\u52a8\u5230 {2} +SET_TABLE_FROM_TABLESPACE_NULL=\u8BE5\u8868 {0} \u5DF2\u4ECE {1} \u79FB\u52A8\u5230 {2} SET_TABLESPACE_TITLE=\u8BBE\u7F6E\u8868\u7A7A\u95F4 SET_TABLESPACE_IN=\u8BF7\u4E3A\u8868{0}.{1}\u9009\u62E9\u4E00\u4E2A\u65B0\u7684\u8868\u7A7A\u95F4 TRUNCATE_TABLE_TITLE=\u622A\u65AD @@ -571,7 +571,7 @@ INDEX_UI_ADD_TO=\u589E\u52A0\u7D22\u5F15 INDEX_UI_REMOVE=\u4ECE\u7D22\u5F15\u4E2D\u5220\u9664 INDEX_UI_MOVE_UP=\u5347\u7EA7 INDEX_UI_MOVE_DOWN=\u964D\u7EA7 -INDEX_UI_TYPE=\u7d22\u5f15\u7c7b\u578b +INDEX_UI_TYPE=\u7D22\u5F15\u7C7B\u578B INDEX_UI_ACCESS_METHOD=\u8BBF\u95EE\u65B9\u5F0F INDEX_UI_TABLESPACE=\u8868\u7A7A\u95F4 @@ -605,7 +605,7 @@ CREATE_TABLE_CONSTRAINT_MSG= \u8BF7\u9009\u62E9\u5217\u7EA6\u675F\u6216\u68C0\u6 CREATE_TABLE_CONST_EDIT_MSG= \u8BF7\u4ECE\u8868\u4E2D\u9009\u62E9\u81F3\u5C11\u4E00\u4E2A\u7EA6\u675F\u7F16\u8F91 CREATE_TABLE_CONST_DELETE= \u8BF7\u4ECE\u8868\u4E2D\u9009\u62E9\u81F3\u5C11\u4E00\u4E2A\u7EA6\u675F\u5220\u9664 CREATE_TABLE_VALID_NAME= \u8BF7\u8F93\u5165\u6709\u6548\u7684\u5217\u540D -CREATE_TABLE_COLUMN_EXISTS = {0} \u5217\u5df2\u5b58\u5728\u3002 +CREATE_TABLE_COLUMN_EXISTS = {0} \u5217\u5DF2\u5B58\u5728\u3002 CREATE_TABLE_NO_CLM_MSG= \u60A8\u8FD8\u6CA1\u6709\u9009\u62E9\u4EFB\u4F55\u5217\u6216\u6CA1\u6709\u66F4\u591A\u7684\u884C\u53EF\u79FB\u52A8 CREATE_TABLE_FINISH_BTN=\u5B8C\u6210 CREATE_TABLE_NEXT_BTN=\u4E0B\u4E00\u6B65 @@ -749,7 +749,7 @@ ERROR_DURING_SCHEMA_CREATION = \u521B\u5EFA\u6A21\u5F0F\u65F6\u51FA\u9519\uFF1A DATABASE_DISCONNECT = \u65AD\u5F00\u8FDE\u63A5\u786E\u8BA4 DISCONNECT_CONFIRMATION = \u786E\u5B9A\u8981\u65AD\u5F00''{0}''\u5417\uFF1F \ \n\ - \u8BF4\u660E: \u65ad\u5f00\u6570\u636e\u5e93\u8fde\u63a5\u53ef\u80fd\u4f1a\u53d6\u6d88\u6240\u6709\u6b63\u5728\u8fdb\u884c\u7684\u6570\u636e\u5e93\u64cd\u4f5c\u3002 + \u8BF4\u660E: \u65AD\u5F00\u6570\u636E\u5E93\u8FDE\u63A5\u53EF\u80FD\u4F1A\u53D6\u6D88\u6240\u6709\u6B63\u5728\u8FDB\u884C\u7684\u6570\u636E\u5E93\u64CD\u4F5C\u3002 DISCONNECTED_FROM_SERVER = \u5DF2\u65AD\u5F00\u6570\u636E\u5E93\u8FDE\u63A5\uFF1A {0}.{1} @@ -816,16 +816,16 @@ UNABLE_TO_ADD_CONS = \u65E0\u6CD5\u6DFB\u52A0\u65B0\u7684\u7EA6\u675F.{0}\u670D\ ERR_WHILE_STNG_COL_VAL = \u8BBE\u7F6E\u5217\u7F3A\u7701\u503C\u65F6\u51FA\u9519 PLS_ENTER_TABLE_FOR_CONS = = \u8BF7\u9009\u62E9\u7EA6\u675F\u5F15\u7528\u5217 -CUURENT_DFLT_VAL = \u5F53\u524D\u7f3a\u7701\u503C\uFF1A{0} -CUURENT_DFLT_VALUE=\u7f3a\u7701\u503C\uFF1A +CUURENT_DFLT_VAL = \u5F53\u524D\u7F3A\u7701\u503C\uFF1A{0} +CUURENT_DFLT_VALUE=\u7F3A\u7701\u503C\uFF1A CONSTRAINT_TYPE=\u7EA6\u675F\u7C7B\u578B CONSTRAINT_NAME=\u7EA6\u675F\u540D CONSTRAINT_DESC=\u8BF7\u9009\u62E9\u81F3\u5C11\u4E00\u5217\u4F5C\u4E3A\u5916\u952E\u5F15\u7528 CONSTRAINT_SELECTED_COLUMNS=\u9009\u5B9A\u7684\u5217 -DATA_TYPE_CONVERSION_TIP = \u63d0\u793a\uff1a\u501f\u52a9\u9690\u5f0f\u7c7b\u578b\u8f6c\u6362\uff0c\u6709\u4e9b\u7c7b\u578b\u8f6c\u6362\u53ef\u80fd\u4f1a\u5931\u8d25 +DATA_TYPE_CONVERSION_TIP = \u63D0\u793A\uFF1A\u501F\u52A9\u9690\u5F0F\u7C7B\u578B\u8F6C\u6362\uFF0C\u6709\u4E9B\u7C7B\u578B\u8F6C\u6362\u53EF\u80FD\u4F1A\u5931\u8D25 UPDATE_DATA_TYPE = \u66F4\u6539\u6570\u636E\u7C7B\u578B TYPE_DES = \u7C7B\u578B\u8BF4\u660E -CURRENT_DATA_TYPE = {0}\u5217\u5f53\u524d\u6570\u636e\u7c7b\u578b: {1} +CURRENT_DATA_TYPE = {0}\u5217\u5F53\u524D\u6570\u636E\u7C7B\u578B: {1} CHANGE_DATA_TYPE_FOR_COL =\u5DF2\u4FEE\u6539\u8BE5\u5217\u7684\u6570\u636E\u7C7B\u578B\uFF1A{0}.{1}.{2} ERR_CHANGE_DTYPE = \u9519\u8BEF - \u66F4\u6539\u6570\u636E\u7C7B\u578B @@ -847,13 +847,13 @@ CONSTRAINT_ON_TABLESPACE= \u5728\u8868\u7A7A\u95F4 CONSTRAINT_DEFERABLE=\u5EF6\u8FDF ARRAY_DIMENSIONS = \u9635\u5217\u7EF4\u5EA6 CHECK_COLUMN_UI =\u68C0\u67E5 -DFLT_CLM_UI =\u7f3a\u7701 +DFLT_CLM_UI =\u7F3A\u7701 ON_DELETE = \u5220\u9664 REF_COL = \u5F15\u7528\u5217 ADD_NEW_CONSTRAINT =\u6DFB\u52A0\u65B0\u7EA6\u675F -EDIT_CONSTRAINT =\u7f16\u8f91\u7ea6\u675f -ALTER_COLUMN_SHELL_TEXT=\u4e3a {0}.{1}.{2}\u8bbe\u7f6e\u7f3a\u7701\u503c +EDIT_CONSTRAINT =\u7F16\u8F91\u7EA6\u675F +ALTER_COLUMN_SHELL_TEXT=\u4E3A {0}.{1}.{2}\u8BBE\u7F6E\u7F3A\u7701\u503C EDIT_CONSTRAINT_LABEL=\u5F53\u524D\u8868\u8FBE\u5F0F: CONSTRAINT_INITIALLY_DEFERRED= \u521D\u59CB\u5316\u5EF6\u8FDF CONSTRAINT_FILL_FACTOR=\u586B\u5145\u56E0\u5B50 @@ -864,9 +864,9 @@ AVL_COL = \u53EF\u7528\u5217 CONSTRAINT_EXPRESSION=\u8BF7\u8F93\u5165\u68C0\u67E5\u7EA6\u675F\u7684\u8868\u8FBE\u5F0F CONSTRAINT_CHECK_EXPRESSION=\u68C0\u67E5\u8868\u8FBE\u5F0F -CONSTRAINT_FOREIGN_NAMESPACE =\u547d\u540d\u7a7a\u95f4 -CONSTRAINT_FOREIGE_TABLENAME =\u8868\u540d\u79f0 -CONSTRAINT_FOREIGE_COLUMNNAME =\u5217\u540d +CONSTRAINT_FOREIGN_NAMESPACE =\u547D\u540D\u7A7A\u95F4 +CONSTRAINT_FOREIGE_TABLENAME =\u8868\u540D\u79F0 +CONSTRAINT_FOREIGE_COLUMNNAME =\u5217\u540D NEW_NONAME_CONSTRAINT_CREATED = \u5DF2\u5C06\u65B0\u7EA6\u675F\u6DFB\u52A0\u5230\u8BE5\u8868\uFF1A {0}.{1} NEW_CONSTRAINT_CREATED = \u5DF2\u521B\u5EFA\u7EA6\u675F\uFF1A {0}.{1}.{2} @@ -884,7 +884,7 @@ SQL_PREVIEW=SQL\u9884\u89C8 OID_MSG=OID NAME_MSG=\u540D\u79F0 ENCODING_MSG=\u5B57\u7B26\u7F16\u7801 -ALLOW_CON=\u662f\u5426\u5141\u8bb8\u8fde\u63a5 +ALLOW_CON=\u662F\u5426\u5141\u8BB8\u8FDE\u63A5 CONNECTION_LIMIT=\u8FDE\u63A5\u6570\u9650\u5236 DFLT_TBSPACE=\u9ED8\u8BA4\u8868\u7A7A\u95F4 COLLECTION_MSG=\u6392\u5E8F\u89C4\u5219 @@ -946,14 +946,14 @@ INDEXES_NAME = \u7D22\u5F15 TITLE_IMPORT_TBL_DATA =\u5BFC\u5165\u8868\u6570\u636E MSG_IMPORT_SUCCESS =\u5DF2\u5BFC\u5165\u6570\u636E\u5230\u8BE5\u8868\uFF1A {0}.{1} -MSG_TOTAL_ROWS_IMPORT = \u5bfc\u5165\u7684\u603b\u8bb0\u5f55\u6570\uff1a{0} +MSG_TOTAL_ROWS_IMPORT = \u5BFC\u5165\u7684\u603B\u8BB0\u5F55\u6570\uFF1A{0} ERR_IMPORT_TABLE_TO_CSV=\u9519\u8BEF\u5728\u5BFC\u5165\u8868\u6570\u636E\u3002 ERR_IMPORT_TABLE_TO_CSV_HANDLER = \u5BFC\u5165\u8868\u6570\u636E\u9519\u8BEF{0}{1} STATUS_MSG_IMPORT_TABLE_DATA = \u5BFC\u5165\u8868\u6570\u636E... BTN_OK = \u786E\u5B9A BTN_CANCEL = \u53D6\u6D88 -BTN_CLEAR = \u6e05\u7a7a +BTN_CLEAR = \u6E05\u7A7A MSG_DO_NOT_SHOW_AGAIN =\u4E0D\u518D\u663E\u793A TITLE_DISCLAIMER = Data Studio \u5B89\u5168\u8B66\u544A @@ -981,7 +981,7 @@ GUI_NEWDBCONNECTION_OPEN_CONNECTION_WIZARD=\u7528\u6237\u624B\u518C... CIPHER_EXPIRE_CONFIRMATION = \u5BC6\u7801\u8FC7\u671F\u4FE1\u606F CIPHER_EXPIRED = \u5BC6\u7801\u5DF2\u8FC7\u671F\u3002\u8BF7\u8054\u7CFB\u7BA1\u7406\u5458\u66F4\u6539\u5BC6\u7801\u3002 -CIPHER_YET_TO_EXPIRE = \u8be5\u5bc6\u7801\u5c06\u5728 {0} \u5929\u540e\u8fc7\u671f\u3002\u8bf7\u66f4\u6539\u5bc6\u7801\u3002 +CIPHER_YET_TO_EXPIRE = \u8BE5\u5BC6\u7801\u5C06\u5728 {0} \u5929\u540E\u8FC7\u671F\u3002\u8BF7\u66F4\u6539\u5BC6\u7801\u3002 MSG_LOADED = \u52A0\u8F7D @@ -1067,7 +1067,7 @@ RESULT_WINDOW_TEXT_CELL_INVISIBLE_VALUE_BODY=\u6570\u636E\u91CF\u592A\u5927\uFF0 EXPORT_CSV_STAR = \u5BFC\u51FA\u6240\u6709\u6570\u636E EXPORT_CSV = \u5BFC\u51FA\u5F53\u524D\u9875\u6570\u636E EXPORT_EXEC = \u5BFC\u51FA\u6267\u884C\u8BA1\u5212 -CLEAR_CONSOLE = \u6e05\u9664 +CLEAR_CONSOLE = \u6E05\u9664 MENU_OPEN = \u6253\u5F00 MENU_SAVE = \u4FDD\u5B58 @@ -1155,13 +1155,13 @@ SET_VIEW_SCHEMA_SUCCESS = \u8BE5\u89C6\u56FE\u5DF2\u4ECE{0}.{1}\u79FB\u52A8\u523 SET_VIEW_SCHEMA = \u8BBE\u7F6E\u6A21\u5F0F SET_VIEW_MESSAGE = \u4E3A\u89C6\u56FE {0}.{1}\u8BBE\u7F6E\u65B0\u6A21\u5F0F -SET_VIEW_SCHEMA_FAILURE = \u65e0\u6cd5\u4e3a\u89c6\u56fe {0}{1}\u8bbe\u7f6e\u6a21\u5f0f\uff0c\u670d\u52a1\u5668\u9519\u8bef\u4fe1\u606f\uff1a{2} +SET_VIEW_SCHEMA_FAILURE = \u65E0\u6CD5\u4E3A\u89C6\u56FE {0}{1}\u8BBE\u7F6E\u6A21\u5F0F\uFF0C\u670D\u52A1\u5668\u9519\u8BEF\u4FE1\u606F\uFF1A{2} SET_VIEW_SCHEMA_MOVING=\u79FB\u52A8 {0} \u89C6\u56FE\u5230 {1} \u6A21\u5F0F. \u8BF7\u7B49\u5F85... DROP_VIEW_CONFIRM_TITLE = \u5220\u9664\u89C6\u56FE DROP_VIEW_CONFIRM_MSG = \u4F60\u786E\u5B9A\u8981\u5220\u9664 ''{0}'' \u89C6\u56FE? DROP_VIEW_CASCADE_CONFIRM_MSG=\u4F60\u786E\u5B9A\u8981\u5220\u9664 ''{0}'' \u89C6\u56FE\u4EE5\u53CA\u548C\u5B83\u76F8\u5173\u8054\u7684? -VIEW_COLUMN_SET_DEFAULT_TITLE = \u4E3A {0}.{1}.{2}\u8BBE\u7F6E\u7f3a\u7701\u503C +VIEW_COLUMN_SET_DEFAULT_TITLE = \u4E3A {0}.{1}.{2}\u8BBE\u7F6E\u7F3A\u7701\u503C SET_VIEW_COL_DEFAULT_STATUS_BAR=\u8BBE\u7F6E\u89C6\u56FE\u5217\u9ED8\u8BA4\u503C CONSOLE_TAB = \u6D88\u606F @@ -1221,7 +1221,7 @@ PROFILE_NAME = \u914D\u7F6E\u6587\u4EF6\u72B6\u6001 UNPIN_SQL =\u89E3\u9501SQL SQL_HISTORY = \u5386\u53F2\u6267\u884CSQL SQL_HISTORY_TOOL_TRIP = \u5386\u53F2\u6267\u884CSQL -SQL_HISTORY_DISABLED_TOOL_TIP = SQL\u6267\u884c\u5386\u53f2-\u8fde\u63a5\u4fe1\u606f\u672a\u52a0\u8f7d\u3002 +SQL_HISTORY_DISABLED_TOOL_TIP = SQL\u6267\u884C\u5386\u53F2-\u8FDE\u63A5\u4FE1\u606F\u672A\u52A0\u8F7D\u3002 SQL_HISTORY_TITLE = \u5386\u53F2\u6267\u884CSQL - {0} HISTORY_LOADING_IN_PROGRESS_TILTLE=\u6B63\u5728\u52A0\u8F7D\u5386\u53F2\u8BB0\u5F55 CONN_PROFILE_ERROR_MSG=\u52A0\u8F7D\u7A0B\u5E8F\u6587\u4EF6:{0}\u65F6\u51FA\u9519\ . \u7A0B\u5E8F\u6587\u4EF6\u5DF2\u4ECE\u7A0B\u5E8F\u6587\u4EF6\u5217\u8868\u4E2D\u79FB\u9664 @@ -1242,10 +1242,10 @@ HELP_LABEL = \u5E2E\u52A9 TABLESPACE_NAME=\u540D\u79F0* TABLESPACE_RELATIVE_PATH=\u76F8\u5BF9\u8DEF\u5F84 -TABLESPACE_LOCATION=\u4f4d\u7f6e* -TABLESPACE_MAXSIZE=\u6700\u5927\u5b58\u50a8\u5bb9\u91cf -TABLESPACE_SEQCOST=\u987a\u5e8f\u78c1\u76d8\u9875\u9762\u5f00\u9500 -TABLESPACE_RANCOST=\u975e\u987a\u5e8f\u78c1\u76d8\u9875\u9762\u5f00\u9500 +TABLESPACE_LOCATION=\u4F4D\u7F6E* +TABLESPACE_MAXSIZE=\u6700\u5927\u5B58\u50A8\u5BB9\u91CF +TABLESPACE_SEQCOST=\u987A\u5E8F\u78C1\u76D8\u9875\u9762\u5F00\u9500 +TABLESPACE_RANCOST=\u975E\u987A\u5E8F\u78C1\u76D8\u9875\u9762\u5F00\u9500 TABLESPACE_UNSUPPORTED_SERVER_VERSION=\u670D\u52A1\u5668\u7248\u672C\u4E0D\u652F\u6301 TABLESPACE_GENERAL=General TABLE_EDIT_MESSAGE=\u5F53\u524D\u6B63\u5728\u7F16\u8F91\u5217\u3002\u5B8C\u6210\u6216\u53D6\u6D88\u7F16\u8F91\u64CD\u4F5C\u540E\u624D\u80FD\u6267\u884C\u5176\u4ED6\u64CD\u4F5C\u3002 @@ -1400,8 +1400,8 @@ SHOW_TABLE_DDL_CANCELING=\u5DF2\u53D6\u6D88\u663E\u793ADDL\uFF1A {0}.{1} ERR_PARTITION_COLUMN_EMPTY=\u8BF7\u521B\u5EFA\u5206\u533A\u5217\u4EE5\u7EE7\u7EED\u64CD\u4F5C\u3002 ERR_PARTITION_NAME_EMPTY=\u5206\u533A\u540D\u4E0D\u80FD\u4E3A\u7A7A\u3002 ERR_PARTITION_VALUE_EMPTY=\u5206\u533A\u503C\u4E0D\u80FD\u4E3A\u7A7A\u3002 -ERR_PARTITION_INTERVAL_VALUE_EMPTY=\u5206\u533a\u95f4\u9694\u503c\u4e0d\u80fd\u4e3a\u7a7a -ERR_PARTITION_INTERVAL_COLUMN_TYPE=\u95f4\u9694\u5206\u533a\u5217\u7c7b\u578b\u5e94\u4e3a\u65f6\u95f4\u7c7b\u578b +ERR_PARTITION_INTERVAL_VALUE_EMPTY=\u5206\u533A\u95F4\u9694\u503C\u4E0D\u80FD\u4E3A\u7A7A +ERR_PARTITION_INTERVAL_COLUMN_TYPE=\u95F4\u9694\u5206\u533A\u5217\u7C7B\u578B\u5E94\u4E3A\u65F6\u95F4\u7C7B\u578B ERR_DUPLICATE_PARTITION_NAME=\u5206\u533A\u540D\u79F0\u5DF2\u5B58\u5728\u3002\u8BF7\u8F93\u5165\u5176\u4ED6\u540D\u79F0\u3002 ERR_PREFIX_DB_MESSAGE=\u9519\u8BEF\uFF1A @@ -1431,7 +1431,7 @@ CIPHER_EDIT_MESSAGE=\u6709\u5206\u533A\u6B63\u5728\u7F16\u8F91\u4E2D\u3002\u5B8C PARTITION_GROUP_NAME=\u5206\u533A PARTITION_TAB_ORIENTATION=\u5B58\u50A8\u65B9\u5F0F PARTITION_TAB_TYPE=\u5206\u533A\u7C7B\u578B -PARTITION_TAB_INTERVAL_PARTITION_EXPR=\u95f4\u9694\u503c +PARTITION_TAB_INTERVAL_PARTITION_EXPR=\u95F4\u9694\u503C PARTITION_TAB_PARTITION_BY_RANGE=\u6309\u7C7B\u578B\u5206\u533A PARTITION_TAB_AVAILABLE_COLUMN=\u53EF\u7528\u5217 PARTITION_TAB_PARTITION_COLUMN=\u5206\u533A\u5217 @@ -1776,11 +1776,11 @@ PREFERENCE_SHORTCUT_KEY_BINDING_SEARCH_DESC= \u641C\u7D22\u5BF9\u8C61 PREFERENCE_RESTART_REQUIRED_MSG=\u5DF2\u66F4\u6539\u9996\u9009\u9879\u3002\u8BF7\u91CD\u542FData Studio\u4EE5\u4F7F\u66F4\u6539\u751F\u6548\u3002 COLUMN_OLD_NAME ={1}.{2}\u8868\u4E2D\u7684{0}\u5217 -CIPHER_EXPIRY_TITLE = \u5bc6\u7801\u8fc7\u671f\u524d\u0037\u5929\u662f\u5426\u5141\u8bb8\u767b\u5f55\u6570\u636e\u5e93 -YES_EXPIRY_OPTION=\u5141\u8bb8\u767b\u5f55 -NO_EXPIRY_OPTION = \u4e0d\u5141\u8bb8\u767b\u5f55 -CIPHER_EXPIRY_MSG_TITLE=\u5bc6\u7801\u5373\u5c06\u8fc7\u671f -CIPHER_EXPIRY_INFORMATION = \u5bc6\u7801\u5c06\u8981\u8fc7\u671f\uff0c\u67d0\u4e9b\u64cd\u4f5c\u53ef\u80fd\u53d7\u5230\u9650\u5236\u3002\u8bf7\u8054\u7cfb\u7ba1\u7406\u5458\u91cd\u7f6e\u5bc6\u7801\u3002 +CIPHER_EXPIRY_TITLE = \u5BC6\u7801\u8FC7\u671F\u524D7\u5929\u662F\u5426\u5141\u8BB8\u767B\u5F55\u6570\u636E\u5E93 +YES_EXPIRY_OPTION=\u5141\u8BB8\u767B\u5F55 +NO_EXPIRY_OPTION = \u4E0D\u5141\u8BB8\u767B\u5F55 +CIPHER_EXPIRY_MSG_TITLE=\u5BC6\u7801\u5373\u5C06\u8FC7\u671F +CIPHER_EXPIRY_INFORMATION = \u5BC6\u7801\u5C06\u8981\u8FC7\u671F\uFF0C\u67D0\u4E9B\u64CD\u4F5C\u53EF\u80FD\u53D7\u5230\u9650\u5236\u3002\u8BF7\u8054\u7CFB\u7BA1\u7406\u5458\u91CD\u7F6E\u5BC6\u7801\u3002 RESULT_WINDOW_EDITTABLE_COMMIT_SUCCESS=\u6210\u529F\uFF1A{0} {1} {2} {3} RESULT_WINDOW_EDITTABLE_COMMIT_FAILURE=/\u5931\u8D25\uFF1A{0} @@ -1849,9 +1849,9 @@ CONNECT_DB_CANCEL_MSG=\u5DF2\u6839\u636E\u7528\u6237\u8BF7\u6C42\u53D6\u6D88\u65 DB_ASSISTANT_LANGUAGE=zh_CN -DB_ASSISTANT_NAME=SQL\u52a9\u624b -DB_ASSISTANT_ENABLE=\u5f00\u542f -DB_ASSISTANT_DISABLE=\u5173\u95ed +DB_ASSISTANT_NAME=SQL\u52A9\u624B +DB_ASSISTANT_ENABLE=\u5F00\u542F +DB_ASSISTANT_DISABLE=\u5173\u95ED DB_ASSIST_ENABLE_DESC=SQL\u52A9\u624B\u4E3ASQL\u7EC8\u7AEF\u548C\u5B58\u50A8\u8FC7\u7A0B/\u51FD\u6570\u7EC8\u7AEF\u4E2D\u8F93\u5165\u7684\u4FE1\u606F\u63D0\u4F9B\u5EFA\u8BAE\u6216\u53C2\u8003\u3002 DB_ASSIST_DISABLE_DESC=SQL\u52A9\u624B\u4E0D\u4E3ASQL\u7EC8\u7AEF\u548C\u5B58\u50A8\u8FC7\u7A0B/\u51FD\u6570\u7EC8\u7AEF\u4E2D\u8F93\u5165\u7684\u4FE1\u606F\u63D0\u4F9B\u5EFA\u8BAE\u6216\u53C2\u8003\u3002 @@ -2324,18 +2324,18 @@ OBJECT_NAME_MORE_THAN_LIMIT_ERROR_MESSAGE= \u8868\u3001\u5217\u3001\u7EA6\u675F\ MAX_CHARATCTERS_ALLOWED_FOR_TABLE_DESC=\u8868\u63CF\u8FF0\u6700\u591A\u53EF\u5305\u542B5000\u4E2A\u5B57\u7B26\u3002 #debug -PREFERENCE_SHORTCUT_KEY_BINDING_START_DEBUG=\u542f\u52a8\u8c03\u8bd5 -PREFERENCE_SHORTCUT_KEY_BINDING_TERNIMATE_DEBUG=\u505c\u6b62\u8c03\u8bd5 -PREFERENCE_SHORTCUT_KEY_BINDING_STEPIN_DEBUG=\u6b65\u5165 -PREFERENCE_SHORTCUT_KEY_BINDING_STEPOUT_DEBUG=\u6b65\u51fa -PREFERENCE_SHORTCUT_KEY_BINDING_STEPOVER_DEBUG=\u6b65\u8fdb -PREFERENCE_SHORTCUT_KEY_BINDING_CONTINUE_DEBUG=\u7ee7\u7eed -KEY_BINDING_COMMENTS_DESC_START_DEBUG = \u542f\u52a8\u8c03\u8bd5 -KEY_BINDING_COMMENTS_DESC_TERNIMATE_DEBUG =\u505c\u6b62\u8c03\u8bd5 -KEY_BINDING_COMMENTS_DESC_STEPIN_DEBUG =\u6b65\u5165 -KEY_BINDING_COMMENTS_DESC_STEPOUT_DEBUG = \u6b65\u51fa -KEY_BINDING_COMMENTS_DESC_STEPOVER_DEBUG =\u6b65\u8fdb -KEY_BINDING_COMMENTS_DESC_CONTINUE_DEBUG =\u7ee7\u7eed +PREFERENCE_SHORTCUT_KEY_BINDING_START_DEBUG=\u542F\u52A8\u8C03\u8BD5 +PREFERENCE_SHORTCUT_KEY_BINDING_TERNIMATE_DEBUG=\u505C\u6B62\u8C03\u8BD5 +PREFERENCE_SHORTCUT_KEY_BINDING_STEPIN_DEBUG=\u6B65\u5165 +PREFERENCE_SHORTCUT_KEY_BINDING_STEPOUT_DEBUG=\u6B65\u51FA +PREFERENCE_SHORTCUT_KEY_BINDING_STEPOVER_DEBUG=\u6B65\u8FDB +PREFERENCE_SHORTCUT_KEY_BINDING_CONTINUE_DEBUG=\u7EE7\u7EED +KEY_BINDING_COMMENTS_DESC_START_DEBUG = \u542F\u52A8\u8C03\u8BD5 +KEY_BINDING_COMMENTS_DESC_TERNIMATE_DEBUG =\u505C\u6B62\u8C03\u8BD5 +KEY_BINDING_COMMENTS_DESC_STEPIN_DEBUG =\u6B65\u5165 +KEY_BINDING_COMMENTS_DESC_STEPOUT_DEBUG = \u6B65\u51FA +KEY_BINDING_COMMENTS_DESC_STEPOVER_DEBUG =\u6B65\u8FDB +KEY_BINDING_COMMENTS_DESC_CONTINUE_DEBUG =\u7EE7\u7EED #PreservSQL Messages PRESERVESQL_STARTUP_DIALOG_MESSAGE=\u6B63\u5728\u52A0\u8F7D\u81EA\u52A8\u4FDD\u5B58\u7684\u67E5\u8BE2\u3001\u51FD\u6570\u548C\u8FC7\u7A0B\u2026 @@ -2402,7 +2402,7 @@ FUNCT_CHANGE_ERR_COMPILE_BACKEND=\u51FD\u6570/\u8FC7\u7A0B\u5DF2\u88AB\u5220\u96 #TRANSLATIONS FOR TEMP TABLE SUPPORT SQL_TERMINAL_REUSE_CONNECTION_TOOLTIP = \u91CD\u7528\u8FDE\u63A5\uFF1A\u542F\u7528\n\u7528\u6237\u5728\u6B64\u7EC8\u7AEF\u8FDB\u884C\u64CD\u4F5C\uFF08\u5237\u65B0\u7ED3\u679C\u96C6\u3001\u5BFC\u51FA\u6570\u636E\u3001\u63D0\u4EA4\u66F4\u6539\u7B49\uFF09\u65F6\uFF0C\u91CD\u7528SQL\u7EC8\u7AEF\u4E2D\u7684\u6570\u636E\u5E93\u8FDE\u63A5\u3002 -SQL_TERMINAL_NEW_CONNECTION_TOOLTIP = \u91cd\u7528\u4f7f\u7528\u8fde\u63a5\uff1a\u5173\u95ed\u000d\u000a\u7528\u6237\u5728\u6b64\u7ec8\u7aef\u8fdb\u884c\u64cd\u4f5c\uff08\u5237\u65b0\u7ed3\u679c\u96c6\u3001\u5bfc\u51fa\u6570\u636e\u3001\u63d0\u4ea4\u66f4\u6539\u7b49\uff09\u65f6\uff0c\u521b\u5efa\u5e76\u4f7f\u7528\u65b0\u7684\u6570\u636e\u5e93\u8fde\u63a5\u3002 +SQL_TERMINAL_NEW_CONNECTION_TOOLTIP = \u91CD\u7528\u4F7F\u7528\u8FDE\u63A5\uFF1A\u5173\u95ED\u000d\u000a\u7528\u6237\u5728\u6B64\u7EC8\u7AEF\u8FDB\u884C\u64CD\u4F5C\uFF08\u5237\u65B0\u7ED3\u679C\u96C6\u3001\u5BFC\u51FA\u6570\u636E\u3001\u63D0\u4EA4\u66F4\u6539\u7B49\uFF09\u65F6\uFF0C\u521B\u5EFA\u5E76\u4F7F\u7528\u65B0\u7684\u6570\u636E\u5E93\u8FDE\u63A5\u3002 MPPDBIDE_DIA_BTN_RECONNECT=\u91CD\u65B0\u8FDE\u63A5 MPPDBIDE_DIA_BTN_RECONNECT_CONTINUE=\u91CD\u65B0\u8FDE\u63A5\u5E76\u6267\u884C MULTIPLE_CONNECTION_ATTEMPT_ON_CRITICAL_ERROR=\u7531\u4E8E\u591A\u6B21\u5C1D\u8BD5\u540E\u4ECD\u65E0\u6CD5\u5EFA\u7ACB\u8FDE\u63A5\uFF0C\u5BF9\u8C61\u6D4F\u89C8\u5668\u5DF2\u4E0E\u6570\u636E\u5E93\u65AD\u8FDE\u3002\u8BF7\u91CD\u65B0\u8FDE\u63A5\u5E76\u91CD\u8BD5\u3002 @@ -2513,7 +2513,7 @@ USER_ROLE_REPLICATION = \u590D\u5236 USER_ROLE_CAN_LOGIN = \u53EF\u767B\u5F55 USER_ROLE_SYSTEM_ADMIN = \u7CFB\u7EDF\u7BA1\u7406\u5458 USER_ROLE_RESOURCE_POOL = \u8D44\u6E90\u6C60 -USER_ROLE_COMMENT = \u63cf\u8ff0\uff08\u6700\u591a\u0034\u0030\u0030\u0030\u4e2a\u5b57\u7b26\uff09 +USER_ROLE_COMMENT = \u63CF\u8FF0\uFF08\u6700\u591A4000\u4E2A\u5B57\u7B26\uFF09 USER_ROLE_COMMENT_ERROR_MESSAGE=\u7528\u6237/\u89D2\u8272\u63CF\u8FF0\u6700\u591A\u53EF\u5305\u542B4000\u4E2A\u5B57\u7B26\u3002 USER_ROLE_PROPERTY_TAB_GENERAL = \u901A\u7528 USER_ROLE_PROPERTY_TAB_PRIVILEGE = \u6743\u9650 @@ -2557,58 +2557,58 @@ EXPORT_ALL_DATA_NOT_ENOUGH_SPACE = \u78C1\u76D8\u7A7A\u95F4\u4E0D\u8DB3 USER_ROLE_PREVIEW_SQL_CHANGE_NOTHING = \u6CA1\u6709\u8981\u4FDD\u5B58\u7684\u66F4\u6539\u3002STATUS_MSG_MODIFYING_OBJECT_PRIVILEGE = \u6B63\u5728\u4FEE\u6539\u5BF9\u8C61\u6743\u9650... ERR_USER_ROLE_CONNECT_LIMIT_INVALID = \u201C\u8FDE\u63A5\u9650\u5236\u201D\u4E2D\u4EC5\u80FD\u8F93\u5165\u6574\u6570\u3002 PARTIAL_SUCCESS_UPDATE_OBJECT_PRIVILEGE_DETAIL = \u5DF2\u6210\u529F\u6388\u4E88/\u64A4\u6D88\u5BF9\u8C61\u6743\u9650\u3002\u53EF\u5355\u51FB\u201C\u8BE6\u7EC6\u4FE1\u606F\u201D\u67E5\u770B\u8BE6\u60C5\u3002 -CREATE_NEW_ROLE = \u521b\u5efa\u7528\u6237\u002f\u89d2\u8272 -CREATE_USERROLE_FINISH_BTN = \u5b8c\u6210 -CREATE_USERROLE_NEXT_BTN = \u4e0b\u4e00\u6b65 -CREATE_USERROLE_BACK_BTN = \u4e0a\u4e00\u6b65 -CREATE_USERROLE_CANCEL_BTN = \u53d6\u6d88 -CREATE_USERROLE_ENTER_NM = \u8f93\u5165\u7528\u6237\u002f\u89d2\u8272\u540d\u79f0 -CREATE_USERROLE_NAME_INVALID = \u7528\u6237\u002f\u89d2\u8272\u540d\u79f0\u65e0\u6548 -CREATE_USERROLE_NAME_EXCEED_MAX = \u7528\u6237\u002f\u89d2\u8272\u540d\u79f0\u6700\u591a\u53ef\u5305\u542b\u0036\u0033\u4e2a\u5b57\u7b26 -CREATE_USERROLE_ENTER_PAS = \u8f93\u5165\u5bc6\u7801 - -CREATE_USERROLE_CREATE_ERROR = \u521b\u5efa\u7528\u6237\u002f\u89d2\u8272\u65f6\u51fa\u9519: {0} -USER_ROLE_NM_PAS = \u7528\u6237\u002f\u89d2\u8272\u5c5e\u6027 -CREATE_USERROLE_NAME = \u540d\u79f0 -CREATE_USERROLE_CIPHER = \u5bc6\u7801 +CREATE_NEW_ROLE = \u521B\u5EFA\u7528\u6237/\u89D2\u8272 +CREATE_USERROLE_FINISH_BTN = \u5B8C\u6210 +CREATE_USERROLE_NEXT_BTN = \u4E0B\u4E00\u6B65 +CREATE_USERROLE_BACK_BTN = \u4E0A\u4E00\u6B65 +CREATE_USERROLE_CANCEL_BTN = \u53D6\u6D88 +CREATE_USERROLE_ENTER_NM = \u8F93\u5165\u7528\u6237/\u89D2\u8272\u540D\u79F0 +CREATE_USERROLE_NAME_INVALID = \u7528\u6237/\u89D2\u8272\u540D\u79F0\u65E0\u6548 +CREATE_USERROLE_NAME_EXCEED_MAX = \u7528\u6237/\u89D2\u8272\u540D\u79F0\u6700\u591A\u53EF\u5305\u542B63\u4E2A\u5B57\u7B26 +CREATE_USERROLE_ENTER_PAS = \u8F93\u5165\u5BC6\u7801 + +CREATE_USERROLE_CREATE_ERROR = \u521B\u5EFA\u7528\u6237/\u89D2\u8272\u65F6\u51FA\u9519: {0} +USER_ROLE_NM_PAS = \u7528\u6237/\u89D2\u8272\u5C5E\u6027 +CREATE_USERROLE_NAME = \u540D\u79F0 +CREATE_USERROLE_CIPHER = \u5BC6\u7801 CREATE_USERROLE_PRIVILEGE = \u6743\u9650 -CREATE_USERROLE_SYSADMIN = \u7cfb\u7edf\u7ba1\u7406\u5458 -CREATE_USERROLE_AUDITADMIN = \u5ba1\u8ba1\u7ba1\u7406\u5458 -CREATE_USERROLE_CREATEDB = \u521b\u5efa\u6570\u636e\u5e93 -CREATE_USERROLE_CREATEROLE = \u521b\u5efa\u89d2\u8272 -CREATE_USERROLE_INHERIT = \u7ee7\u627f -CREATE_USERROLE_LOGIN = \u767b\u5f55 -CREATE_USERROLE_REPLICATION = \u590d\u5236 -USER_ROLE_PRIVILEGE_OPTION = \u9ad8\u7ea7 -CREATE_USERROLE_CONNECT_LIMIT = \u8fde\u63a5\u9650\u5236 -CREATE_USERROLE_VALID_BEGIN = \u5f00\u59cb\u65e5\u671f -CREATE_USERROLE_VALID_UNTIL = \u7ed3\u675f\u65e5\u671f -CREATE_USERROLE_RES_POOL = \u8d44\u6e90\u6c60 -CREATE_USERROLE_ROLE_GROUP_MEMBER = \u89d2\u8272\u7ec4 -CREATE_USERROLE_ADMIN_GROUP_MEMBER = \u7ba1\u7406\u5458\u7ec4 +CREATE_USERROLE_SYSADMIN = \u7CFB\u7EDF\u7BA1\u7406\u5458 +CREATE_USERROLE_AUDITADMIN = \u5BA1\u8BA1\u7BA1\u7406\u5458 +CREATE_USERROLE_CREATEDB = \u521B\u5EFA\u6570\u636E\u5E93 +CREATE_USERROLE_CREATEROLE = \u521B\u5EFA\u89D2\u8272 +CREATE_USERROLE_INHERIT = \u7EE7\u627F +CREATE_USERROLE_LOGIN = \u767B\u5F55 +CREATE_USERROLE_REPLICATION = \u590D\u5236 +USER_ROLE_PRIVILEGE_OPTION = \u9AD8\u7EA7 +CREATE_USERROLE_CONNECT_LIMIT = \u8FDE\u63A5\u9650\u5236 +CREATE_USERROLE_VALID_BEGIN = \u5F00\u59CB\u65E5\u671F +CREATE_USERROLE_VALID_UNTIL = \u7ED3\u675F\u65E5\u671F +CREATE_USERROLE_RES_POOL = \u8D44\u6E90\u6C60 +CREATE_USERROLE_ROLE_GROUP_MEMBER = \u89D2\u8272\u7EC4 +CREATE_USERROLE_ADMIN_GROUP_MEMBER = \u7BA1\u7406\u5458\u7EC4 CREATE_USERROLE_CREATE_SUCCESS = \u5DF2\u521B\u5EFA\u7528\u6237/\u89D2\u8272: {0} -DROP_ROLE_DIA_TITLE = \u5220\u9664\u7528\u6237\u002f\u89d2\u8272 -DROP_ROLE = \u786e\u5b9a\u8981\u5220\u9664\u7528\u6237\u002f\u89d2\u8272{0}\u5417? -DROP_USERROLE_PROGRESS_NAME = \u6b63\u5728\u5220\u9664\u7528\u6237\u002f\u89d2\u8272: {0}@{1} -DROP_USERROLE_SUCCESS = \u5df2\u5220\u9664\u7528\u6237\u002f\u89d2\u8272: {0} -CREATE_USERROLE_NO_PRIVILEGE = \u65e0\u7279\u6743 -CREATE_USERROLE_NO_PRIVILEGE_CREATE = \u60a8\u65e0\u6743\u521b\u5efa\u65b0\u7528\u6237\u6216\u89d2\u8272\u3002 -ENTER_ROLE_NAME = \u8f93\u5165\u7528\u6237\u002f\u89d2\u8272\u540d\u79f0 -ENTER_CIPHER = \u8f93\u5165\u5bc6\u7801 +DROP_ROLE_DIA_TITLE = \u5220\u9664\u7528\u6237/\u89D2\u8272 +DROP_ROLE = \u786E\u5B9A\u8981\u5220\u9664\u7528\u6237/\u89D2\u8272{0}\u5417? +DROP_USERROLE_PROGRESS_NAME = \u6B63\u5728\u5220\u9664\u7528\u6237/\u89D2\u8272: {0}@{1} +DROP_USERROLE_SUCCESS = \u5DF2\u5220\u9664\u7528\u6237/\u89D2\u8272: {0} +CREATE_USERROLE_NO_PRIVILEGE = \u65E0\u7279\u6743 +CREATE_USERROLE_NO_PRIVILEGE_CREATE = \u60A8\u65E0\u6743\u521B\u5EFA\u65B0\u7528\u6237\u6216\u89D2\u8272\u3002 +ENTER_ROLE_NAME = \u8F93\u5165\u7528\u6237/\u89D2\u8272\u540D\u79F0 +ENTER_CIPHER = \u8F93\u5165\u5BC6\u7801 CREATE_USERROLE_PAS_NOT_MATCH = \u4E24\u6B21\u8F93\u5165\u7684\u5BC6\u7801\u4E0D\u4E00\u81F4 -ENTER_CIPHER_TWICE = \u518d\u6b21\u8f93\u5165\u5bc6\u7801 +ENTER_CIPHER_TWICE = \u518D\u6B21\u8F93\u5165\u5BC6\u7801 CREATE_USERROLE_ALL = \u6240\u6709 -CREATE_USERROLE_SSL_NOT_ENABLE = \u8fde\u63a5\u4e0d\u5b89\u5168\uff0c\u56e0\u4e3a\u0053\u0053\u004c\u5df2\u7981\u7528\u3002 -PRIVILEGE_ADVANCED = \u9ad8\u7ea7 -STATUS_MSG_DROP_ROLE = \u6b63\u5728\u5220\u9664\u7528\u6237\u002f\u89d2\u8272\u002e\u002e\u002e -DROP_USERROLE_ERROR = \u5220\u9664\u7528\u6237\u002f\u89d2\u8272 -DROP_USERROLE_UNABLE = \u65e0\u6cd5\u5220\u9664\u7528\u6237\u002f\u89d2\u8272\u3002 +CREATE_USERROLE_SSL_NOT_ENABLE = \u8FDE\u63A5\u4E0D\u5B89\u5168\uFF0C\u56E0\u4E3ASSL\u5DF2\u7981\u7528\u3002 +PRIVILEGE_ADVANCED = \u9AD8\u7EA7 +STATUS_MSG_DROP_ROLE = \u6B63\u5728\u5220\u9664\u7528\u6237/\u89D2\u8272... +DROP_USERROLE_ERROR = \u5220\u9664\u7528\u6237/\u89D2\u8272 +DROP_USERROLE_UNABLE = \u65E0\u6CD5\u5220\u9664\u7528\u6237/\u89D2\u8272\u3002 DROP_USERROLE_UNABLE_MSG = \u5220\u9664\u7528\u6237/\u89D2\u8272\u65F6\u51FA\u9519: {0}@{1} EXPORT_ALL_DATA_DISABLE_TOOLTIP=\u5BF9EXPLAIN\u67E5\u8BE2\u7981\u7528 CREATE_USER=\u7528\u6237 -CREATE_ROLE=\u89d2\u8272 +CREATE_ROLE=\u89D2\u8272 UNKNOW_CLOB_TYPE= \u672A\u77E5\u7C7B\u578B @@ -2667,7 +2667,7 @@ EDIT_TABLE_PROPERTIES_DATA_DROPPED_REFRESH_ERROR=\u7F16\u8F91\u65F6\u53D1\u751F\ DATA_TOO_LARGE_DISPLAY_EDIT =\u6570\u636E\u91CF\u592A\u5927\uFF0C\u65E0\u6CD5\u5B8C\u6574\u663E\u793A\u3002\n\u8BF7\u62F7\u8D1D\u5355\u5143\u683C\u6570\u636E\u5230\u5176\u4ED6\u7F16\u8F91\u5668\u8FDB\u884C\u67E5\u770B\u6216\u4FEE\u6539\u3002\n\u6570\u636E\u4FEE\u6539\u5B8C\u4E4B\u540E\u9700\u8981\u91CD\u65B0\u62F7\u8D1D\u56DE\u5355\u5143\u683C\u3002 DATA_TOO_LARGE_WARNING =\u6570\u636E\u957F\u5EA6\u8B66\u544A -NEW_OBJECT_WILL_BE_OPENED=\u65b0\u51fd\u6570\u002f\u8fc7\u7a0b\u5c06\u88ab\u6253\u5f00 +NEW_OBJECT_WILL_BE_OPENED=\u65B0\u51FD\u6570/\u8FC7\u7A0B\u5C06\u88AB\u6253\u5F00 CURSOR_IMPLEMENT_DIALOG_TITLE = \u67E5\u8BE2\u6267\u884C CURSOR_IMPLEMENT_DIALOG_HEADER = \u5F53\u524D\u7279\u5B9A\u67E5\u8BE2\u7ED3\u679C\u4E0D\u652F\u6301\u5206\u9875\uFF0C\u786E\u8BA4\u8981\u7EE7\u7EED\u5417\uFF1F @@ -2721,7 +2721,7 @@ SELECT_SHORTCUT_KEY_AGAIN="\u4E2D\u4F7F\u7528,\u8BF7\u91CD\u65B0\u9009\u62E9! SHORTCUT_KEY_DUPLICATE=\u5FEB\u6377\u952E\u91CD\u590D EXECUTE_DEBUGE= \u51FD\u6570\u6267\u884C -WRITE_HERE = \u8bf7\u5728\u4e0b\u65b9\u8f93\u5165\uff1a +WRITE_HERE = \u8BF7\u5728\u4E0B\u65B9\u8F93\u5165\uFF1A PARAMETER_INPUT_TABLE_PARAM_NAME_COLUMN = \u53C2\u6570\u540D PARAMETER_INPUT_TABLE_PARAM_TYPE_COLUMN = \u6570\u636E\u7C7B\u578B @@ -2745,7 +2745,7 @@ IMPORT_CONN_PROFILE_KEEP_BOTH_FILES_LBL=\u590D\u5236\uFF0C\u4F46\u4FDD\u7559\u4E IMPORT_CONN_PROFILE_DONT_CPY_LBL=\u4E0D\u590D\u5236 IMPORT_CONN_PROFILE_CONFLICTS_LBL=\u6240\u6709\u51B2\u7A81\u6267\u884C\u8BE5\u64CD\u4F5C -IMPORT_PROFILE_INCORRECT_FILE =\u65E0\u6548\u7684\u6587\u4EF6\u683C\u5F0F, \u8bf7\u5bfc\u5165\u6b63\u786e\u7684\u8fde\u63a5\u914d\u7f6e\u6587\u4ef6\u3002 +IMPORT_PROFILE_INCORRECT_FILE =\u65E0\u6548\u7684\u6587\u4EF6\u683C\u5F0F, \u8BF7\u5BFC\u5165\u6B63\u786E\u7684\u8FDE\u63A5\u914D\u7F6E\u6587\u4EF6\u3002 IMPORT_CONNECTIONS_PROFILE_INVALID_FORMAT_EXCEPTION=\u5BFC\u5165\u8FDE\u63A5\u914D\u7F6E\u6587\u4EF6\u65F6\u53D1\u751F\u5F02\u5E38 PROCESS_TIMEOUT_ERROR=\u8FDB\u7A0B\u8D85\u65F6 \n\u8BF7\u67E5\u770B\u9996\u9009\u9879\u7A97\u53E3\uFF08\u8BBE\u7F6E > \u9996\u9009\u9879 > \u5BFC\u5165/\u5BFC\u51FA > \u5BFC\u51FADDL\uFF09\uFF0C\u589E\u5927\u8BE5\u8FDB\u7A0B\u7684\u8D85\u65F6\u8BBE\u7F6E\u3002 @@ -2790,7 +2790,7 @@ IMPORT_EXCEL_CHAR = \u5B57\u7B26\u683C\u5F0F: IMPORT_RESULT_INVALID_CONNECTION = \u5BFC\u5165\u7ED3\u679C\u6570\u636E\u7684\u8FDE\u63A5\u65E0\u6548\uFF0C\u65E0\u6CD5\u7EE7\u7EED\u5BFC\u5165\u636E\u6570\u3002 ENCODING_NOTE = \u6CE8\u610F\uFF1A\u8BF7\u9009\u62E9\u4E0E\u5BFC\u5165\u6587\u4EF6\u6570\u636E\u76F8\u540C\u7684\u7F16\u7801\u683C\u5F0F\uFF0C\u5426\u5219\u53EF\u80FD\u5BFC\u81F4\u5BFC\u5165\u5931\u8D25\uFF0C\u6216\u8005\u5BFC\u5165\u6570\u636E\u4E71\u7801\u3002 OPTION_ZIP= \uFF08.zip\uFF09 -COMPRESS_FAIL_DAILOG_TITLE = \u6570\u636e\u538b\u7f29\u5931\u8d25 +COMPRESS_FAIL_DAILOG_TITLE = \u6570\u636E\u538B\u7F29\u5931\u8D25 COMPRESS_FAILED = \u538B\u7F29\u5931\u8D25 SQL_DDL_EXPORT_WINDOW_TITLE = \u5BFC\u51FA\u5BF9\u8C61\u5B9A\u4E49 SQL_DDL_DATA_EXPORT_WINDOW_TITLE = \u5BFC\u51FA\u8868\u5B9A\u4E49\u548C\u6570\u636E @@ -2847,7 +2847,7 @@ FILTER_INTIAL_TEXT=\u8BF7\u8F93\u5165\u8FC7\u6EE4\u6761\u4EF6\uFF0C\u6309\u56DE\ ERR_IMPORT_DATE_FORMAT = \u65F6\u95F4\u683C\u5F0F\u9519\u8BEF\uFF0C\u8BF7\u91CD\u65B0\u8F93\u5165\u3002 ERR_IMPORT_DATA_FILE = \u5BFC\u5165\u6587\u4EF6\u4E0D\u5B58\u5728 -FILTER_CLEAR_TOOLTIP=\u6e05\u7a7a +FILTER_CLEAR_TOOLTIP=\u6E05\u7A7A ERR_IMPORT_DIFF_FILE_FORMAT = \u5BFC\u5165\u6587\u4EF6\u683C\u5F0F\u4E0E\u6240\u9009\u683C\u5F0F\u4E0D\u540C LOCALE_CHANGE_APP_EXIT_MSG=\u6240\u6709\u7684\u8FDE\u63A5\u5C06\u88AB\u5173\u95ED\uFF0C\u6240\u6709\u672A\u4FDD\u5B58\u7684\u6570\u636E\u90FD\u5C06\u4E22\u5931\u3002\u4F60\u786E\u5B9A\u8981\u9000\u51FA\u5417? @@ -2861,28 +2861,28 @@ LOADED_DATA =\u6570\u636E\u52A0\u8F7D\u5B8C\u6210 FILE_SIZE_EXCEEDED_FOUR =\u6587\u4EF6\u5927\u5C0F\u8D85\u8FC74 MB\uFF0C\u6CA1\u6709\u9884\u89C8\u53EF\u7528 # view ER diagram -ER_JOB_DETAILS = \u751f\u6210\u0045\u0052\u56fe\u67e5\u8be2 +ER_JOB_DETAILS = \u751F\u6210ER\u56FE\u67E5\u8BE2 -ER_ERROR_POPUP_HEADER = \u0045\u0052\u56fe\u9519\u8bef -ER_DESC_PRIMARYKEY = \u4e3b\u952e -ER_DESC_FOREIGNKEY = \u5916\u952e -ER_DESC_CURRENT_COLOR = \u5f53\u524d\u8868 +ER_ERROR_POPUP_HEADER = ER\u56FE\u9519\u8BEF +ER_DESC_PRIMARYKEY = \u4E3B\u952E +ER_DESC_FOREIGNKEY = \u5916\u952E +ER_DESC_CURRENT_COLOR = \u5F53\u524D\u8868 ER_DESC_RELATED_COLOR = \u5173\u8054\u8868 -ER_VIEW_FAILED = \u67e5\u770b\u0045\u0052\u56fe\u5931\u8d25 -ER_VIEW_FAILED_MSG = \u67e5\u770b\u0045\u0052\u56fe\u5931\u8d25: {0} +ER_VIEW_FAILED = \u67E5\u770BER\u56FE\u5931\u8D25 +ER_VIEW_FAILED_MSG = \u67E5\u770BER\u56FE\u5931\u8D25: {0} ER_VIEW_INSUFFICIENT_PRIVILEGES_MSG = \u6743\u9650\u4E0D\u8DB3\uFF0C\u65E0\u6CD5\u67E5\u770BER\u56FE\u3002 \ \n\u8BF7\u6267\u884Cgrant select on SYS.SYS_CONSTRAINT_DEFS to \u83B7\u53D6\u6743\u9650\u4EE5\u67E5\u770BER -VIEW_STYLES = \u663e\u793a\u6837\u5f0f -SHOW_ICONS = \u663e\u793a\u56fe\u6807 -SHOW_DATA_TYPES = \u663e\u793a\u6570\u636e\u7c7b\u578b -SHOW_NULLABILITY = \u663e\u793a\u662f\u5426\u4e3a\u7a7a -SHOW_COMMENTS = \u663e\u793a\u6ce8\u91ca\u4fe1\u606f -SHOW_FULLY_QUALIFIED_NAMES = \u663e\u793a\u5168\u9650\u5b9a\u540d\u79f0 -SHOW_ATTRIBUTES = \u663e\u793a\u6570\u636e\u884c -ATTRIBUTE_VIS_ALL = \u6240\u6709\u6570\u636e\u884c -ATTRIBUTE_VIS_ANY_KEY = \u4efb\u610f\u952e\u6570\u636e -ATTRIBUTE_VIS_PRIMARY_KEY = \u4e3b\u952e\u6570\u636e -ATTRIBUTE_VIS_NONE = \u4e0d\u663e\u793a\u6570\u636e +VIEW_STYLES = \u663E\u793A\u6837\u5F0F +SHOW_ICONS = \u663E\u793A\u56FE\u6807 +SHOW_DATA_TYPES = \u663E\u793A\u6570\u636E\u7C7B\u578B +SHOW_NULLABILITY = \u663E\u793A\u662F\u5426\u4E3A\u7A7A +SHOW_COMMENTS = \u663E\u793A\u6CE8\u91CA\u4FE1\u606F +SHOW_FULLY_QUALIFIED_NAMES = \u663E\u793A\u5168\u9650\u5B9A\u540D\u79F0 +SHOW_ATTRIBUTES = \u663E\u793A\u6570\u636E\u884C +ATTRIBUTE_VIS_ALL = \u6240\u6709\u6570\u636E\u884C +ATTRIBUTE_VIS_ANY_KEY = \u4EFB\u610F\u952E\u6570\u636E +ATTRIBUTE_VIS_PRIMARY_KEY = \u4E3B\u952E\u6570\u636E +ATTRIBUTE_VIS_NONE = \u4E0D\u663E\u793A\u6570\u636E ERR_TEMPLATE_LOAD_FAILURE_TITLE=\u6A21\u677F\u52A0\u8F7D\u5931\u8D25 PREF_LOAD_ERROR_TITLE=\u9996\u9009\u9879\u52A0\u8F7D\u5931\u8D25 @@ -2899,7 +2899,7 @@ OBJECT_NAME = \u5BF9\u8C61\u540D\u79F0 REPLACE_IF_EXIST = \u66FF\u6362\u5982\u679C\u5B58\u5728 SYNONYM_NAME_ENTER_NM = \u8BF7\u8F93\u5165\u540C\u4E49\u8BCD\u540D\u79F0 -SYNONYM_NAME_EXCEED_MAX = \u540C\u4E49\u8BCD\u540D\u79F0\u6700\u591A\u53EF\u5305\u542B\u0036\u0034\u4E2A\u5B57\u7B26 +SYNONYM_NAME_EXCEED_MAX = \u540C\u4E49\u8BCD\u540D\u79F0\u6700\u591A\u53EF\u5305\u542B64\u4E2A\u5B57\u7B26 OBJECT_OWNER_SELECT_NM = \u8BF7\u9009\u62E9\u5BF9\u8C61\u6240\u6709\u8005 OBJECT_NAME_SELECT_NM = \u8BF7\u9009\u62E9\u5BF9\u8C61\u540D\u79F0 CREATED_SYNONYM_SUCESS = \u5DF2\u521B\u5EFA\u540C\u4E49\u8BCD\uFF1A {0}.{1} @@ -2911,7 +2911,7 @@ STATUS_MSG_DROP_SYNONYM = \u6B63\u5728\u5220\u9664\u540C\u4E49\u8BCD... DROP_SYNONYM_PROGRESS_NAME = \u6B63\u5728\u5220\u9664\u540C\u4E49\u8BCD: {0}@{1} DROP_SYNONYM_SUCCESS = \u5DF2\u5220\u9664\u540C\u4E49\u8BCD\uFF1A{0}.{1} DROP_SYNONYM_ERROR = \u5220\u9664\u540C\u4E49\u8BCD\u65F6\u51FA\u9519\uFF1A{0}.{1} -DROP_SYNONYM_UNABLE = \u65e0\u6cd5\u5220\u9664\u540C\u4E49\u8BCD\u3002 +DROP_SYNONYM_UNABLE = \u65E0\u6CD5\u5220\u9664\u540C\u4E49\u8BCD\u3002 PROPERTIES_SYNONYM_NAME = \u540C\u4E49\u8BCD\u540D\u79F0 PROPERTIES_SYNONYM_OWNER = \u6A21\u5F0F PROPERTIES_OBJECT_OWNER = \u5BF9\u8C61\u6240\u6709\u8005 @@ -2919,7 +2919,7 @@ PROPERTIES_OBJECT_NAME = \u5BF9\u8C61\u540D\u79F0 #OLTP Synonyms end # Triggers start -TRIGGER_GROUP_NAME = \u89e6\u53d1\u5668 +TRIGGER_GROUP_NAME = \u89E6\u53D1\u5668 #Triggers end # DS Commandline parameter support start @@ -3063,98 +3063,122 @@ INVALID_LINE_SEPERATOR=\u73AF\u5883\u53D8\u91CF\u4E2D\u8BBE\u7F6E\u4E86\u65E0\u6 ERROR_WHILE_FETCHING_OWNER_NAME=\u83B7\u53D6\u6570\u636E\u5E93\u5BF9\u8C61\u7684\u6240\u6709\u8005\u540D\u79F0\u65F6\u51FA\u9519 ERR_WHILE_FETCHING_SEQ_VALUE=\u8BFB\u53D6\u5E8F\u5217\u6570\u636E\u65F6\u51FA\u9519 -BREAKPOINT_ANNOTATION_LABEL=\u65ad\u70b9 +BREAKPOINT_ANNOTATION_LABEL=\u65AD\u70B9 DEBUG_POSITION_LABEL=\u8C03\u8BD5\u4F4D\u7F6E -DEBUG_TABLE_ORDER = \u5e8f\u53f7 -DEBUG_STACK_INVOKING_LEVEL = \u8c03\u7528\u5c42\u7ea7 -DEBUG_STACK_FUNCTION_INFO = \u51fd\u6570\u4fe1\u606f -DEBUG_STACK_CURRENT_LINE_NUM = \u5f53\u524d\u884c\u53f7 -DEBUG_BREAKPOINT_LINE_NUM = \u884c\u53f7 -DEBUG_BREAKPOINT_STATEMENT = \u8bed\u53e5 -DEBUG_BREAKPOINT_ENABLE= \u4f7f\u80fd -DEBUG_VARIABLE_VARIABLE = \u53d8\u91cf -DEBUG_VARIABLE_VALUE = \u503c -DEBUG_VARIABLE_DATA_TYPE = \u6570\u636e\u7c7b\u578b -DEBUG_VARIABLE_PARAM_TYPE = \u53c2\u6570\u7c7b\u578b -DEBUG_NOT_SUPPORT_WARN = \u670d\u52a1\u7aef\u4e0d\u652f\u6301\u8c03\u8bd5! -DEBUG_PREFREENCE_ID = \u8c03\u8bd5 -DEBUG_PREFREENCE_WHEN_ROLLBACK = \u8c03\u8bd5\u540e\u81ea\u52a8\u56de\u6eda - -CREATE_FUNCTION_UI_CREATE_FUNCTION = \u521b\u5efa\u51fd\u6570 -CREATE_FUNCTION_UI_CREATE_PROCEDURE = \u521b\u5efa\u5b58\u50a8\u8fc7\u7a0b -CREATE_FUNCTION_UI_SQL_PREVIEW= \u0053\u0051\u004c\u9884\u89c8 -CREATE_FUNCTION_UI_SCHEMA = \u6a21\u5f0f\u0028\u002a\u0029 -CREATE_FUNCTION_UI_FUNCTION_NAME = \u51fd\u6570\u540d\u0028\u002a\u0029 -CREATE_FUNCTION_UI_FUNCTION = \u51fd\u6570 -CREATE_FUNCTION_UI_PROCEDURE = \u5b58\u50a8\u8fc7\u7a0b -CREATE_FUNCTION_UI_LANGUAGE = \u8bed\u8a00\u0028\u002a\u0029 -CREATE_FUNCTION_UI_RETURN_TYPE = \u8fd4\u56de\u503c\u7c7b\u578b -CREATE_FUNCTION_UI_PARAM_LIST = \u53c2\u6570\u5217\u8868 -CREATE_FUNCTION_UI_BUTTON_RESET = \u91cd\u7f6e -CREATE_FUNCTION_UI_BUTTON_ADD = \u6dfb\u52a0 +DEBUG_TABLE_ORDER = \u5E8F\u53F7 +DEBUG_STACK_INVOKING_LEVEL = \u8C03\u7528\u5C42\u7EA7 +DEBUG_STACK_FUNCTION_INFO = \u51FD\u6570\u4FE1\u606F +DEBUG_STACK_CURRENT_LINE_NUM = \u5F53\u524D\u884C\u53F7 +DEBUG_BREAKPOINT_LINE_NUM = \u884C\u53F7 +DEBUG_BREAKPOINT_STATEMENT = \u8BED\u53E5 +DEBUG_BREAKPOINT_ENABLE= \u4F7F\u80FD +DEBUG_VARIABLE_VARIABLE = \u53D8\u91CF +DEBUG_VARIABLE_VALUE = \u503C +DEBUG_VARIABLE_DATA_TYPE = \u6570\u636E\u7C7B\u578B +DEBUG_VARIABLE_PARAM_TYPE = \u53C2\u6570\u7C7B\u578B +DEBUG_NOT_SUPPORT_WARN = \u670D\u52A1\u7AEF\u4E0D\u652F\u6301\u8C03\u8BD5! +DEBUG_PREFREENCE_ID = \u8C03\u8BD5 +DEBUG_PREFREENCE_WHEN_ROLLBACK = \u8C03\u8BD5\u540E\u81EA\u52A8\u56DE\u6EDA + +CREATE_FUNCTION_UI_CREATE_FUNCTION = \u521B\u5EFA\u51FD\u6570 +CREATE_FUNCTION_UI_CREATE_PROCEDURE = \u521B\u5EFA\u5B58\u50A8\u8FC7\u7A0B +CREATE_FUNCTION_UI_SQL_PREVIEW= SQL\u9884\u89C8 +CREATE_FUNCTION_UI_SCHEMA = \u6A21\u5F0F(*) +CREATE_FUNCTION_UI_FUNCTION_NAME = \u51FD\u6570\u540D(*) +CREATE_FUNCTION_UI_FUNCTION = \u51FD\u6570 +CREATE_FUNCTION_UI_PROCEDURE = \u5B58\u50A8\u8FC7\u7A0B +CREATE_FUNCTION_UI_LANGUAGE = \u8BED\u8A00(*) +CREATE_FUNCTION_UI_RETURN_TYPE = \u8FD4\u56DE\u503C\u7C7B\u578B +CREATE_FUNCTION_UI_PARAM_LIST = \u53C2\u6570\u5217\u8868 +CREATE_FUNCTION_UI_BUTTON_RESET = \u91CD\u7F6E +CREATE_FUNCTION_UI_BUTTON_ADD = \u6DFB\u52A0 CREATE_FUNCTION_UI_BUTTON_DELETE= \u5220\u9664 -CREATE_FUNCTION_UI_FUNCTION_BODY = \u51fd\u6570\u4f53\u0028\u002a\u0029 -CREATE_FUNCTION_UI_BUTTON_NEXT = \u4e0b\u4e00\u6b65 -CREATE_FUNCTION_UI_BUTTON_CANCEL = \u53d6\u6d88 -CREATE_FUNCTION_UI_BUTTON_BACK = \u4e0a\u4e00\u6b65 -CREATE_FUNCTION_UI_BUTTON_NO_COMPILE = \u4e0d\u7f16\u8bd1 -CREATE_FUNCTION_UI_BUTTON_COMPILE = \u7f16\u8bd1 -CREATE_FUNCTION_UI_PARAM_NAME = \u540d\u79f0 -CREATE_FUNCTION_UI_PARAM_MODE = \u6a21\u5f0f -CREATE_FUNCTION_UI_PARAM_TYPE = \u7c7b\u578b -CREATE_FUNCTION_UI_PARAM_DEFAULT = \u9ed8\u8ba4\u503c -CREATE_FUNCTION_UI_TOOLTIP_NO_COMPILE = \u8FDB\u5165Data Studio\u7EC8\u7AEF\uFF0C\u4F46\u4E0D\u81ea\u52a8\u7F16\u8BD1\u521B\u5EFA\u7684\u51FD\u6570\uFF0C\u9700\u8981\u624B\u52A8\u6267\u884C\u7F16\u8BD1\u64CD\u4F5C\u3002 +CREATE_FUNCTION_UI_FUNCTION_BODY = \u51FD\u6570\u4F53(*) +CREATE_FUNCTION_UI_BUTTON_NEXT = \u4E0B\u4E00\u6B65 +CREATE_FUNCTION_UI_BUTTON_CANCEL = \u53D6\u6D88 +CREATE_FUNCTION_UI_BUTTON_BACK = \u4E0A\u4E00\u6B65 +CREATE_FUNCTION_UI_BUTTON_NO_COMPILE = \u4E0D\u7F16\u8BD1 +CREATE_FUNCTION_UI_BUTTON_COMPILE = \u7F16\u8BD1 +CREATE_FUNCTION_UI_PARAM_NAME = \u540D\u79F0 +CREATE_FUNCTION_UI_PARAM_MODE = \u6A21\u5F0F +CREATE_FUNCTION_UI_PARAM_TYPE = \u7C7B\u578B +CREATE_FUNCTION_UI_PARAM_DEFAULT = \u9ED8\u8BA4\u503C +CREATE_FUNCTION_UI_TOOLTIP_NO_COMPILE = \u8FDB\u5165Data Studio\u7EC8\u7AEF\uFF0C\u4F46\u4E0D\u81EA\u52A8\u7F16\u8BD1\u521B\u5EFA\u7684\u51FD\u6570\uFF0C\u9700\u8981\u624B\u52A8\u6267\u884C\u7F16\u8BD1\u64CD\u4F5C\u3002 CREATE_FUNCTION_UI_TOOLTIP_COMPILE = \u8FDB\u5165Data Studio\u7EC8\u7AEF\uFF0C\u5E76\u81EA\u52A8\u7F16\u8BD1\u521B\u5EFA\u7684\u51FD\u6570\u3002 -CREATE_FUNCTION_UI_TRIGGER = \u89e6\u53d1\u5668 -CREATE_FUNCTION_UI_CREATE = \u521b\u5efa -CREATE_FUNCTION_UI_ERR_FUNC_NAME = \u51fd\u6570\u540d\u4e0d\u80fd\u4e3a\u7a7a -CREATE_FUNCTION_UI_ERR_FUNC_BODY = \u51fd\u6570\u4f53\u4e0d\u80fd\u4e3a\u7a7a - -DROP_TRIGGER = \u5220\u9664\u89e6\u53d1\u5668 -DROP_TRIGGER_TITLE = \u5220\u9664\u89e6\u53d1\u5668 -RENAME_TRIGGER = \u91cd\u547d\u540d -RENAME_TRIGGER_TITLE = \u4e3a{0}\u89e6\u53d1\u5668\u8f93\u5165\u65b0\u7684\u540d\u79f0 - -CREATE_TRIGGER_UI_CREATE_TRIGGER = \u521b\u5efa\u89e6\u53d1\u5668 -CREATE_TRIGGER_UI_EDIT_TRIGGER = \u7f16\u8f91\u89e6\u53d1\u5668 -CREATE_TRIGGER_UI_GENERAL_PAGE = \u5e38\u89c4 -CREATE_TRIGGER_UI_TRIGGER_NAME = \u89e6\u53d1\u5668\u540d(*) -CREATE_TRIGGER_UI_TRIGGER_TABLE_NAME = \u89e6\u53d1\u8868\u002f\u89c6\u56fe\u540d(*) -CREATE_TRIGGER_UI_TIME_TO_TRIGGER = \u89e6\u53d1\u65f6\u95f4 -CREATE_TRIGGER_UI_OPERATION_TYPE = \u64cd\u4f5c\u7c7b\u578b -CREATE_TRIGGER_UI_COLUMN_NAME = \u5217\u540d -CREATE_TRIGGER_UI_DATA_TYPE = \u6570\u636e\u7c7b\u578b -CREATE_TRIGGER_UI_TRIGGER_LEVEL = \u89e6\u53d1\u7ea7\u522b -CREATE_TRIGGER_UI_TUPLE_LEVEL_TRIGGER = \u5143\u7ec4\u7ea7\u89e6\u53d1\u5668(R) -CREATE_TRIGGER_UI_STATEMENT_LEVEL_TRIGGER = \u8bed\u53e5\u7ea7\u89e6\u53d1\u5668(M) -CREATE_TRIGGER_UI_TRIGGER_CONDITION = \u89e6\u53d1\u6761\u4ef6 -CREATE_TRIGGER_UI_TRIGGER_FUNCTION = \u89e6\u53d1\u51fd\u6570(*) -CREATE_TRIGGER_UI_NEXT = \u4e0b\u4e00\u6b65 -CREATE_TRIGGER_UI_CANCEL = \u53d6\u6d88 -CREATE_TRIGGER_UI_SQL_PREVIEW = SQL\u9884\u89c8 -CREATE_TRIGGER_UI_PREVIOUS = \u4e0a\u4e00\u6b65 -CREATE_TRIGGER_UI_FINISH = \u5b8c\u6210 - -EDIT_VIEW_UI_EDIT_VIEW = \u7f16\u8f91\u89c6\u56fe -CREATE_VIEW_UI_CREATE_VIEW = \u521b\u5efa\u89c6\u56fe -CREATE_VIEW_UI_SCHEMA_NAME = \u6a21\u5f0f\u540d -CREATE_VIEW_UI_VIEW_NAME = \u89c6\u56fe\u540d(*) -CREATE_VIEW_UI_TABLE_NAME = \u8868\u540d -CREATE_VIEW_UI_TABLE_FULL_NAME = \u8868\u5168\u540d -CREATE_VIEW_UI_TABLE_ALIAS_NAME = \u8868\u522b\u540d -CREATE_VIEW_UI_COLUMN_NAME = \u5217\u540d -CREATE_VIEW_UI_COLUMN_ALIAS_NAME = \u5217\u522b\u540d +CREATE_FUNCTION_UI_TRIGGER = \u89E6\u53D1\u5668 +CREATE_FUNCTION_UI_CREATE = \u521B\u5EFA +CREATE_FUNCTION_UI_ERR_FUNC_NAME = \u51FD\u6570\u540D\u4E0D\u80FD\u4E3A\u7A7A +CREATE_FUNCTION_UI_ERR_FUNC_BODY = \u51FD\u6570\u4F53\u4E0D\u80FD\u4E3A\u7A7A + +DROP_TRIGGER = \u5220\u9664\u89E6\u53D1\u5668 +DROP_TRIGGER_TITLE = \u5220\u9664\u89E6\u53D1\u5668 +RENAME_TRIGGER = \u91CD\u547D\u540D +RENAME_TRIGGER_TITLE = \u4E3A{0}\u89E6\u53D1\u5668\u8F93\u5165\u65B0\u7684\u540D\u79F0 + +CREATE_TRIGGER_UI_CREATE_TRIGGER = \u521B\u5EFA\u89E6\u53D1\u5668 +CREATE_TRIGGER_UI_EDIT_TRIGGER = \u7F16\u8F91\u89E6\u53D1\u5668 +CREATE_TRIGGER_UI_GENERAL_PAGE = \u5E38\u89C4 +CREATE_TRIGGER_UI_TRIGGER_NAME = \u89E6\u53D1\u5668\u540D(*) +CREATE_TRIGGER_UI_TRIGGER_TABLE_NAME = \u89E6\u53D1\u8868/\u89C6\u56FE\u540D(*) +CREATE_TRIGGER_UI_TIME_TO_TRIGGER = \u89E6\u53D1\u65F6\u95F4 +CREATE_TRIGGER_UI_OPERATION_TYPE = \u64CD\u4F5C\u7C7B\u578B +CREATE_TRIGGER_UI_COLUMN_NAME = \u5217\u540D +CREATE_TRIGGER_UI_DATA_TYPE = \u6570\u636E\u7C7B\u578B +CREATE_TRIGGER_UI_TRIGGER_LEVEL = \u89E6\u53D1\u7EA7\u522B +CREATE_TRIGGER_UI_TUPLE_LEVEL_TRIGGER = \u5143\u7EC4\u7EA7\u89E6\u53D1\u5668(R) +CREATE_TRIGGER_UI_STATEMENT_LEVEL_TRIGGER = \u8BED\u53E5\u7EA7\u89E6\u53D1\u5668(M) +CREATE_TRIGGER_UI_TRIGGER_CONDITION = \u89E6\u53D1\u6761\u4EF6 +CREATE_TRIGGER_UI_TRIGGER_FUNCTION = \u89E6\u53D1\u51FD\u6570(*) +CREATE_TRIGGER_UI_NEXT = \u4E0B\u4E00\u6B65 +CREATE_TRIGGER_UI_CANCEL = \u53D6\u6D88 +CREATE_TRIGGER_UI_SQL_PREVIEW = SQL\u9884\u89C8 +CREATE_TRIGGER_UI_PREVIOUS = \u4E0A\u4E00\u6B65 +CREATE_TRIGGER_UI_FINISH = \u5B8C\u6210 + +EDIT_VIEW_UI_EDIT_VIEW = \u7F16\u8F91\u89C6\u56FE +CREATE_VIEW_UI_CREATE_VIEW = \u521B\u5EFA\u89C6\u56FE +CREATE_VIEW_UI_SCHEMA_NAME = \u6A21\u5F0F\u540D +CREATE_VIEW_UI_VIEW_NAME = \u89C6\u56FE\u540D(*) +CREATE_VIEW_UI_TABLE_NAME = \u8868\u540D +CREATE_VIEW_UI_TABLE_FULL_NAME = \u8868\u5168\u540D +CREATE_VIEW_UI_TABLE_ALIAS_NAME = \u8868\u522B\u540D +CREATE_VIEW_UI_COLUMN_NAME = \u5217\u540D +CREATE_VIEW_UI_COLUMN_ALIAS_NAME = \u5217\u522B\u540D CREATE_VIEW_UI_COLUMN_1 = \u52171 CREATE_VIEW_UI_COLUMN_2 = \u52172 -CREATE_VIEW_UI_PREVIEW = \u9884\u89c8 -CREATE_VIEW_UI_NEXT = \u4e0b\u4e00\u6b65 -CREATE_VIEW_UI_PREVIOUS = \u4e0a\u4e00\u6b65 -CREATE_VIEW_UI_CANCEL = \u53d6\u6d88 -CREATE_VIEW_UI_FINISH = \u5b8c\u6210 -CREATE_VIEW_UI_WHERE = \u6761\u4ef6 -CREATE_VIEW_UI_ADD = \u6dfb\u52a0 +CREATE_VIEW_UI_PREVIEW = \u9884\u89C8 +CREATE_VIEW_UI_NEXT = \u4E0B\u4E00\u6B65 +CREATE_VIEW_UI_PREVIOUS = \u4E0A\u4E00\u6B65 +CREATE_VIEW_UI_CANCEL = \u53D6\u6D88 +CREATE_VIEW_UI_FINISH = \u5B8C\u6210 +CREATE_VIEW_UI_WHERE = \u6761\u4EF6 +CREATE_VIEW_UI_ADD = \u6DFB\u52A0 CREATE_VIEW_UI_DELETE = \u5220\u9664 -CREATE_VIEW_UI_MATERVIEW = \u7269\u5316\u89c6\u56fe -CREATE_VIEW_UI_VIEW = \u89c6\u56fe -CREATE_VIEW_UI_NAME_NOT_EMPTY = \u89c6\u56fe\u540d\u4e0d\u80fd\u4e3a\u7a7a \ No newline at end of file +CREATE_VIEW_UI_MATERVIEW = \u7269\u5316\u89C6\u56FE +CREATE_VIEW_UI_VIEW = \u89C6\u56FE +CREATE_VIEW_UI_NAME_NOT_EMPTY = \u89C6\u56FE\u540D\u4E0D\u80FD\u4E3A\u7A7A +REMARK_SHORTCUT_KEY_BINDING_TOGGLE_LINE_COMMENTS=\u6807\u8BB0\u884C/\u53D6\u6D88\u6807\u8BB0\u884C(\u8986\u76D6\u7387) +OID=Oid +TOTAL_LINE=\u603B\u884C\u6570 +TOTAL_RUN_LINE_NUM=\u6267\u884C\u884C\u6570 +TOTAL_COVERAGE=\u603B\u8986\u76D6\u7387 +REMARK_LINE=\u6807\u8BB0\u884C +REMARK_RUM_LINE_NUM=\u6807\u8BB0\u6267\u884C\u884C +REMARK_COVERAGE=\u6807\u8BB0\u8986\u76D6\u7387 +DELETE_COVERAGE=\u9009\u62E9\u5220\u9664 +DELETE_COVERAGE_ALL=\u5168\u90E8\u5220\u9664 +EXPORT_REPORT=\u5BFC\u51FA\u8986\u76D6\u7387\u62A5\u544A +SURE_EXPORT_REPORT=\u786E\u5B9A\u5BFC\u51FA\u8986\u76D6\u7387\u62A5\u544A\u5417? +COVERAGE_REPORT_NOT_EXIST=\u8986\u76D6\u7387\u62A5\u544A\u4E0D\u5B58\u5728 +COVERAGE_REPORT_TO_SELECT=\u8BF7\u9009\u62E9\u4E00\u6761\u8BB0\u5F55 +COVERAGE_HISTORY_TITLE=\u8986\u76D6\u7387\u62A5\u544A - {0} +DELETE_COVERAGE_REPORT_TITLE=\u5220\u9664\u5B58\u50A8\u8FC7\u7A0B +DELETE_SELECTED_COVERAGE_HISTORY_ALERT=\u4F60\u786E\u5B9A\u8981\u5220\u9664\u201C{0}\u201D\u8FDE\u63A5\u914D\u7F6E\u6587\u4EF6\u7684\u9009\u5B9A\u7684\u5B58\u50A8\u8FC7\u7A0B\u67E5\u8BE2\u5386\u53F2\uFF1F +DELETE_ALL_COVERAGE_HISTORY_ALERT=\u4F60\u786E\u5B9A\u8981\u5220\u9664\u201C{0}\u201D\u8FDE\u63A5\u914D\u7F6E\u6587\u4EF6\u7684\u5B58\u50A8\u8FC7\u7A0B\u67E5\u8BE2\u5386\u53F2\uFF1F +UPDATE_TIME=\u66F4\u65B0\u65F6\u95F4 +DEBUG_POSITION_LABEL_PASS=\u901A\u8FC7 +DEBUG_POSITION_LABEL_FAIL=\u672A\u901A\u8FC7 +COVERAGE_HINT=\u82E5\u9700\u8981\u67E5\u770B\u8986\u76D6\u7387\u62A5\u544A,\u8BF7\u6267\u884CDebug! +EXPORT_PATH = \u62A5\u544A\u5DF2\u4E0B\u8F7D\u5230: {0} +COVERAGE_CHECK = \u8BE5\u7248\u672C\u4E0D\u652F\u6301\u6B64\u529F\u80FD! \ No newline at end of file diff --git a/code/datastudio/src/org.opengauss.mppdbide.utils/src/org/opengauss/mppdbide/utils/DebuggerStartVariable.java b/code/datastudio/src/org.opengauss.mppdbide.utils/src/org/opengauss/mppdbide/utils/DebuggerStartVariable.java new file mode 100644 index 0000000000000000000000000000000000000000..7cd44aaf50cb52780ea8cd08bbf9a0926f2f695b --- /dev/null +++ b/code/datastudio/src/org.opengauss.mppdbide.utils/src/org/opengauss/mppdbide/utils/DebuggerStartVariable.java @@ -0,0 +1,92 @@ +/* + * Copyright (c) 2022 Huawei Technologies Co.,Ltd. + * + * openGauss is licensed under Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * 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. + * See the Mulan PSL v2 for more details. + */ + +package org.opengauss.mppdbide.utils; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.opengauss.mppdbide.utils.vo.DebuggerEndInfoVo; +import org.opengauss.mppdbide.utils.vo.DebuggerStartInfoVo; + +/** + * Title: class + * Description: The Class DebuggerStartVariable. + * + * @since 3.0.0 + */ +public class DebuggerStartVariable { + /** + * beginInfoMap of function + */ + public static Map beginInfoMap = new HashMap(); + + /** + * endInfoMap of function + */ + public static Map> endInfoMap = new HashMap(); + + /** + * getHistoryList of function + * + * @param oid the oid + * @return the value of function + */ + public static List getHistoryList(Long oid) { + List list = endInfoMap.get(oid); + if (list == null) { + list = new ArrayList(); + setHistoryList(oid, list); + } + return list; + } + + /** + * setHistoryList of function + * + * @param oid the oid + * @param list the list + */ + public static void setHistoryList(Long oid, List list) { + endInfoMap.put(oid, list); + } + + /** + * getStartInfo of function + * + * @param oid the oid + * @return the value of the function + */ + public static DebuggerStartInfoVo getStartInfo(Long oid) { + DebuggerStartInfoVo info = beginInfoMap.get(oid); + if (info == null) { + info = new DebuggerStartInfoVo(); + setStartInfo(oid, info); + } + return info; + } + + /** + * setStartInfo of function + * + * @param oid the oid + * @param info the info + */ + public static void setStartInfo(Long oid, DebuggerStartInfoVo info) { + beginInfoMap.put(oid, info); + } +} diff --git a/code/datastudio/src/org.opengauss.mppdbide.utils/src/org/opengauss/mppdbide/utils/IMessagesConstants.java b/code/datastudio/src/org.opengauss.mppdbide.utils/src/org/opengauss/mppdbide/utils/IMessagesConstants.java index 9ed69f4b5bf900edac773da187d0d58493296cdd..2ed00e54d535b857ca1e7125d8c6d70ab1710028 100644 --- a/code/datastudio/src/org.opengauss.mppdbide.utils/src/org/opengauss/mppdbide/utils/IMessagesConstants.java +++ b/code/datastudio/src/org.opengauss.mppdbide.utils/src/org/opengauss/mppdbide/utils/IMessagesConstants.java @@ -3015,4 +3015,109 @@ public interface IMessagesConstants extends IMessagesConstantsOne { String CREATE_VIEW_UI_VIEW = "CREATE_VIEW_UI_VIEW"; String CREATE_VIEW_UI_MATERVIEW = "CREATE_VIEW_UI_MATERVIEW"; String CREATE_VIEW_UI_NAME_NOT_EMPTY = "CREATE_VIEW_UI_NAME_NOT_EMPTY"; -} + + /** + * DEBUG_POSITION_LABEL_PASS + */ + String DEBUG_POSITION_LABEL_PASS = "DEBUG_POSITION_LABEL_PASS"; + + /** + * DEBUG_POSITION_LABEL_FAIL + */ + String DEBUG_POSITION_LABEL_FAIL = "DEBUG_POSITION_LABEL_FAIL"; + + /** + * REMARK_SHORTCUT_KEY_BINDING_TOGGLE_LINE_COMMENTS + */ + String REMARK_SHORTCUT_KEY_BINDING_TOGGLE_LINE_COMMENTS = "REMARK_SHORTCUT_KEY_BINDING_TOGGLE_LINE_COMMENTS"; + + /** + * OID + */ + String OID = "OID"; + + /** + * TOTAL_LINE + */ + String TOTAL_LINE = "TOTAL_LINE"; + + /** + * TOTAL_RUN_LINE_NUM + */ + String TOTAL_RUN_LINE_NUM = "TOTAL_RUN_LINE_NUM"; + + /** + * TOTAL_Coverage + */ + String TOTAL_COVERAGE = "TOTAL_COVERAGE"; + + /** + * REMARK_LINE + */ + String REMARK_LINE = "REMARK_LINE"; + + /** + * REMARK_RUM_LINE_NUM + */ + String REMARK_RUM_LINE_NUM = "REMARK_RUM_LINE_NUM"; + + /** + * REMARK_COVERAGE + */ + String REMARK_COVERAGE = "REMARK_COVERAGE"; + + /** + * DELETE_COVERAGE + */ + String DELETE_COVERAGE = "DELETE_COVERAGE"; + + /** + * DELETE_COVERAGE_ALL + */ + String DELETE_COVERAGE_ALL = "DELETE_COVERAGE_ALL"; + + /** + * EXPORT_REPORT + */ + String EXPORT_REPORT = "EXPORT_REPORT"; + + /** + * COVERAGE_HISTORY_TITLE + */ + String COVERAGE_HISTORY_TITLE = "COVERAGE_HISTORY_TITLE"; + + /** + * DELETE_COVERAGE_REPORT_TITLE + */ + String DELETE_COVERAGE_REPORT_TITLE = "DELETE_COVERAGE_REPORT_TITLE"; + + /** + * DELETE_SELECTED_COVERAGE_HISTORY_ALERT + */ + String DELETE_SELECTED_COVERAGE_HISTORY_ALERT = "DELETE_SELECTED_COVERAGE_HISTORY_ALERT"; + + /** + * DELETE_ALL_COVERAGE_HISTORY_ALERT + */ + String DELETE_ALL_COVERAGE_HISTORY_ALERT = "DELETE_ALL_COVERAGE_HISTORY_ALERT"; + + /** + * SURE_EXPORT_REPORT + */ + String SURE_EXPORT_REPORT = "SURE_EXPORT_REPORT"; + + /** + * The coverage report not exist + */ + String COVERAGE_REPORT_NOT_EXIST = "COVERAGE_REPORT_NOT_EXIST"; + + /** + * The coverage report to select + */ + String COVERAGE_REPORT_TO_SELECT = "COVERAGE_REPORT_TO_SELECT"; + + /** + * The update time + */ + String UPDATE_TIME = "UPDATE_TIME"; +} \ No newline at end of file diff --git a/code/datastudio/src/org.opengauss.mppdbide.utils/src/org/opengauss/mppdbide/utils/IMessagesConstantsOne.java b/code/datastudio/src/org.opengauss.mppdbide.utils/src/org/opengauss/mppdbide/utils/IMessagesConstantsOne.java index ff57dd80b67f2b4c5efc463d17f0cec2516ce6fe..cf0883c9fa44ab231bae6b80d1b26c278b49ff78 100644 --- a/code/datastudio/src/org.opengauss.mppdbide.utils/src/org/opengauss/mppdbide/utils/IMessagesConstantsOne.java +++ b/code/datastudio/src/org.opengauss.mppdbide.utils/src/org/opengauss/mppdbide/utils/IMessagesConstantsOne.java @@ -1099,4 +1099,19 @@ public interface IMessagesConstantsOne extends IMessagesConstantsTwo { String ERROR_WHILE_FETCHING_OWNER_NAME = "ERROR_WHILE_FETCHING_OWNER_NAME"; String ERR_WHILE_FETCHING_SEQ_VALUE = "ERR_WHILE_FETCHING_SEQ_VALUE"; + + /** + * COVERAGE_HINT + */ + String COVERAGE_HINT = "COVERAGE_HINT"; + + /** + * EXPORT_PATH + */ + String EXPORT_PATH = "EXPORT_PATH"; + + /** + * COVERAGE_CHECK + */ + String COVERAGE_CHECK = "COVERAGE_CHECK"; } \ No newline at end of file diff --git a/code/datastudio/src/org.opengauss.mppdbide.utils/src/org/opengauss/mppdbide/utils/VariableRunLine.java b/code/datastudio/src/org.opengauss.mppdbide.utils/src/org/opengauss/mppdbide/utils/VariableRunLine.java new file mode 100644 index 0000000000000000000000000000000000000000..477ac6111c8a0a8399e40a56756ba81fc7aa554a --- /dev/null +++ b/code/datastudio/src/org.opengauss.mppdbide.utils/src/org/opengauss/mppdbide/utils/VariableRunLine.java @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2022 Huawei Technologies Co.,Ltd. + * + * openGauss is licensed under Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * 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. + * See the Mulan PSL v2 for more details. + */ + +package org.opengauss.mppdbide.utils; + +import java.util.List; +import java.util.Set; +import java.util.concurrent.CopyOnWriteArrayList; +import java.util.concurrent.CopyOnWriteArraySet; + +/** + * the class VariableRunLine + * + * @since 3.0.0 + */ +public class VariableRunLine { + /** + * runList of function + */ + public static volatile List runList = new CopyOnWriteArrayList<>(); + + /** + * passLine of function + */ + public static volatile Set passLine = new CopyOnWriteArraySet(); + + /** + * isTerminate of function + */ + public static volatile boolean isTerminate = true; + + /** + * isContinue of function + */ + public static volatile Boolean isContinue; + + /** + * isPldebugger of function + */ + public static volatile Boolean isPldebugger; +} diff --git a/code/datastudio/src/org.opengauss.mppdbide.utils/src/org/opengauss/mppdbide/utils/vo/DebuggerEndInfoVo.java b/code/datastudio/src/org.opengauss.mppdbide.utils/src/org/opengauss/mppdbide/utils/vo/DebuggerEndInfoVo.java new file mode 100644 index 0000000000000000000000000000000000000000..5fda651916ca4bad9d77c8d9e1c803a161736b1f --- /dev/null +++ b/code/datastudio/src/org.opengauss.mppdbide.utils/src/org/opengauss/mppdbide/utils/vo/DebuggerEndInfoVo.java @@ -0,0 +1,73 @@ +/* + * Copyright (c) 2022 Huawei Technologies Co.,Ltd. + * + * openGauss is licensed under Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * 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. + * See the Mulan PSL v2 for more details. + */ + +package org.opengauss.mppdbide.utils.vo; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +/** + * Execution information after the stored procedure ends + * + * @since 3.0.0 + */ +public class DebuggerEndInfoVo extends DebuggerStartInfoVo { + /** + * cid of function + */ + public Long cid = System.currentTimeMillis(); // coverage id + + /** + * endDateLong of function + */ + public Long endDateLong = System.currentTimeMillis(); // End Time + + /** + * runList of function + */ + public List runList; // run to the line + + /** + * runStr of function + */ + public String runStr; // the string that runs to the line + + /** + * get run line + * + * @return the return value + */ + public List getRunList() { + if (runStr == null || "".equals(runStr)) { + return new ArrayList(); + } else { + remarkList = new ArrayList<>(Arrays.asList(runStr.split(","))); + } + return remarkList; + } + + /** + * set info + * + * @param info the info to set + */ + public void setInfo(DebuggerStartInfoVo info) { + super.oid = info.oid; + super.sourceCode = info.sourceCode; + super.args = info.args; + super.remarLinesStr = info.remarLinesStr; + } +} diff --git a/code/datastudio/src/org.opengauss.mppdbide.utils/src/org/opengauss/mppdbide/utils/vo/DebuggerStartInfoVo.java b/code/datastudio/src/org.opengauss.mppdbide.utils/src/org/opengauss/mppdbide/utils/vo/DebuggerStartInfoVo.java new file mode 100644 index 0000000000000000000000000000000000000000..fa38e9c796ca0b034b4c06e2ecdfad35483c2a38 --- /dev/null +++ b/code/datastudio/src/org.opengauss.mppdbide.utils/src/org/opengauss/mppdbide/utils/vo/DebuggerStartInfoVo.java @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2022 Huawei Technologies Co.,Ltd. + * + * openGauss is licensed under Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * 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. + * See the Mulan PSL v2 for more details. + */ + +package org.opengauss.mppdbide.utils.vo; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +/** + * Stored procedure startup information + * + * @since 3.0.0 + */ +public class DebuggerStartInfoVo { + /** + * oid of function + */ + public Long oid; + + /** + * sourceCode of function + */ + public String sourceCode; + + /** + * args of function + */ + public List args; + + /** + * remarkList of function + */ + public List remarkList; + + /** + * remarLinesStr of function + */ + public String remarLinesStr; + + /** + * isMakeReport of function + */ + public boolean isMakeReport = true; + + /** + * get remakr list + * + * @return the return value + */ + public List getRemarkList() { + if (remarLinesStr == null || "".equals(remarLinesStr)) { + return new ArrayList(); + } else { + remarkList = new ArrayList<>(Arrays.asList(remarLinesStr.split(","))); + } + return remarkList; + } +} diff --git a/code/datastudio/src/org.opengauss.mppdbide.view/Application.e4xmi b/code/datastudio/src/org.opengauss.mppdbide.view/Application.e4xmi index 26da7d5e56fd0dc252a3103b2a4e804d53ebaa40..0d93b5955efaf5f19d2a29cbecb94e4c6e5e76d3 100644 --- a/code/datastudio/src/org.opengauss.mppdbide.view/Application.e4xmi +++ b/code/datastudio/src/org.opengauss.mppdbide.view/Application.e4xmi @@ -166,6 +166,7 @@ + @@ -314,6 +315,7 @@ + @@ -1020,6 +1022,7 @@ + diff --git a/code/datastudio/src/org.opengauss.mppdbide.view/META-INF/MANIFEST.MF b/code/datastudio/src/org.opengauss.mppdbide.view/META-INF/MANIFEST.MF index b8eb0ac833da42df25c1d6c12399ba8fd40b220e..3770da56c384bf14f64b3d6a532bdb5e73a63af1 100644 --- a/code/datastudio/src/org.opengauss.mppdbide.view/META-INF/MANIFEST.MF +++ b/code/datastudio/src/org.opengauss.mppdbide.view/META-INF/MANIFEST.MF @@ -8,7 +8,9 @@ Bundle-ClassPath: ., guava-30.1.1-jre.jar Bundle-Activator: org.opengauss.mppdbide.view.Activator Bundle-Vendor: Huawei Technologies -Export-Package: org.opengauss.mppdbide.view.utils +Export-Package: org.opengauss.mppdbide.view.handler.debug, + org.opengauss.mppdbide.view.ui, + org.opengauss.mppdbide.view.utils Require-Bundle: org.eclipse.core.runtime;bundle-version="3.15.300", org.eclipse.swt;bundle-version="3.108.0", javax.inject;bundle-version="1.0.0", @@ -71,12 +73,20 @@ Require-Bundle: org.eclipse.core.runtime;bundle-version="3.15.300", openjfx.graphics.win32_64;bundle-version="17.0.2", openjfx.swing;bundle-version="17.0.2", openjfx.swt;bundle-version="17.0.2" -Bundle-RequiredExecutionEnvironment: JavaSE-11 +Bundle-RequiredExecutionEnvironment: JavaSE-11, + OSGi/Minimum-1.2 Bundle-ActivationPolicy: lazy Import-Package: com.google.common.collect;version="15.0.0", com.google.inject;version="1.3.0", com.google.inject.binder;version="1.3.0", com.google.inject.util;version="1.3.0", + javax.annotation;version="1.0.0";resolution:=optional, + javax.inject;version="1.0.0", + org.apache.commons.collections4.trie, + org.apache.commons.csv, + org.eclipse.ui.editors.text, + org.jsoup;version="1.14.3", + org.jsoup.nodes;version="1.14.3", org.opengauss.mppdbide.editor.extension.nameparser, org.opengauss.mppdbide.explainplan.ui.model, org.opengauss.mppdbide.parser.alias, @@ -93,9 +103,4 @@ Import-Package: com.google.common.collect;version="15.0.0", org.opengauss.mppdbide.presentation.resultsetif, org.opengauss.mppdbide.presentation.search, org.opengauss.mppdbide.presentation.visualexplainplan, - javax.annotation;version="1.0.0";resolution:=optional, - javax.inject;version="1.0.0", - org.apache.commons.collections4.trie, - org.apache.commons.csv, - org.eclipse.ui.editors.text, org.postgresql diff --git a/code/datastudio/src/org.opengauss.mppdbide.view/OSGI-INF/l10n/bundle.properties b/code/datastudio/src/org.opengauss.mppdbide.view/OSGI-INF/l10n/bundle.properties index 519a6f4557055c466d8b997494f4068cbb180031..5407ac48ec798a0825c98a0e3b25f995e1c03181 100644 --- a/code/datastudio/src/org.opengauss.mppdbide.view/OSGI-INF/l10n/bundle.properties +++ b/code/datastudio/src/org.opengauss.mppdbide.view/OSGI-INF/l10n/bundle.properties @@ -1317,4 +1317,9 @@ objectbrowser.popupmenu.tooltip.trigger.rename = Trigger Rename org.opengauss.objectbrowser.popupmenu.id.view.editview = org.opengauss.objectbrowser.popupmenu.id.view.editview objectbrowser.popupmenu.label.editview = Edit View objectbrowser.popupmenu.mnemonics.editview = e -objectbrowser.popupmenu.tooltip.editview = Edit View \ No newline at end of file +objectbrowser.popupmenu.tooltip.editview = Edit View + +executemenu.id.historyconverg=org.opengauss.executemenu.id.historyconverg +executemenu.label.historyconverg=Historical Coverage +executemenu.mnemonics.historyconverg= +executemenu.tooltip.historyconverg=Historical Coverage \ No newline at end of file diff --git a/code/datastudio/src/org.opengauss.mppdbide.view/OSGI-INF/l10n/bundle_zh_CN.properties b/code/datastudio/src/org.opengauss.mppdbide.view/OSGI-INF/l10n/bundle_zh_CN.properties index 31c510a263422049183e0214bbe87d2fd709e1be..0f3efdae69c3e354116f17bcae2db1e4f0fce46d 100644 --- a/code/datastudio/src/org.opengauss.mppdbide.view/OSGI-INF/l10n/bundle_zh_CN.properties +++ b/code/datastudio/src/org.opengauss.mppdbide.view/OSGI-INF/l10n/bundle_zh_CN.properties @@ -210,9 +210,9 @@ viewmenu.tooltip.variable = \u53D8\u91CF #Monitor window viewmenu.id.monitor = org.opengauss.viewmenu.id.monitor -viewmenu.label.monitor = \u76d1\u89c6\u5668 +viewmenu.label.monitor = \u76D1\u89C6\u5668 viewmenu.mnemonics.monitor = M -viewmenu.tooltip.monitor = \u76d1\u89c6\u5668 +viewmenu.tooltip.monitor = \u76D1\u89C6\u5668 #Run Menu menu.id.runmenu = org.opengauss.mppdbide.menu.id.run @@ -221,38 +221,43 @@ menu.mnemonics.runmenu = R #Run Debug menu.id.debugmenu = org.opengauss.mppdbide.menu.id.debugmenu -menu.label.debugmenu = \u8c03\u8bd5(&B) +menu.label.debugmenu = \u8C03\u8BD5(&B) menu.mnemonics.debugmenu = B executemenu.id.debug = org.opengauss.executemenu.id.debug -executemenu.label.debug = \u542f\u52a8\u8c03\u8bd5(&S) +executemenu.label.debug = \u542F\u52A8\u8C03\u8BD5(&S) executemenu.mnemonics.debug = S -executemenu.tooltip.debug = \u542f\u52a8\u8c03\u8bd5 +executemenu.tooltip.debug = \u542F\u52A8\u8C03\u8BD5 executemenu.id.terminate = org.opengauss.executemenu.id.terminate -executemenu.label.terminate = \u505c\u6b62\u8c03\u8bd5(&T) +executemenu.label.terminate = \u505C\u6B62\u8C03\u8BD5(&T) executemenu.mnemonics.terminate = T -executemenu.tooltip.terminate = \u505c\u6b62\u8c03\u8bd5 +executemenu.tooltip.terminate = \u505C\u6B62\u8C03\u8BD5 executemenu.id.continue = org.opengauss.executemenu.id.continue -executemenu.label.continue = \u7ee7\u7eed(&C) +executemenu.label.continue = \u7EE7\u7EED(&C) executemenu.mnemonics.continue = C -executemenu.tooltip.continue = \u7ee7\u7eed +executemenu.tooltip.continue = \u7EE7\u7EED executemenu.id.stepin = org.opengauss.executemenu.id.stepin -executemenu.label.stepin = \u6b65\u5165(&I) +executemenu.label.stepin = \u6B65\u5165(&I) executemenu.mnemonics.stepin = I -executemenu.tooltip.stepin = \u6b65\u5165 +executemenu.tooltip.stepin = \u6B65\u5165 executemenu.id.stepover = org.opengauss.executemenu.id.stepover -executemenu.label.stepover = \u6b65\u8fdb(&O) +executemenu.label.stepover = \u6B65\u8FDB(&O) executemenu.mnemonics.stepover = O -executemenu.tooltip.stepover = \u6b65\u8fdb +executemenu.tooltip.stepover = \u6B65\u8FDB + +executemenu.id.historyconverg=org.opengauss.executemenu.id.historyconverg +executemenu.label.historyconverg=\u5386\u53F2\u8986\u76D6\u7387 +executemenu.mnemonics.historyconverg= +executemenu.tooltip.historyconverg=\u5386\u53F2\u8986\u76D6\u7387 executemenu.id.stepout = org.opengauss.executemenu.id.stepout -executemenu.label.stepout = \u6b65\u51fa(&R) +executemenu.label.stepout = \u6B65\u51FA(&R) executemenu.mnemonics.stepout = R -executemenu.tooltip.stepout = \u6b65\u51fa +executemenu.tooltip.stepout = \u6B65\u51FA #Compile executemenu.id.compile = org.opengauss.executemenu.id.compile @@ -683,9 +688,9 @@ objectbrowser.popupmenu.tooltip.droppartition = \u5220\u9664\u5206\u533A #View Partition Data pop-up menu for object browser objectbrowser.popupmenu.id.viewpartition = org.opengauss.objectbrowser.popupmenu.id.viewpartition -objectbrowser.popupmenu.label.viewpartition = \u67e5\u770b\u5206\u533a\u6570\u636e +objectbrowser.popupmenu.label.viewpartition = \u67E5\u770B\u5206\u533A\u6570\u636E objectbrowser.popupmenu.mnemonics.viewpartition = p -objectbrowser.popupmenu.tooltip.viewpartition = \u67e5\u770b\u5206\u533a\u6570\u636e +objectbrowser.popupmenu.tooltip.viewpartition = \u67E5\u770B\u5206\u533A\u6570\u636E #Rename Partition pop-up menu for object browser objectbrowser.popupmenu.id.renamepartition = org.opengauss.objectbrowser.popupmenu.id.renamepartition @@ -1011,9 +1016,9 @@ objectbrowser.popupmenu.mnemonics.showviewddl = w objectbrowser.popupmenu.tooltip.showviewddl = \u663E\u793A\u89C6\u56FE\u5B9A\u4E49 objectbrowser.popupmenu.id.viewcolumn.defaultvalue = org.opengauss.mppdbide.command.id.viewcolumn.defaultvalue -objectbrowser.popupmenu.label.viewcolumn.defaultvalue = \u8bbe\u7f6e\u89c6\u56fe\u5217\u7f3a\u7701\u503c +objectbrowser.popupmenu.label.viewcolumn.defaultvalue = \u8BBE\u7F6E\u89C6\u56FE\u5217\u7F3A\u7701\u503C objectbrowser.popupmenu.mnemonics.viewcolumn.defaultvalue = D -objectbrowser.popupmenu.tooltip.viewcolumn.defaultvalue = \u8bbe\u7f6e\u89c6\u56fe\u5217\u7f3a\u7701\u503c +objectbrowser.popupmenu.tooltip.viewcolumn.defaultvalue = \u8BBE\u7F6E\u89C6\u56FE\u5217\u7F3A\u7701\u503C objectbrowser.popupmenu.id.exportddl = org.opengauss.mppdbide.command.id.exportddl @@ -1108,8 +1113,8 @@ objectbrowser.popupmenu.mnemonics.dropsequencecascade = D objectbrowser.popupmenu.tooltip.dropsequencecascade = \u7EA7\u8054\u5220\u9664\u5E8F\u5217\u5BF9\u8C61 #DB Assistant -view.db.assistant.title=SQL\u52a9\u624b -view.db.assistant.open=\u6253\u5f00SQL\u52a9\u624b +view.db.assistant.title=SQL\u52A9\u624B +view.db.assistant.open=\u6253\u5F00SQL\u52A9\u624B #Toggle Line Comment editmenu.label.togglelinecomments = \u884C\u6CE8\u91CA/\u53D6\u6D88\u884C\u6CE8\u91CA(&N) @@ -1121,11 +1126,11 @@ editmenu.label.toggleblockcomments = \u5757\u6CE8\u91CA/\u53D6\u6D88\u5757\u6CE8 objectbrowser.popupmenu.mnemonics.toggleblockcomments = B editmenu.tooltip.toggleblockcomments = \u5757\u6CE8\u91CA/\u53D6\u6D88\u5757\u6CE8\u91CA #User/Role Menu -objectbrowser.popupmenu.label.createrole = \u521b\u5efa\u7528\u6237\u002f\u89d2\u8272 -objectbrowser.popupmenu.tooltip.createrole = \u521b\u5efa\u7528\u6237\u002f\u89d2\u8272 +objectbrowser.popupmenu.label.createrole = \u521B\u5EFA\u7528\u6237/\u89D2\u8272 +objectbrowser.popupmenu.tooltip.createrole = \u521B\u5EFA\u7528\u6237/\u89D2\u8272 -objectbrowser.popupmenu.label.dropuserrole = \u5220\u9664\u7528\u6237\u002f\u89d2\u8272 -objectbrowser.popupmenu.tooltip.dropuserrole = \u5220\u9664\u7528\u6237\u002f\u89d2\u8272 +objectbrowser.popupmenu.label.dropuserrole = \u5220\u9664\u7528\u6237/\u89D2\u8272 +objectbrowser.popupmenu.tooltip.dropuserrole = \u5220\u9664\u7528\u6237/\u89D2\u8272 #Grant/Revoke objectbrowser.popupmenu.label.grantrevokewizard = \u6388\u6743/\u64A4\u9500\u6743\u9650 @@ -1138,9 +1143,9 @@ objectbrowser.popupmenu.tooltip.tablespaceproperties=\u670D\u52A1\u5668\u5C5E\u6 #Create C function popup menu for objectbrowser objectbrowser.popupmenu.id.createcfunction= org.opengauss.objectbrowser.popupmenu.id.createcfunction -objectbrowser.popupmenu.label.createcfunction = \u521b\u5efa\u0043\u51fd\u6570 +objectbrowser.popupmenu.label.createcfunction = \u521B\u5EFAC\u51FD\u6570 objectbrowser.popupmenu.mnemonics.createcfunction = c -objectbrowser.popupmenu.tooltip.createcfunction = \u521b\u5efa\u0043\u51fd\u6570objectbrowser.popupmenu.tooltip.tablespaceproperties=\u670D\u52A1\u5668\u5C5E\u6027 +objectbrowser.popupmenu.tooltip.createcfunction = \u521B\u5EFAC\u51FD\u6570objectbrowser.popupmenu.tooltip.tablespaceproperties=\u670D\u52A1\u5668\u5C5E\u6027 #Save As Menu editmenu.id.savesqlas = org.opengauss.editmenu.id.savesqlas @@ -1162,9 +1167,9 @@ objectbrowser.popupmenu.tooltip.edittabledata = \u7F16\u8F91\u8868\u6570\u636E #Edit ERD pop-up menu for object browser objectbrowser.popupmenu.id.viewerd = org.opengauss.mppdbide.command.id.viewerd -objectbrowser.popupmenu.label.viewerd = \u0045\u0052\u56fe +objectbrowser.popupmenu.label.viewerd = ER\u56FE objectbrowser.popupmenu.mnemonics.viewerd = v -objectbrowser.popupmenu.tooltip.viewerd = \u67e5\u770b\u0045\u0052\u56fe +objectbrowser.popupmenu.tooltip.viewerd = \u67E5\u770BER\u56FE #Create Synonym org.opengauss.objectbrowser.popupmenu.id.createsynonym =org.opengauss.objectbrowser.popupmenu.id.createsynonym @@ -1180,20 +1185,20 @@ objectbrowser.popupmenu.mnemonics.dropsynonym = D #Start Debugging org.opengauss.objectbrowser.popupmenu.id.startdebug = org.opengauss.objectbrowser.popupmenu.id.startdebug -objectbrowser.popupmenu.label.startdebug = \u542f\u52a8\u8c03\u8bd5 -objectbrowser.popupmenu.tooltip.startdebug = \u542f\u52a8\u8c03\u8bd5 +objectbrowser.popupmenu.label.startdebug = \u542F\u52A8\u8C03\u8BD5 +objectbrowser.popupmenu.tooltip.startdebug = \u542F\u52A8\u8C03\u8BD5 objectbrowser.popupmenu.mnemonics.startdebug = S #Trigger Create org.opengauss.objectbrowser.popupmenu.id.triggergroup.create = org.opengauss.objectbrowser.popupmenu.id.triggergroup.create -objectbrowser.popupmenu.label.triggergroup.create = \u521b\u5efa\u89e6\u53d1\u5668 +objectbrowser.popupmenu.label.triggergroup.create = \u521B\u5EFA\u89E6\u53D1\u5668 objectbrowser.popupmenu.mnemonics.triggergroup.create = c -objectbrowser.popupmenu.tooltip.triggergroup.create = \u521b\u5efa\u89e6\u53d1\u5668 +objectbrowser.popupmenu.tooltip.triggergroup.create = \u521B\u5EFA\u89E6\u53D1\u5668 #Trigger Drop org.opengauss.objectbrowser.popupmenu.id.trigger.drop = org.opengauss.objectbrowser.popupmenu.id.trigger.drop -objectbrowser.popupmenu.label.trigger.drop = \u5220\u9664\u89e6\u53d1\u5668 +objectbrowser.popupmenu.label.trigger.drop = \u5220\u9664\u89E6\u53D1\u5668 objectbrowser.popupmenu.mnemonics.trigger.drop = d -objectbrowser.popupmenu.tooltip.trigger.drop = \u5220\u9664\u89e6\u53d1\u5668 +objectbrowser.popupmenu.tooltip.trigger.drop = \u5220\u9664\u89E6\u53D1\u5668 #Trigger Edit org.opengauss.objectbrowser.popupmenu.id.trigger.edit = org.opengauss.objectbrowser.popupmenu.id.trigger.edit objectbrowser.popupmenu.label.trigger.edit = \u7F16\u8F91\u89E6\u53D1\u5668 @@ -1201,21 +1206,21 @@ objectbrowser.popupmenu.mnemonics.trigger.edit = i objectbrowser.popupmenu.tooltip.trigger.edit = \u7F16\u8F91\u89E6\u53D1\u5668 #Trigger Enable org.opengauss.objectbrowser.popupmenu.id.trigger.enable = org.opengauss.objectbrowser.popupmenu.id.trigger.enable -objectbrowser.popupmenu.label.trigger.enable = \u542f\u7528\u89e6\u53d1\u5668 +objectbrowser.popupmenu.label.trigger.enable = \u542F\u7528\u89E6\u53D1\u5668 objectbrowser.popupmenu.mnemonics.trigger.enable = e -objectbrowser.popupmenu.tooltip.trigger.enable = \u542f\u7528\u89e6\u53d1\u5668 +objectbrowser.popupmenu.tooltip.trigger.enable = \u542F\u7528\u89E6\u53D1\u5668 #Trigger Disable org.opengauss.objectbrowser.popupmenu.id.trigger.disable = org.opengauss.objectbrowser.popupmenu.id.trigger.disable -objectbrowser.popupmenu.label.trigger.disable = \u7981\u7528\u89e6\u53d1\u5668 +objectbrowser.popupmenu.label.trigger.disable = \u7981\u7528\u89E6\u53D1\u5668 objectbrowser.popupmenu.mnemonics.trigger.disable = i -objectbrowser.popupmenu.tooltip.trigger.disable = \u7981\u7528\u89e6\u53d1\u5668 +objectbrowser.popupmenu.tooltip.trigger.disable = \u7981\u7528\u89E6\u53D1\u5668 #Trigger Rename org.opengauss.objectbrowser.popupmenu.id.trigger.rename = org.opengauss.objectbrowser.popupmenu.id.trigger.rename -objectbrowser.popupmenu.label.trigger.rename = \u91cd\u547d\u540d +objectbrowser.popupmenu.label.trigger.rename = \u91CD\u547D\u540D objectbrowser.popupmenu.mnemonics.trigger.rename = r -objectbrowser.popupmenu.tooltip.trigger.rename = \u91cd\u547d\u540d +objectbrowser.popupmenu.tooltip.trigger.rename = \u91CD\u547D\u540D #Edit View org.opengauss.objectbrowser.popupmenu.id.view.editview = org.opengauss.objectbrowser.popupmenu.id.view.editview -objectbrowser.popupmenu.label.editview = \u7f16\u8f91\u89c6\u56fe +objectbrowser.popupmenu.label.editview = \u7F16\u8F91\u89C6\u56FE objectbrowser.popupmenu.mnemonics.editview = e -objectbrowser.popupmenu.tooltip.editview = \u7f16\u8f91\u89c6\u56fe \ No newline at end of file +objectbrowser.popupmenu.tooltip.editview = \u7F16\u8F91\u89C6\u56FE \ No newline at end of file diff --git a/code/datastudio/src/org.opengauss.mppdbide.view/icons/debug/breakpoint_indicate.png b/code/datastudio/src/org.opengauss.mppdbide.view/icons/debug/breakpoint_indicate.png index bf1501cf404360d9719e0a90cd2b3dd9c48efe46..e978dff6fdc6ebaf1a0e9670844de7ff5d4a3cee 100644 Binary files a/code/datastudio/src/org.opengauss.mppdbide.view/icons/debug/breakpoint_indicate.png and b/code/datastudio/src/org.opengauss.mppdbide.view/icons/debug/breakpoint_indicate.png differ diff --git a/code/datastudio/src/org.opengauss.mppdbide.view/icons/debug/debug_fail.png b/code/datastudio/src/org.opengauss.mppdbide.view/icons/debug/debug_fail.png new file mode 100644 index 0000000000000000000000000000000000000000..4c3566ff562cd80c56c8f1c4c143f3f388ed573d Binary files /dev/null and b/code/datastudio/src/org.opengauss.mppdbide.view/icons/debug/debug_fail.png differ diff --git a/code/datastudio/src/org.opengauss.mppdbide.view/icons/debug/debug_pass.png b/code/datastudio/src/org.opengauss.mppdbide.view/icons/debug/debug_pass.png new file mode 100644 index 0000000000000000000000000000000000000000..451929c1a72a089169a6867c18af0c61c57bd2cd Binary files /dev/null and b/code/datastudio/src/org.opengauss.mppdbide.view/icons/debug/debug_pass.png differ diff --git a/code/datastudio/src/org.opengauss.mppdbide.view/icons/icon-remarkCoverage.png b/code/datastudio/src/org.opengauss.mppdbide.view/icons/icon-remarkCoverage.png new file mode 100644 index 0000000000000000000000000000000000000000..d90d6614769fe5d94cbd425aac517d878a007198 Binary files /dev/null and b/code/datastudio/src/org.opengauss.mppdbide.view/icons/icon-remarkCoverage.png differ diff --git a/code/datastudio/src/org.opengauss.mppdbide.view/src/org/opengauss/mppdbide/view/core/sourceeditor/AnnotationHelper.java b/code/datastudio/src/org.opengauss.mppdbide.view/src/org/opengauss/mppdbide/view/core/sourceeditor/AnnotationHelper.java index 41858e3f5f1c80e5c2cf830362c3ed0299316a83..06585fa76649645327d062c0536c7c16775a175d 100644 --- a/code/datastudio/src/org.opengauss.mppdbide.view/src/org/opengauss/mppdbide/view/core/sourceeditor/AnnotationHelper.java +++ b/code/datastudio/src/org.opengauss.mppdbide.view/src/org/opengauss/mppdbide/view/core/sourceeditor/AnnotationHelper.java @@ -52,10 +52,30 @@ public class AnnotationHelper { * debug position annotation type label */ public static final String DEBUG_POSITION_TYPE_LABEL = IMessagesConstants.DEBUG_POSITION_LABEL; + + /** + * debug position annotation type pass + */ + public static final String DEBUG_POSITION_TYPE_PASS = IMessagesConstants.DEBUG_POSITION_LABEL_PASS; + + /** + * debug position annotation type fail + */ + public static final String DEBUG_POSITION_TYPE_FAIL = IMessagesConstants.DEBUG_POSITION_LABEL_FAIL; /** * debug position annotation strategy id */ public static final String DEBUG_POSITION_STRATEGY_ID = "PLSQL_DEBUGGER_DEBUG_POSITION"; + + /** + * debug position annotation pass id + */ + public static final String DEBUG_POSITION_STRATEGY_PASS_ID = "PLSQL_DEBUGGER_DEBUG_POSITION_PASS"; + + /** + * debug position annotation fail id + */ + public static final String DEBUG_POSITION_STRATEGY_FAIL_ID = "PLSQL_DEBUGGER_DEBUG_POSITION_FAIL"; /** * debug position annotation rgb */ @@ -95,6 +115,27 @@ public class AnnotationHelper { */ public static final RGB ERROR_POSITION_RGB = new RGB(255, 255, 0); + /** + * pass position annotation rgb + */ + public static final int DEBUG_POSITION_LAYER_PASS = 4; + + /** + * pass position annotation rgb + */ + public static final RGB DEBUG_POSITION_PASS_RGB = new RGB(40, 255, 15); + + /** + * fail position annotation rgb + */ + public static final int DEBUG_POSITION_LAYER_FAIL = 5; + + /** + * fail position annotation rgb + */ + public static final RGB DEBUG_POSITION_FAIL_RGB = new RGB(255, 30, 25); + + /** * Title: AnnotationType enum this enum assocate with AnnotationWithLineNumber's instance * Description: The Class AnnotationType @@ -104,6 +145,10 @@ public class AnnotationHelper { BREAKPOINT_RGB), DEBUG_POSITION(DEBUG_POSITION_LAYER, DEBUG_POSITION_TYPE_LABEL, DEBUG_POSITION_STRATEGY_ID, DEBUG_POSITION_RGB), + DEBUG_POSITION_PASS(DEBUG_POSITION_LAYER_PASS, DEBUG_POSITION_TYPE_PASS, DEBUG_POSITION_STRATEGY_PASS_ID, + DEBUG_POSITION_PASS_RGB), + DEBUG_POSITION_FAIL(DEBUG_POSITION_LAYER_FAIL, DEBUG_POSITION_TYPE_FAIL, DEBUG_POSITION_STRATEGY_FAIL_ID, + DEBUG_POSITION_FAIL_RGB), ERROR(ERROR_LAYER, ERROR_TYPE_LABEL, ERROR_STRATEGY_ID, ERROR_RGB), ERROR_POSITION(ERROR_POSITION_LAYER, ERROR_POSITION_TYPE_LABEL, ERROR_POSITION_STRATEGY_ID, diff --git a/code/datastudio/src/org.opengauss.mppdbide.view/src/org/opengauss/mppdbide/view/core/sourceeditor/DebugFailPositionAnnotation.java b/code/datastudio/src/org.opengauss.mppdbide.view/src/org/opengauss/mppdbide/view/core/sourceeditor/DebugFailPositionAnnotation.java new file mode 100644 index 0000000000000000000000000000000000000000..3edca04ab123d793b346f35306cbff242b5c9bf4 --- /dev/null +++ b/code/datastudio/src/org.opengauss.mppdbide.view/src/org/opengauss/mppdbide/view/core/sourceeditor/DebugFailPositionAnnotation.java @@ -0,0 +1,93 @@ +/* + * Copyright (c) 2022 Huawei Technologies Co.,Ltd. + * + * openGauss is licensed under Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * 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. + * See the Mulan PSL v2 for more details. + */ + +package org.opengauss.mppdbide.view.core.sourceeditor; + +import java.util.Optional; + +import org.eclipse.swt.graphics.Image; +import org.eclipse.swt.graphics.RGB; +import org.opengauss.mppdbide.view.core.sourceeditor.AnnotationHelper.AnnotationType; +import org.opengauss.mppdbide.view.utils.icon.IiconPath; + +/** + * Title: class + * Description: The Class DebugFailPositionAnnotation. + * + * @since 3.0.0 + */ +public class DebugFailPositionAnnotation extends AnnotationWithLineNumber { + private static final AnnotationType ANNOTATION_TYPE_FAIL = AnnotationType.DEBUG_POSITION_FAIL; + private static final RGB DEBUGPOSITION_RGB = new RGB(255, 153, 51); + + /** + * Instantiates a new debug position annotation. + * + * @param line the line + */ + public DebugFailPositionAnnotation(int line) { + super(ANNOTATION_TYPE_FAIL.getStrategy(), false, "[Line : " + line, line); + } + + /** + * Gets the layer. + * + * @return the layer + */ + public static int getLayer() { + return ANNOTATION_TYPE_FAIL.getLayer(); + } + + /** + * Gets the image. + * + * @return the image + */ + public Optional getImage() { + return Optional.of(loadImage(IiconPath.ICO_EXECUTE_FAIL)); + } + + /** + * Gets the breakpoint rgb. + * + * @return the breakpoint rgb + */ + public static RGB getBreakpointRgb() { + return DEBUGPOSITION_RGB; + } + + /** + * Gets the strategyid. + * + * @return the strategyid + */ + public static String getStrategyid() { + return ANNOTATION_TYPE_FAIL.getStrategy(); + } + + /** + * Gets the typelabel. + * + * @return the typelabel + */ + public static String getTypelabel() { + return ANNOTATION_TYPE_FAIL.getTypeLabel(); + } + + @Override + public AnnotationType getAnnotationType() { + return ANNOTATION_TYPE_FAIL; + } +} diff --git a/code/datastudio/src/org.opengauss.mppdbide.view/src/org/opengauss/mppdbide/view/core/sourceeditor/DebugPassPositionAnnotation.java b/code/datastudio/src/org.opengauss.mppdbide.view/src/org/opengauss/mppdbide/view/core/sourceeditor/DebugPassPositionAnnotation.java new file mode 100644 index 0000000000000000000000000000000000000000..deb55352f4b8f1bed41eacaa03f7488f8f7746d1 --- /dev/null +++ b/code/datastudio/src/org.opengauss.mppdbide.view/src/org/opengauss/mppdbide/view/core/sourceeditor/DebugPassPositionAnnotation.java @@ -0,0 +1,95 @@ +/* + * Copyright (c) 2022 Huawei Technologies Co.,Ltd. + * + * openGauss is licensed under Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * 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. + * See the Mulan PSL v2 for more details. + */ + +package org.opengauss.mppdbide.view.core.sourceeditor; + +import java.util.Optional; + +import org.eclipse.swt.graphics.Image; +import org.eclipse.swt.graphics.RGB; +import org.opengauss.mppdbide.view.core.sourceeditor.AnnotationHelper.AnnotationType; +import org.opengauss.mppdbide.view.utils.icon.IiconPath; + +/** + * Title: class + * Description: The Class DebugPassPositionAnnotation. + * + * @since 3.0.0 + */ +public class DebugPassPositionAnnotation extends AnnotationWithLineNumber { + private static final AnnotationType ANNOTATION_TYPE_PASS = AnnotationType.DEBUG_POSITION_PASS; + private static final RGB DEBUGPOSITION_RGB = new RGB(255, 153, 51); + + /** + * Instantiates a new debug position annotation. + * + * @param line the line + */ + public DebugPassPositionAnnotation(int line) { + super(ANNOTATION_TYPE_PASS.getStrategy(), false, "[Line : " + line, line); + } + + /** + * Gets the layer. + * + * @return the layer + */ + public static int getLayer() { + return ANNOTATION_TYPE_PASS.getLayer(); + } + + /** + * Gets the image. + * + * @return the image + */ + public Optional getImage() { + return Optional.of( + loadImage(IiconPath.ICO_EXECUTE_PASS) + ); + } + + /** + * Gets the breakpoint rgb. + * + * @return the breakpoint rgb + */ + public static RGB getBreakpointRgb() { + return DEBUGPOSITION_RGB; + } + + /** + * Gets the strategyid. + * + * @return the strategyid + */ + public static String getStrategyid() { + return ANNOTATION_TYPE_PASS.getStrategy(); + } + + /** + * Gets the typelabel. + * + * @return the typelabel + */ + public static String getTypelabel() { + return ANNOTATION_TYPE_PASS.getTypeLabel(); + } + + @Override + public AnnotationType getAnnotationType() { + return ANNOTATION_TYPE_PASS; + } +} diff --git a/code/datastudio/src/org.opengauss.mppdbide.view/src/org/opengauss/mppdbide/view/core/sourceeditor/PLSourceEditorCore.java b/code/datastudio/src/org.opengauss.mppdbide.view/src/org/opengauss/mppdbide/view/core/sourceeditor/PLSourceEditorCore.java index b45bb730f3de1df20b62f77221f9c253725d4e05..186b6d93c8e81350eba50c25305c4bedb0af746e 100644 --- a/code/datastudio/src/org.opengauss.mppdbide.view/src/org/opengauss/mppdbide/view/core/sourceeditor/PLSourceEditorCore.java +++ b/code/datastudio/src/org.opengauss.mppdbide.view/src/org/opengauss/mppdbide/view/core/sourceeditor/PLSourceEditorCore.java @@ -15,9 +15,13 @@ package org.opengauss.mppdbide.view.core.sourceeditor; +import java.sql.SQLException; import java.util.ArrayList; import java.util.Iterator; +import java.util.List; import java.util.Locale; +import java.util.Optional; +import java.util.stream.Collectors; import javax.annotation.PreDestroy; @@ -63,8 +67,6 @@ import org.eclipse.jface.text.source.IOverviewRuler; import org.eclipse.jface.text.source.ISharedTextColors; import org.eclipse.jface.text.source.OverviewRuler; import org.eclipse.jface.text.source.SourceViewer; -import org.eclipse.jface.text.source.projection.ProjectionAnnotation; -import org.eclipse.jface.text.source.projection.ProjectionAnnotationModel; import org.eclipse.jface.text.source.projection.ProjectionSupport; import org.eclipse.jface.text.source.projection.ProjectionViewer; import org.eclipse.jface.util.IPropertyChangeListener; @@ -81,7 +83,6 @@ import org.eclipse.swt.events.KeyEvent; import org.eclipse.swt.events.KeyListener; import org.eclipse.swt.events.MouseAdapter; import org.eclipse.swt.events.MouseEvent; -import org.eclipse.swt.events.MouseListener; import org.eclipse.swt.events.SelectionEvent; import org.eclipse.swt.events.SelectionListener; import org.eclipse.swt.events.VerifyEvent; @@ -100,13 +101,18 @@ import org.eclipse.ui.texteditor.SourceViewerDecorationSupport; import org.opengauss.mppdbide.adapter.keywordssyntax.SQLSyntax; import org.opengauss.mppdbide.bl.serverdatacache.Database; +import org.opengauss.mppdbide.common.IConnection; +import org.opengauss.mppdbide.common.IConnectionProvider; +import org.opengauss.mppdbide.common.VersionHelper; import org.opengauss.mppdbide.gauss.sqlparser.SQLFoldingConstants; +import org.opengauss.mppdbide.utils.DebuggerStartVariable; import org.opengauss.mppdbide.utils.IMessagesConstants; import org.opengauss.mppdbide.utils.MPPDBIDEConstants; import org.opengauss.mppdbide.utils.loader.MessageConfigLoader; import org.opengauss.mppdbide.utils.logger.MPPDBIDELoggerUtility; +import org.opengauss.mppdbide.utils.vo.DebuggerStartInfoVo; import org.opengauss.mppdbide.view.core.SelectMenuItem; -import org.opengauss.mppdbide.view.handler.debug.DebugHandlerUtils; +import org.opengauss.mppdbide.view.handler.debug.DBConnectionProvider; import org.opengauss.mppdbide.view.handler.debug.DebugServiceHelper; import org.opengauss.mppdbide.view.prefernces.DSFormatterPreferencePage; import org.opengauss.mppdbide.view.prefernces.FormatterPreferenceKeys; @@ -123,6 +129,7 @@ import org.opengauss.mppdbide.view.uidisplay.UIDisplayState; import org.opengauss.mppdbide.view.uidisplay.uidisplayif.UIDisplayStateIf; import org.opengauss.mppdbide.view.utils.IUserPreference; import org.opengauss.mppdbide.view.utils.TerminalStatusBar; +import org.opengauss.mppdbide.view.utils.UIElement; import org.opengauss.mppdbide.view.utils.dialog.MPPDBIDEDialogs; import org.opengauss.mppdbide.view.utils.dialog.MPPDBIDEDialogs.MESSAGEDIALOGTYPE; import org.opengauss.mppdbide.view.utils.icon.IconUtility; @@ -135,6 +142,10 @@ import org.opengauss.mppdbide.view.workerjob.UIWorkerJob; * @since 3.0.0 */ public final class PLSourceEditorCore extends SelectMenuItem implements IPropertyChangeListener { + private static final String START_LINE = "startLine: "; + + private static final String END_LINE = "endLine: "; + private static final String FORMAT_COMMAND_ID = "org.opengauss.mppdbide.command.id.format"; private ECommandService commandService; @@ -337,6 +348,7 @@ public final class PLSourceEditorCore extends SelectMenuItem implements IPropert addPasteMenuItem(menu); addSelectAllMenuItem(menu); addToggleLineCommentMenuItem(menu); + addRemarkLineCommentMenuItem(menu); addToggleBlockCommentMenuItem(menu); addFormatMenuItem(menu); addExecStmtMenuItem(menu); @@ -1334,6 +1346,78 @@ public final class PLSourceEditorCore extends SelectMenuItem implements IPropert toggleLineComments.setImage(IconUtility.getIconImage(IiconPath.ICON_TOGGLE_LINE_COMMENTS, this.getClass())); } + private void addRemarkLineCommentMenuItem(Menu menuItem) { + toggleLineComments = new MenuItem(menuItem, SWT.PUSH); + toggleLineComments.setText(MessageConfigLoader + .getProperty(IMessagesConstants.REMARK_SHORTCUT_KEY_BINDING_TOGGLE_LINE_COMMENTS)); + toggleLineComments.addSelectionListener(new SelectionListener() { + + @Override + public void widgetSelected(SelectionEvent event) { + remarkLineCommentHandle(); + } + + @Override + public void widgetDefaultSelected(SelectionEvent event) { + + } + }); + toggleLineComments.setImage(IconUtility.getIconImage(IiconPath.ICON_REMARK_COVERAGE, this.getClass())); + } + + private void remarkLineCommentHandle() { + PLSourceEditor pl = UIElement.getInstance().getVisibleSourceViewer(); + IConnectionProvider prov = new DBConnectionProvider(pl.getDebugObject().getDatabase()); + Optional conn = prov.getFreeConnection(); + try { + boolean isPldebugger = VersionHelper.getDebuggerVersion(conn.get()).isPldebugger(); + if (isPldebugger) { + MPPDBIDEDialogs.generateOKMessageDialog(MESSAGEDIALOGTYPE.INFORMATION, true, + MessageConfigLoader.getProperty(IMessagesConstants.EXECDIALOG_HINT), + MessageConfigLoader.getProperty(IMessagesConstants.COVERAGE_CHECK)); + return; + } + ISelection res = viewer.getSelection(); + int start = Integer.valueOf(res.toString().split(START_LINE)[1].split(",")[0]); + String[] arr = res.toString().split(END_LINE); + int endLength = 1; + if (arr.length > 1) { + endLength = Integer.parseInt(arr[1].split(",")[0]); + } + List list = new ArrayList(); + for (int i = start; i < (endLength == 1 ? start + 1 : endLength + 1); i++) { + list.add(String.valueOf(i)); + } + long oid = pl.getDebugObject().getOid(); + DebuggerStartInfoVo startInfo = DebuggerStartVariable.getStartInfo(oid); + List remarkLines = startInfo.getRemarkList(); + List cancel = list.stream() + .filter(item -> remarkLines.contains(item)).collect(Collectors.toList()); + cancel.forEach(item -> viewer.getTextWidget() + .setLineBackground(Integer.parseInt(item), 1, + SQLSyntaxColorProvider.BACKGROUND_COLOR)); + List newRemark = list.stream() + .filter(item -> !remarkLines.contains(item)).collect(Collectors.toList()); + newRemark.forEach(item -> viewer.getTextWidget() + .setLineBackground(Integer.parseInt(item), 1, + SQLSyntaxColorProvider.BACKGROUND_COLOR_GREY)); + List oldRemark = remarkLines.stream() + .filter(item -> !list.contains(item)).collect(Collectors.toList()); + newRemark.addAll(oldRemark); + String remarLinesStr = newRemark.stream().map(String::valueOf).collect(Collectors.joining(",")); + startInfo.remarLinesStr = remarLinesStr; + DebuggerStartVariable.setStartInfo(oid, startInfo); + } catch (SQLException e) { + MPPDBIDELoggerUtility.error(e.getMessage()); + } finally { + try { + conn.get().close(); + } catch (SQLException e) { + MPPDBIDELoggerUtility.error(e.getMessage()); + } + } + } + /** * Adds the toggle block comment menu item. * diff --git a/code/datastudio/src/org.opengauss.mppdbide.view/src/org/opengauss/mppdbide/view/core/sourceeditor/SQLSyntaxColorProvider.java b/code/datastudio/src/org.opengauss.mppdbide.view/src/org/opengauss/mppdbide/view/core/sourceeditor/SQLSyntaxColorProvider.java index 7d67c146e265f73c9145b4586248a30ea2402c72..c9db2e2a83fe796b26dbd3fabcf21f968bec11bd 100644 --- a/code/datastudio/src/org.opengauss.mppdbide.view/src/org/opengauss/mppdbide/view/core/sourceeditor/SQLSyntaxColorProvider.java +++ b/code/datastudio/src/org.opengauss.mppdbide.view/src/org/opengauss/mppdbide/view/core/sourceeditor/SQLSyntaxColorProvider.java @@ -72,6 +72,11 @@ public class SQLSyntaxColorProvider { */ public static final Color BACKGROUND_COLOR = new Color(Display.getCurrent(), BACKGROUND); + /** + * The Constant REMAR_BACKGROUND_COLOR. + */ + public static final Color BACKGROUND_COLOR_GREY = new Color(Display.getCurrent(), new RGB(167, 169, 169)); + /** * use for debug position highlight */ diff --git a/code/datastudio/src/org.opengauss.mppdbide.view/src/org/opengauss/mppdbide/view/coverage/CoverageService.java b/code/datastudio/src/org.opengauss.mppdbide.view/src/org/opengauss/mppdbide/view/coverage/CoverageService.java new file mode 100644 index 0000000000000000000000000000000000000000..8204a82ec464692d765e68e817e6848c550fb9d7 --- /dev/null +++ b/code/datastudio/src/org.opengauss.mppdbide.view/src/org/opengauss/mppdbide/view/coverage/CoverageService.java @@ -0,0 +1,187 @@ +/* + * Copyright (c) 2022 Huawei Technologies Co.,Ltd. + * + * openGauss is licensed under Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * 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. + * See the Mulan PSL v2 for more details. + */ + +package org.opengauss.mppdbide.view.coverage; + +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.Comparator; +import java.util.List; +import java.util.stream.Collectors; + +import org.opengauss.mppdbide.common.IConnection; +import org.opengauss.mppdbide.debuger.annotation.ParseVo; +import org.opengauss.mppdbide.debuger.service.IService; +import org.opengauss.mppdbide.debuger.service.SourceCodeService; +import org.opengauss.mppdbide.utils.DebuggerStartVariable; +import org.opengauss.mppdbide.utils.logger.MPPDBIDELoggerUtility; +import org.opengauss.mppdbide.utils.vo.DebuggerEndInfoVo; +import org.opengauss.mppdbide.utils.vo.DebuggerStartInfoVo; +import org.opengauss.mppdbide.view.vo.CoverageVo; + +/** + * CoverageService + * + * @since 3.0.0 + */ +public class CoverageService implements IService { + private IConnection conn = null; + + public void setConn(IConnection conn) { + this.conn = conn; + } + + /** + * setRemarkInfo + * + * @param oid the oid + * @param rowLines the row line + * @throws SQLException the exception + */ + public void setRemarkInfo(long oid, String rowLines) throws SQLException { + DebuggerStartInfoVo startInfo = DebuggerStartVariable.getStartInfo(oid); + startInfo.remarLinesStr = rowLines; + DebuggerStartVariable.setStartInfo(oid, startInfo); + } + + /** + * getRemarkInfo + * + * @param oid the oid + * @return the value + * @throws SQLException the exception + */ + public String getRemarkInfo(long oid) throws SQLException { + DebuggerStartInfoVo startInfo = DebuggerStartVariable.getStartInfo(oid); + return startInfo.remarLinesStr; + } + + /** + * getCoverageInfoByOid + * + * @param oid the oid + * @return the value + */ + public List getCoverageInfoByOid(long oid) { + String sql = "select * from his_coverage where oid=" + oid + " order by cid desc;"; + try { + List res = this.queryList(sql, CoverageVo.class); + res.stream().forEach(cov -> { + if (cov.sourceCode != null) { + List toRunLines = SourceCodeService.CodeDescription.getRunLinesNums(cov.sourceCode); + cov.totalLineNum = toRunLines.size(); + cov.coverageLineNum = cov.getRunList().size(); + cov.coverageLinesArr = cov.getRunList(); + cov.totalPercent = Double.parseDouble( + String.format("%.2f", + ((double) cov.coverageLineNum * 100 / (double) cov.totalLineNum))) + + "%"; + // if not remark + if (cov.remarkLines == null || "".equals(cov.remarkLines)) { + cov.remarkLines = toRunLines.stream() + .map(String::valueOf).collect(Collectors.joining(",")); + cov.remarkLinesArr = cov.getRemarkList(); + } else { + cov.remarkLinesArr = cov.getRemarkList().stream().map(item -> + Integer.parseInt(item) + 1).sorted() + .map(item -> String.valueOf(item)).collect(Collectors.toList()); + } + cov.remarkLineNum = cov.remarkLinesArr.size(); + cov.remarkCoverageLinesArr = cov.coverageLinesArr.stream().map(item -> + Integer.parseInt(item) + 1 + "") + .filter(ite -> cov.remarkLinesArr.contains(ite)).collect(Collectors.toList()); + cov.remarkCoverageLineNum = cov.remarkCoverageLinesArr.size(); + cov.remarkPercent = Double.parseDouble( + String.format("%.2f", + ((double) cov.remarkCoverageLineNum * 100 / (double) cov.remarkLineNum))) + + "%"; + } + }); + return res.stream().sorted(Comparator.comparing(CoverageVo::getEndTime) + .reversed()).collect(Collectors.toList()); + } catch (SQLException e) { + return new ArrayList(); + } + } + + /** + * delCoverageInfoByOid + * + * @param oid the oid + * @param cid the cid + */ + public void delCoverageInfoByOid(long oid, Long cid) { + String sql = "delete from his_coverage where oid=" + oid + " and cid=" + cid + ";"; + try { + conn.getStatement(sql).executeUpdate(); + } catch (SQLException e) { + MPPDBIDELoggerUtility.error(e.getMessage()); + } + + List historyList = DebuggerStartVariable.getHistoryList(oid); + historyList = historyList.stream().filter(a -> !a.cid.equals(cid)).collect(Collectors.toList()); + DebuggerStartVariable.setHistoryList(oid, historyList); + } + + private Boolean executeSql(String sql) throws SQLException { + Boolean isFlag = false; + try (PreparedStatement ps = conn.getStatement(sql)) { + isFlag = ps.execute(sql); + } catch (SQLException e) { + throw new SQLException("sql execute exception!"); + } + return isFlag; + } + + private T queryObj(String sql, Class clazz) throws SQLException { + T t = null; + try (PreparedStatement ps = conn.getStatement(sql)) { + try (ResultSet rs = ps.executeQuery()) { + if (rs.next()) { + t = ParseVo.parse(rs, clazz); + } + } + } catch (SQLException e) { + throw new SQLException("sql execute exception!"); + } + return t; + } + + private List queryList(String sql, Class clazz) throws SQLException { + List list = null; + try (PreparedStatement ps = conn.getStatement(sql)) { + try (ResultSet rs = ps.executeQuery()) { + list = ParseVo.parseList(rs, clazz); + } + } catch (SQLException e) { + throw new SQLException("sql execute exception!"); + } + return list; + } + + @Override + public void closeService() { + try { + if (this.conn != null) { + this.conn.close(); + this.conn = null; + } + } catch (SQLException e) { + MPPDBIDELoggerUtility.warn("close conn with err:" + e.toString()); + } + } +} diff --git a/code/datastudio/src/org.opengauss.mppdbide.view/src/org/opengauss/mppdbide/view/dto/version/UIVersionDO.java b/code/datastudio/src/org.opengauss.mppdbide.view/src/org/opengauss/mppdbide/view/dto/version/UIVersionDO.java index 7bcd97262238ce45ee4f9c995734c7737cb85329..f86efb952db75e76b60ceb5e87c485080a87bcaf 100644 --- a/code/datastudio/src/org.opengauss.mppdbide.view/src/org/opengauss/mppdbide/view/dto/version/UIVersionDO.java +++ b/code/datastudio/src/org.opengauss.mppdbide.view/src/org/opengauss/mppdbide/view/dto/version/UIVersionDO.java @@ -29,7 +29,7 @@ public class UIVersionDO { private static final String RELEASE_NAME = "Data Studio "; private static final int VERSION = 3; private static final String DOT = "."; - private static final int SUB_VERSION = 0; + private static final int SUB_VERSION = 1; private static final int SUB_SUB_VERSION = 0; private static final String MINOR_VERSION = ""; diff --git a/code/datastudio/src/org.opengauss.mppdbide.view/src/org/opengauss/mppdbide/view/handler/ExecuteEditorItem.java b/code/datastudio/src/org.opengauss.mppdbide.view/src/org/opengauss/mppdbide/view/handler/ExecuteEditorItem.java index cdcecad51bc26a5d75d8b2dfccfc904c014012bd..dc2a0dc053ee1c56b15744aea0c8438eb2f2827e 100644 --- a/code/datastudio/src/org.opengauss.mppdbide.view/src/org/opengauss/mppdbide/view/handler/ExecuteEditorItem.java +++ b/code/datastudio/src/org.opengauss.mppdbide.view/src/org/opengauss/mppdbide/view/handler/ExecuteEditorItem.java @@ -15,6 +15,7 @@ package org.opengauss.mppdbide.view.handler; +import java.sql.SQLException; import java.util.ArrayList; import javax.inject.Inject; @@ -35,10 +36,13 @@ import org.opengauss.mppdbide.adapter.keywordssyntax.SQLSyntax; import org.opengauss.mppdbide.bl.errorlocator.IErrorLocator; import org.opengauss.mppdbide.bl.serverdatacache.Database; import org.opengauss.mppdbide.bl.serverdatacache.DatabaseUtils; +import org.opengauss.mppdbide.bl.serverdatacache.DebugObjects; import org.opengauss.mppdbide.bl.serverdatacache.IDebugObject; import org.opengauss.mppdbide.bl.serverdatacache.OBJECTTYPE; import org.opengauss.mppdbide.bl.serverdatacache.ObjectChange; import org.opengauss.mppdbide.bl.serverdatacache.ObjectParameter; +import org.opengauss.mppdbide.common.IConnection; +import org.opengauss.mppdbide.common.VersionHelper; import org.opengauss.mppdbide.presentation.CanContextContinueExecuteRule; import org.opengauss.mppdbide.presentation.IExecutionContext; import org.opengauss.mppdbide.presentation.IResultDisplayUIManager; @@ -56,6 +60,7 @@ import org.opengauss.mppdbide.view.functionchange.ExecuteWrapper; import org.opengauss.mppdbide.view.functionchange.ObjectChangeEvent; import org.opengauss.mppdbide.view.functionchange.ObjectChangeEvent.ButtonPressed; import org.opengauss.mppdbide.view.functionchange.ObjectChangeWorker; +import org.opengauss.mppdbide.view.handler.debug.DBConnectionProvider; import org.opengauss.mppdbide.view.terminal.TerminalQueryExecutionWorker; import org.opengauss.mppdbide.view.terminal.executioncontext.FuncProcEditorTerminalExecutionContext; import org.opengauss.mppdbide.view.ui.PLSourceEditor; @@ -89,6 +94,8 @@ public class ExecuteEditorItem implements ExecuteWrapper { private static final String ERROR_POSITION_IDENTIFIER = "Position:"; + private volatile boolean isPldebugger = true; + /** * Execute. */ @@ -106,7 +113,16 @@ public class ExecuteEditorItem implements ExecuteWrapper { } editor.setExecuteInProgress(true); editor.enabledisableTextWidget(false); - IDebugObject debugObject = editor.getDebugObject(); + DebugObjects debugObject = null; + checkVersion(editor); + if (editor.getDebugObject() instanceof DebugObjects) { + debugObject = (DebugObjects) editor.getDebugObject(); + if (!isPldebugger) { + debugObject.setUsagehint(MessageConfigLoader.getProperty(IMessagesConstants.COVERAGE_HINT)); + } else { + debugObject.setUsagehint(""); + } + } ObjectChangeWorker objWorker = new ObjectChangeWorker("Function Change Worker", null, debugObject, editor, this, IMessagesConstants.FUNCTN_CHANGE_MSG, IMessagesConstants.FUNCTN_CHANGE_OVERWRITE); @@ -146,6 +162,24 @@ public class ExecuteEditorItem implements ExecuteWrapper { } } + private void checkVersion(PLSourceEditor editor) { + IConnection conn = null; + try { + conn = new DBConnectionProvider(editor.getDebugObject().getDatabase()).getValidFreeConnection(); + isPldebugger = VersionHelper.getDebuggerVersion(conn).isPldebugger(); + } catch (SQLException e) { + MPPDBIDELoggerUtility.error(e.getMessage()); + } finally { + if (conn != null) { + try { + conn.close(); + } catch (SQLException e) { + MPPDBIDELoggerUtility.error(e.getMessage()); + } + } + } + } + /** * Execute if code is changed. * diff --git a/code/datastudio/src/org.opengauss.mppdbide.view/src/org/opengauss/mppdbide/view/handler/ViewSourceDebugObjectHandler.java b/code/datastudio/src/org.opengauss.mppdbide.view/src/org/opengauss/mppdbide/view/handler/ViewSourceDebugObjectHandler.java index 7c1452899022c49e22a8efa8fb699c717eae7aff..5d741590531ccdeaa21862dfa54e7de0df05658f 100644 --- a/code/datastudio/src/org.opengauss.mppdbide.view/src/org/opengauss/mppdbide/view/handler/ViewSourceDebugObjectHandler.java +++ b/code/datastudio/src/org.opengauss.mppdbide.view/src/org/opengauss/mppdbide/view/handler/ViewSourceDebugObjectHandler.java @@ -19,6 +19,7 @@ import org.eclipse.e4.core.di.annotations.Execute; import org.opengauss.mppdbide.bl.serverdatacache.IDebugObject; import org.opengauss.mppdbide.bl.serverdatacache.ObjectChange; +import org.opengauss.mppdbide.utils.DebuggerStartVariable; import org.opengauss.mppdbide.utils.IMessagesConstants; import org.opengauss.mppdbide.utils.exceptions.DatabaseCriticalException; import org.opengauss.mppdbide.utils.exceptions.DatabaseOperationException; @@ -54,6 +55,10 @@ public class ViewSourceDebugObjectHandler implements ExecuteWrapper { PLSourceEditor editorObject = null; Object partObject = UIElement.getInstance().getActivePartObject(); IDebugObject debugObject = IHandlerUtilities.getSelectedDebugObject(); + if (debugObject != null) { + Long oid = debugObject.getOid(); + DebuggerStartVariable.getStartInfo(oid).remarLinesStr = ""; + } if (debugObject != null) { if (!(UIElement.getInstance().isEditorExistByDbgObj(debugObject))) { try { @@ -112,7 +117,7 @@ public class ViewSourceDebugObjectHandler implements ExecuteWrapper { /** * Handle exception. * - * @param e the e + * @param e the e * @param event the event */ @Override diff --git a/code/datastudio/src/org.opengauss.mppdbide.view/src/org/opengauss/mppdbide/view/handler/debug/ContinueDebugHandler.java b/code/datastudio/src/org.opengauss.mppdbide.view/src/org/opengauss/mppdbide/view/handler/debug/ContinueDebugHandler.java index 64768372e27d95c7a4ddda59448b65ecb3d3ec81..0c96f7e8e3b032a8617c3197c8e57f82708f49db 100644 --- a/code/datastudio/src/org.opengauss.mppdbide.view/src/org/opengauss/mppdbide/view/handler/debug/ContinueDebugHandler.java +++ b/code/datastudio/src/org.opengauss.mppdbide.view/src/org/opengauss/mppdbide/view/handler/debug/ContinueDebugHandler.java @@ -23,6 +23,7 @@ import org.eclipse.e4.core.di.annotations.Execute; import org.opengauss.mppdbide.debuger.exception.DebugExitException; import org.opengauss.mppdbide.debuger.vo.PositionVo; +import org.opengauss.mppdbide.utils.VariableRunLine; /** * Title: class @@ -53,6 +54,7 @@ public class ContinueDebugHandler extends BaseDebugStepHandler { @Override public Optional debugRun() throws SQLException, DebugExitException { + VariableRunLine.isContinue = true; return getDebugService().continueExec(); } } diff --git a/code/datastudio/src/org.opengauss.mppdbide.view/src/org/opengauss/mppdbide/view/handler/debug/DebugHandlerUtils.java b/code/datastudio/src/org.opengauss.mppdbide.view/src/org/opengauss/mppdbide/view/handler/debug/DebugHandlerUtils.java index 9c8d0ec75ac1f1296e6a14afde51bec5882337eb..ca73d9fa534afe35f32fdf7a288f7cfc98bdf41e 100644 --- a/code/datastudio/src/org.opengauss.mppdbide.view/src/org/opengauss/mppdbide/view/handler/debug/DebugHandlerUtils.java +++ b/code/datastudio/src/org.opengauss.mppdbide.view/src/org/opengauss/mppdbide/view/handler/debug/DebugHandlerUtils.java @@ -23,7 +23,9 @@ import org.eclipse.e4.ui.model.application.ui.MUIElement; import org.opengauss.mppdbide.bl.serverdatacache.IDebugObject; import org.opengauss.mppdbide.eclipse.dependent.EclipseInjections; +import org.opengauss.mppdbide.utils.VariableRunLine; import org.opengauss.mppdbide.view.handler.IHandlerUtilities; +import org.opengauss.mppdbide.view.handler.debug.ui.UpdateDebugPositionTask; import org.opengauss.mppdbide.view.prefernces.PreferenceWrapper; import org.opengauss.mppdbide.view.ui.PLSourceEditor; import org.opengauss.mppdbide.view.utils.UIElement; @@ -94,6 +96,16 @@ public class DebugHandlerUtils { this.isDebugStart = isDebugStart; } + /** + * The terminate Debug + * + * @param + */ + public void terminateDebug() { + VariableRunLine.isTerminate = false; + UpdateDebugPositionTask.terminateDebug(); + } + /** * description: this use to show debug view partstack * diff --git a/code/datastudio/src/org.opengauss.mppdbide.view/src/org/opengauss/mppdbide/view/handler/debug/DebugHistoryCoverageHandler.java b/code/datastudio/src/org.opengauss.mppdbide.view/src/org/opengauss/mppdbide/view/handler/debug/DebugHistoryCoverageHandler.java new file mode 100644 index 0000000000000000000000000000000000000000..915238c243773871d0084a62b411217b8b874c35 --- /dev/null +++ b/code/datastudio/src/org.opengauss.mppdbide.view/src/org/opengauss/mppdbide/view/handler/debug/DebugHistoryCoverageHandler.java @@ -0,0 +1,105 @@ +/* + * Copyright (c) 2022 Huawei Technologies Co.,Ltd. + * + * openGauss is licensed under Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * 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. + * See the Mulan PSL v2 for more details. + */ + +package org.opengauss.mppdbide.view.handler.debug; + +import java.sql.SQLException; + +import org.eclipse.e4.core.di.annotations.CanExecute; +import org.eclipse.e4.core.di.annotations.Execute; +import org.eclipse.swt.widgets.Display; +import org.eclipse.swt.widgets.Shell; +import org.opengauss.mppdbide.bl.serverdatacache.Server; +import org.opengauss.mppdbide.common.IConnection; +import org.opengauss.mppdbide.common.VersionHelper; +import org.opengauss.mppdbide.utils.IMessagesConstants; +import org.opengauss.mppdbide.utils.loader.MessageConfigLoader; +import org.opengauss.mppdbide.utils.logger.MPPDBIDELoggerUtility; +import org.opengauss.mppdbide.view.ui.CoverageHistory; +import org.opengauss.mppdbide.view.ui.PLSourceEditor; +import org.opengauss.mppdbide.view.utils.UIElement; +import org.opengauss.mppdbide.view.utils.dialog.MPPDBIDEDialogs; +import org.opengauss.mppdbide.view.utils.dialog.MPPDBIDEDialogs.MESSAGEDIALOGTYPE; + +/** + * DebugHistoryCoverageHandler + * + * @author wm + * @since 2022-09-21 + */ +public class DebugHistoryCoverageHandler { + private DebugHandlerUtils debugUtils = DebugHandlerUtils.getInstance(); + private DebugServiceHelper serviceHelper = DebugServiceHelper.getInstance(); + private PLSourceEditor plSourceEditor; + + /** + * description: can execute + * + * @return boolean true if can + */ + @CanExecute + public boolean canExecute() { + return debugUtils.canStartDebug(); + } + + /** + * description: excute the command + * + * @return void + */ + @Execute + public void execute() { + plSourceEditor = UIElement.getInstance().getVisibleSourceViewer(); + IConnection conn = null; + try { + conn = new DBConnectionProvider(plSourceEditor.getDebugObject().getDatabase()).getValidFreeConnection(); + boolean isPldebugger = VersionHelper.getDebuggerVersion(conn).isPldebugger(); + if (isPldebugger) { + MPPDBIDEDialogs.generateOKMessageDialog(MESSAGEDIALOGTYPE.INFORMATION, true, + MessageConfigLoader.getProperty(IMessagesConstants.EXECDIALOG_HINT), + MessageConfigLoader.getProperty(IMessagesConstants.COVERAGE_CHECK)); + return; + } + } catch (SQLException e) { + MPPDBIDELoggerUtility.error(e.getMessage()); + } finally { + try { + if (conn != null) { + conn.close(); + } + } catch (SQLException e) { + MPPDBIDELoggerUtility.error(e.getMessage()); + } + } + MPPDBIDELoggerUtility.error("start debugint:" + "null"); + debugUtils.initDebugSourceView(); + Shell shell = Display.getDefault().getActiveShell(); + Server server = plSourceEditor.getDatabase().getServer(); + CoverageHistory coverageHistory = new CoverageHistory(shell, + server.getServerConnectionInfo().getConectionName()); + coverageHistory.open(); + } + + private void showMsg(String msg) { + Display.getDefault().asyncExec(new Runnable() { + @Override + public void run() { + MPPDBIDEDialogs.generateOKMessageDialog(MESSAGEDIALOGTYPE.WARNING, + true, + "get debug history coverage data warning", msg); + } + }); + } +} diff --git a/code/datastudio/src/org.opengauss.mppdbide.view/src/org/opengauss/mppdbide/view/handler/debug/DebugServiceHelper.java b/code/datastudio/src/org.opengauss.mppdbide.view/src/org/opengauss/mppdbide/view/handler/debug/DebugServiceHelper.java index aae740dc58d0023c19ffdf04c61fb810aeeb05ff..a91417a391e60c83c3bb14afcd0f9a1706814c0d 100644 --- a/code/datastudio/src/org.opengauss.mppdbide.view/src/org/opengauss/mppdbide/view/handler/debug/DebugServiceHelper.java +++ b/code/datastudio/src/org.opengauss.mppdbide.view/src/org/opengauss/mppdbide/view/handler/debug/DebugServiceHelper.java @@ -21,6 +21,7 @@ import java.util.Optional; import org.eclipse.jface.preference.PreferenceStore; import org.opengauss.mppdbide.bl.serverdatacache.IDebugObject; +import org.opengauss.mppdbide.common.IConnectionProvider; import org.opengauss.mppdbide.debuger.event.Event; import org.opengauss.mppdbide.debuger.event.IHandlerManger; import org.opengauss.mppdbide.debuger.event.Event.EventMessage; @@ -29,12 +30,15 @@ import org.opengauss.mppdbide.debuger.service.ServiceFactory; import org.opengauss.mppdbide.debuger.service.SourceCodeService; import org.opengauss.mppdbide.debuger.service.WrappedDebugService; import org.opengauss.mppdbide.debuger.vo.FunctionVo; +import org.opengauss.mppdbide.debuger.service.DebuggerReportService; import org.opengauss.mppdbide.debuger.vo.SourceCodeVo; import org.opengauss.mppdbide.utils.IMessagesConstants; import org.opengauss.mppdbide.utils.MPPDBIDEConstants; import org.opengauss.mppdbide.utils.loader.MessageConfigLoader; import org.opengauss.mppdbide.view.core.sourceeditor.BreakpointAnnotation; +import org.opengauss.mppdbide.view.coverage.CoverageService; import org.opengauss.mppdbide.view.prefernces.PreferenceWrapper; +import org.opengauss.mppdbide.view.service.CoverageServiceFactory; /** * Title: class @@ -46,10 +50,13 @@ public class DebugServiceHelper { private static DebugServiceHelper debugServiceHelper = new DebugServiceHelper(); private IDebugObject debugObject = null; private ServiceFactory serviceFactory = null; + private CoverageServiceFactory coverageServiceFactory = null; private WrappedDebugService debugService = null; + private DebuggerReportService debuggerReportService = null; private FunctionVo functionVo = null; private QueryService queryService = null; private SourceCodeService codeService = null; + private CoverageService coverageService = null; private DebugServiceHelper() { } @@ -75,21 +82,28 @@ public class DebugServiceHelper { return false; } if (!isCommonDatabase(debugObject)) { - serviceFactory = new ServiceFactory(new DBConnectionProvider(debugObject.getDatabase())); + IConnectionProvider provider = new DBConnectionProvider(debugObject.getDatabase()); + serviceFactory = new ServiceFactory(provider); + coverageServiceFactory = new CoverageServiceFactory(provider); checkSupportDebug(); queryService = serviceFactory.getQueryService(); functionVo = queryService.queryFunction(debugObject.getName()); + debuggerReportService = DebuggerReportService.getInstance(); + debuggerReportService.setAttr(provider, functionVo); debugService = new WrappedDebugService(serviceFactory.getDebugService(functionVo)); debugService.addHandler(new UiEventHandler()); debugService.addHandler(new DebugEventHandler()); codeService = serviceFactory.getCodeService(); + coverageService = coverageServiceFactory.getCoverageService(); Optional sourceCode = queryService.getSourceCode(functionVo.oid); if (sourceCode.isPresent()) { codeService.setBaseCode(sourceCode.get().getSourceCode()); + debuggerReportService.setBaseCode(codeService.getBaseCodeDesc()); } else { throw new SQLException("get source code failed!"); } codeService.setTotalCode(debugObject.getSourceCode().getCode()); + debuggerReportService.setTotalCode(codeService.getTotalCodeDesc()); this.debugObject = debugObject; } if (debugService != null) { @@ -144,6 +158,11 @@ public class DebugServiceHelper { return queryService; } + public CoverageService getCoverageService() { + return coverageService; + } + + /** * description: get code service * diff --git a/code/datastudio/src/org.opengauss.mppdbide.view/src/org/opengauss/mppdbide/view/handler/debug/StartDebugHandler.java b/code/datastudio/src/org.opengauss.mppdbide.view/src/org/opengauss/mppdbide/view/handler/debug/StartDebugHandler.java index 25039542cd15cb3a0c13ab0522ada49c886e332c..4573e93e87256eca7c6896cc8482f7d80c81ae51 100644 --- a/code/datastudio/src/org.opengauss.mppdbide.view/src/org/opengauss/mppdbide/view/handler/debug/StartDebugHandler.java +++ b/code/datastudio/src/org.opengauss.mppdbide.view/src/org/opengauss/mppdbide/view/handler/debug/StartDebugHandler.java @@ -17,19 +17,19 @@ package org.opengauss.mppdbide.view.handler.debug; import java.sql.SQLException; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; import java.util.stream.Collectors; import org.eclipse.e4.core.di.annotations.CanExecute; import org.eclipse.e4.core.di.annotations.Execute; import org.eclipse.swt.widgets.Display; - import org.opengauss.mppdbide.adapter.keywordssyntax.SQLSyntax; import org.opengauss.mppdbide.bl.serverdatacache.DefaultParameter; import org.opengauss.mppdbide.bl.serverdatacache.IDebugObject; import org.opengauss.mppdbide.bl.serverdatacache.ObjectParameter; import org.opengauss.mppdbide.bl.serverdatacache.ObjectParameter.PARAMETERTYPE; -import org.opengauss.mppdbide.debuger.service.DebugService; +import org.opengauss.mppdbide.debuger.service.DbeDebugService; import org.opengauss.mppdbide.debuger.service.WrappedDebugService; import org.opengauss.mppdbide.utils.IMessagesConstants; import org.opengauss.mppdbide.utils.exceptions.DatabaseCriticalException; @@ -90,6 +90,11 @@ public class StartDebugHandler { plSourceEditor.setExecuteInProgress(true); debugUtils.showAllDebugView(true); startInputParamDialog(); + PLSourceEditor pl = UIElement.getInstance().getVisibleSourceViewer(); + List params = Arrays.asList(pl.getDebugObject().getObjectParameters()); + long oid = pl.getDebugObject().getOid(); + List paramNames = params.stream().map(item -> item.getName()).distinct().collect(Collectors.toList()); + DbeDebugService.map.put(oid, paramNames); } private void startInputParamDialog() { @@ -175,10 +180,10 @@ public class StartDebugHandler { private List getDebugParams(List serverParams) throws DatabaseOperationException { List filterInParams = serverParams.stream().filter( param -> (PARAMETERTYPE.IN.equals(param.getDefaultParameterMode()) - || PARAMETERTYPE.INOUT.equals(param.getDefaultParameterMode())) - ).collect(Collectors.toList()); + || PARAMETERTYPE.INOUT.equals(param.getDefaultParameterMode())) + ).collect(Collectors.toList()); List params = new ArrayList<>(filterInParams.size()); - for (int i = 0; i < filterInParams.size(); i ++) { + for (int i = 0; i < filterInParams.size(); i++) { DefaultParameter defaultParameter = filterInParams.get(i); if ("refcursor".equals(defaultParameter.getDefaultParameterType())) { throw new DatabaseOperationException( diff --git a/code/datastudio/src/org.opengauss.mppdbide.view/src/org/opengauss/mppdbide/view/handler/debug/TerminateDebugHandler.java b/code/datastudio/src/org.opengauss.mppdbide.view/src/org/opengauss/mppdbide/view/handler/debug/TerminateDebugHandler.java index 5308fc591c1ecafe839ec32317f486bb8327ac28..7f3deffb5462abf3bba297f081fd2ff78c9012e3 100644 --- a/code/datastudio/src/org.opengauss.mppdbide.view/src/org/opengauss/mppdbide/view/handler/debug/TerminateDebugHandler.java +++ b/code/datastudio/src/org.opengauss.mppdbide.view/src/org/opengauss/mppdbide/view/handler/debug/TerminateDebugHandler.java @@ -17,8 +17,9 @@ package org.opengauss.mppdbide.view.handler.debug; import org.eclipse.e4.core.di.annotations.CanExecute; import org.eclipse.e4.core.di.annotations.Execute; - +import org.opengauss.mppdbide.utils.DebuggerStartVariable; import org.opengauss.mppdbide.utils.logger.MPPDBIDELoggerUtility; +import org.opengauss.mppdbide.utils.vo.DebuggerStartInfoVo; import org.opengauss.mppdbide.view.ui.PLSourceEditor; import org.opengauss.mppdbide.view.utils.UIElement; @@ -53,11 +54,16 @@ public class TerminateDebugHandler { MPPDBIDELoggerUtility.error("terminate debugint:" + "null"); debugUtils.showAllDebugView(false); PLSourceEditor plSourceEditor = UIElement.getInstance().getVisibleSourceViewer(); + Long oid = plSourceEditor.getDebugObject().getOid(); + DebuggerStartInfoVo debuggerStartInfoVo = DebuggerStartVariable.getStartInfo(oid); + debuggerStartInfoVo.isMakeReport = false; + DebuggerStartVariable.setStartInfo(oid, debuggerStartInfoVo); if (plSourceEditor != null) { plSourceEditor.setEditable(true); plSourceEditor.setExecuteInProgress(false); } debugUtils.setDebugStart(false); + debugUtils.terminateDebug(); serviceHelper.closeService(); } } diff --git a/code/datastudio/src/org.opengauss.mppdbide.view/src/org/opengauss/mppdbide/view/handler/debug/chain/ServerExitChain.java b/code/datastudio/src/org.opengauss.mppdbide.view/src/org/opengauss/mppdbide/view/handler/debug/chain/ServerExitChain.java index a77b0468a51f76e496749664a9ddb55220f22e6e..7fd9878197eb53cbee686e84580bdba32cc80e82 100644 --- a/code/datastudio/src/org.opengauss.mppdbide.view/src/org/opengauss/mppdbide/view/handler/debug/chain/ServerExitChain.java +++ b/code/datastudio/src/org.opengauss.mppdbide.view/src/org/opengauss/mppdbide/view/handler/debug/chain/ServerExitChain.java @@ -19,7 +19,9 @@ import org.eclipse.swt.widgets.Display; import org.opengauss.mppdbide.debuger.event.Event; import org.opengauss.mppdbide.debuger.event.Event.EventMessage; +import org.opengauss.mppdbide.debuger.service.DebuggerReportService; import org.opengauss.mppdbide.debuger.service.chain.IMsgChain; +import org.opengauss.mppdbide.utils.VariableRunLine; import org.opengauss.mppdbide.utils.logger.MPPDBIDELoggerUtility; import org.opengauss.mppdbide.view.handler.debug.DebugHandlerUtils; import org.opengauss.mppdbide.view.handler.debug.DebugServiceHelper; @@ -34,6 +36,10 @@ import org.opengauss.mppdbide.view.handler.debug.ui.UpdateHighlightLineNumTask; * @since 3.0.0 */ public class ServerExitChain extends IMsgChain { + /** + * The Debugger Report Service + */ + public DebuggerReportService reportService = DebuggerReportService.getInstance(); private boolean isResultUpdated = false; private DebugHandlerUtils debugUtils = DebugHandlerUtils.getInstance(); private DebugServiceHelper serviceHelper = DebugServiceHelper.getInstance(); @@ -52,6 +58,13 @@ public class ServerExitChain extends IMsgChain { } Display.getDefault().asyncExec(new UpdateDebugPositionTask(-1)); Display.getDefault().asyncExec(new UpdateHighlightLineNumTask()); + + if (!VariableRunLine.isPldebugger) { + reportService.makeReport(); + if (VariableRunLine.isContinue != null && VariableRunLine.isContinue) { + Display.getDefault().asyncExec(() -> UpdateDebugPositionTask.continueDebug()); + } + } if (!isResultUpdated) { isResultUpdated = true; Display.getDefault().asyncExec(new UpdateDebugResultTask(event)); diff --git a/code/datastudio/src/org.opengauss.mppdbide.view/src/org/opengauss/mppdbide/view/handler/debug/ui/UpdateDebugPositionTask.java b/code/datastudio/src/org.opengauss.mppdbide.view/src/org/opengauss/mppdbide/view/handler/debug/ui/UpdateDebugPositionTask.java index 16dd684bd01bfddc1ff1e5e79133a2d07db08ecb..1e266c026b3869b19a161952b2f42ee0488ae49b 100644 --- a/code/datastudio/src/org.opengauss.mppdbide.view/src/org/opengauss/mppdbide/view/handler/debug/ui/UpdateDebugPositionTask.java +++ b/code/datastudio/src/org.opengauss.mppdbide.view/src/org/opengauss/mppdbide/view/handler/debug/ui/UpdateDebugPositionTask.java @@ -15,9 +15,22 @@ package org.opengauss.mppdbide.view.handler.debug.ui; -import org.eclipse.jface.text.BadLocationException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.List; +import java.util.Locale; +import java.util.Set; +import org.eclipse.jface.text.BadLocationException; +import org.opengauss.mppdbide.debuger.service.SourceCodeService; +import org.opengauss.mppdbide.debuger.vo.VersionVo; +import org.opengauss.mppdbide.utils.DebuggerStartVariable; +import org.opengauss.mppdbide.utils.VariableRunLine; +import org.opengauss.mppdbide.utils.exceptions.DatabaseCriticalException; +import org.opengauss.mppdbide.utils.exceptions.DatabaseOperationException; +import org.opengauss.mppdbide.utils.exceptions.MPPDBIDEException; import org.opengauss.mppdbide.utils.logger.MPPDBIDELoggerUtility; +import org.opengauss.mppdbide.view.core.sourceeditor.SQLSyntaxColorProvider; import org.opengauss.mppdbide.view.ui.PLSourceEditor; import org.opengauss.mppdbide.view.utils.UIElement; @@ -28,10 +41,20 @@ import org.opengauss.mppdbide.view.utils.UIElement; * @since 3.0.0 */ public class UpdateDebugPositionTask implements Runnable { + private static final String BEGIN = "BEGIN"; + + private static final String END = "END;"; + private int showLine = -1; + /** + * The Update Debug Position Task + * + * @param showLine the show line + */ public UpdateDebugPositionTask(int showLine) { this.showLine = showLine; + VariableRunLine.passLine.add(showLine); } @Override @@ -40,14 +63,163 @@ public class UpdateDebugPositionTask implements Runnable { if (plSourceEditor == null) { return; } + Boolean isPlDebugger = true; + try { + VersionVo vo = new VersionVo(); + vo.version = plSourceEditor.getDatabase().getServerVersion(); + isPlDebugger = vo.isPldebugger(); + if (isPlDebugger) { + plSourceEditor.removeDebugPosition(); + if (showLine >= 0) { + plSourceEditor.createDebugPosition(showLine); + } + } else { + // dbedebugger + if (VariableRunLine.isTerminate) { + debDebuggerRemark(plSourceEditor); + } + } + } catch (MPPDBIDEException e) { + MPPDBIDELoggerUtility.error("get version failed,err=" + e.getMessage()); + } catch (BadLocationException e) { + MPPDBIDELoggerUtility.error("set debugPostion at " + showLine + " failed,err=" + e.getMessage()); + } + } + /** + * The terminate Debug + * + * @return the PLSourceEditor + */ + public static PLSourceEditor terminateDebug() { + PLSourceEditor plSourceEditor = UIElement.getInstance().getVisibleSourceViewer(); plSourceEditor.removeDebugPosition(); + long oid = plSourceEditor.getDebugObject().getOid(); + String covs = DebuggerStartVariable.getStartInfo(oid).remarLinesStr; + if (covs != null && !covs.isEmpty()) { + List lines = Arrays.asList(covs.split(",")); + lines.forEach(item -> { + plSourceEditor.getSourceEditorCore().getSourceViewer() + .getTextWidget() + .setLineBackground(Integer.parseInt(item), 1, + SQLSyntaxColorProvider.BACKGROUND_COLOR_GREY); + }); + } + return plSourceEditor; + } + + /** + * The continue Debug + * + * @return void + */ + public static void continueDebug() { try { + Thread.sleep(200); + } catch (InterruptedException e) { + MPPDBIDELoggerUtility.error(e.getMessage()); + } + PLSourceEditor pl = terminateDebug(); + getToatlLineNo(pl).forEach(item -> { + try { + if (VariableRunLine.runList.contains(String.valueOf(item))) { + pl.createPassPosition(item); + } else { + pl.createFailPosition(item); + } + } catch (BadLocationException e) { + MPPDBIDELoggerUtility.error(e.getMessage()); + } + }); + } + + private void remarkBack(PLSourceEditor plSourceEditor) { + long oid = plSourceEditor.getDebugObject().getOid(); + String covs = DebuggerStartVariable.getStartInfo(oid).remarLinesStr; + if (covs != null && !covs.isEmpty()) { + List lines = Arrays.asList(covs.split(",")); + lines.forEach(item -> { + if (!String.valueOf(showLine).equals(item)) { + plSourceEditor.getSourceEditorCore().getSourceViewer() + .getTextWidget() + .setLineBackground(Integer.parseInt(item), 1, + SQLSyntaxColorProvider.BACKGROUND_COLOR_GREY); + } + }); + } + } + + private void debDebuggerRemark(PLSourceEditor plSourceEditor) { + plSourceEditor.removeDebugPosition(); + try { + remarkBack(plSourceEditor); if (showLine >= 0) { plSourceEditor.createDebugPosition(showLine); } + remark(showLine, plSourceEditor); } catch (BadLocationException e) { MPPDBIDELoggerUtility.error("set debugPostion at " + showLine + " failed,err=" + e.getMessage()); + } catch (Exception e) { + MPPDBIDELoggerUtility.error(e.getMessage()); + } + } + + private void remark(int line, PLSourceEditor plSourceEditor) { + getToatlLineNo(plSourceEditor).forEach(item -> { + try { + if (showLine != item && VariableRunLine.passLine.contains(item)) { + plSourceEditor.createPassPosition(item); + } else { + if (showLine != item) { + plSourceEditor.createFailPosition(item); + } + } + } catch (BadLocationException e) { + MPPDBIDELoggerUtility.error(e.getMessage()); + } + }); + } + + /** + * The get Toatl LineNo + * + * @param plSourceEditor the source editor + * @return the value for function + */ + public static Set getToatlLineNo(PLSourceEditor plSourceEditor) { + Set record = new HashSet<>(); + int begin = -1; + int end = -1; + ; + try { + String sourceCode = plSourceEditor.getDebugObject().getLatestSouceCode().getCode(); + List total = SourceCodeService.CodeDescription.getLines(sourceCode); + + for (int i = 0; i < total.size(); i++) { + String code = total.get(i); + if (code.toUpperCase(Locale.ENGLISH).trim().startsWith(BEGIN)) { + begin = i; + } + if (code.toUpperCase(Locale.ENGLISH).trim().startsWith(END)) { + end = i; + break; + } + } + Boolean isFlag = true; + int beg = begin; + while (isFlag && begin != -1 && end != -1 && begin < end) { + int val = ++beg; + if (val == end) { + break; + } + record.add(val); + if (val + 1 == end) { + isFlag = false; + } + } + } catch (DatabaseOperationException | DatabaseCriticalException e) { + MPPDBIDELoggerUtility.error(e.getMessage()); } + return record; } } diff --git a/code/datastudio/src/org.opengauss.mppdbide.view/src/org/opengauss/mppdbide/view/service/CoverageServiceFactory.java b/code/datastudio/src/org.opengauss.mppdbide.view/src/org/opengauss/mppdbide/view/service/CoverageServiceFactory.java new file mode 100644 index 0000000000000000000000000000000000000000..8d95796e39fa30c50a799cde0c4d867587ec5e36 --- /dev/null +++ b/code/datastudio/src/org.opengauss.mppdbide.view/src/org/opengauss/mppdbide/view/service/CoverageServiceFactory.java @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2022 Huawei Technologies Co.,Ltd. + * + * openGauss is licensed under Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * 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. + * See the Mulan PSL v2 for more details. + */ + +package org.opengauss.mppdbide.view.service; + +import java.sql.SQLException; + +import org.opengauss.mppdbide.common.IConnection; +import org.opengauss.mppdbide.common.IConnectionProvider; +import org.opengauss.mppdbide.view.coverage.CoverageService; + +/** + * Title: the ServiceFactory class + * + * @since 3.0.0 + */ +public class CoverageServiceFactory { + private IConnectionProvider provider; + + public CoverageServiceFactory(IConnectionProvider provider) { + this.provider = provider; + } + + /** + * getCoverageService + * + * @return the value + * @throws SQLException the exception + */ + public CoverageService getCoverageService() throws SQLException { + return createCoverageService(provider.getValidFreeConnection()); + } + + private static CoverageService createCoverageService(IConnection conn) { + CoverageService service = new CoverageService(); + service.setConn(conn); + return service; + } +} diff --git a/code/datastudio/src/org.opengauss.mppdbide.view/src/org/opengauss/mppdbide/view/ui/CoverageHistory.java b/code/datastudio/src/org.opengauss.mppdbide.view/src/org/opengauss/mppdbide/view/ui/CoverageHistory.java new file mode 100644 index 0000000000000000000000000000000000000000..e5cfbb60f7993c60c21fb239fb74e67f1b6376c8 --- /dev/null +++ b/code/datastudio/src/org.opengauss.mppdbide.view/src/org/opengauss/mppdbide/view/ui/CoverageHistory.java @@ -0,0 +1,455 @@ +/* + * Copyright (c) 2022 Huawei Technologies Co.,Ltd. + * + * openGauss is licensed under Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * 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. + * See the Mulan PSL v2 for more details. + */ + +package org.opengauss.mppdbide.view.ui; + +import java.io.IOException; +import java.sql.SQLException; +import java.util.Collections; +import java.util.HashMap; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +import org.eclipse.jface.dialogs.Dialog; +import org.eclipse.jface.text.source.CompositeRuler; +import org.eclipse.jface.text.source.LineNumberRulerColumn; +import org.eclipse.swt.SWT; +import org.eclipse.swt.custom.ScrolledComposite; +import org.eclipse.swt.events.SelectionEvent; +import org.eclipse.swt.events.SelectionListener; +import org.eclipse.swt.graphics.Image; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.layout.GridLayout; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Control; +import org.eclipse.swt.widgets.Shell; +import org.eclipse.swt.widgets.Table; +import org.eclipse.swt.widgets.TableColumn; +import org.eclipse.swt.widgets.TableItem; +import org.eclipse.swt.widgets.ToolBar; +import org.eclipse.swt.widgets.ToolItem; +import org.opengauss.mppdbide.adapter.keywordssyntax.SQLSyntax; +import org.opengauss.mppdbide.debuger.service.SourceCodeService; +import org.opengauss.mppdbide.debuger.vo.dbe.ExportParamVo; +import org.opengauss.mppdbide.utils.IMessagesConstants; +import org.opengauss.mppdbide.utils.MPPDBIDEConstants; +import org.opengauss.mppdbide.utils.loader.MessageConfigLoader; +import org.opengauss.mppdbide.utils.logger.MPPDBIDELoggerUtility; +import org.opengauss.mppdbide.view.coverage.CoverageService; +import org.opengauss.mppdbide.view.handler.debug.DBConnectionProvider; +import org.opengauss.mppdbide.view.service.CoverageServiceFactory; +import org.opengauss.mppdbide.view.utils.ExportUtil; +import org.opengauss.mppdbide.view.utils.UIElement; +import org.opengauss.mppdbide.view.utils.dialog.MPPDBIDEDialogs; +import org.opengauss.mppdbide.view.utils.dialog.MPPDBIDEDialogs.MESSAGEDIALOGTYPE; +import org.opengauss.mppdbide.view.utils.icon.IconUtility; +import org.opengauss.mppdbide.view.utils.icon.IiconPath; +import org.opengauss.mppdbide.view.vo.CoverageVo; + +/** + * Coverage History + * + * @since 3.0.0 + */ +public class CoverageHistory extends Dialog { + private static final int SPACE_BETWEEN_RULER = 1; + private static final int SERIAL_NUMBER_COLUMN = 0; + private static final int TOTAL_LINE = 1; + private static final int TOTAL_RUN_LINE_NUM = 2; + private static final int TOTAL_COVERAGE = 3; + private static final int REMARK_LINE = 4; + private static final int REMARK_RUM_LINE_NUM = 5; + private static final int REMARK_COVERAGE = 6; + private static final int UPDATE_TIME = 7; + + private Table table = null; + private ToolItem saveToolItem = null; + private ToolItem deleteToolItem = null; + private ToolItem deleteAllToolItem = null; + private CompositeRuler fCompositeRuler; + private SQLSyntax syntax; + private CoverageServiceFactory coverageServiceFactory = null; + + private String profileName; + + /** + * CoverageHistory + * + * @param parent the parent + * @param profileName the profile Name + * @param profileId the profile Id + */ + public CoverageHistory(Shell parent, String profileName) { + super(parent); + this.profileName = profileName; + } + + /** + * Creates the contents. + * + * @param parent the parent + * @return the control + */ + @Override + public Control createContents(final Composite parent) { + final ScrolledComposite mainSc = new ScrolledComposite(parent, SWT.H_SCROLL | SWT.V_SCROLL); + mainSc.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); + final Composite currentComposite = new Composite(mainSc, SWT.BORDER); + mainSc.setContent(currentComposite); + GridLayout layout = new GridLayout(1, false); + currentComposite.setLayout(layout); + createToolbar(currentComposite); + table = new Table(currentComposite, SWT.FULL_SELECTION | SWT.MULTI | SWT.V_SCROLL | SWT.BORDER); + GridData tableGD = new GridData(SWT.FILL, SWT.FILL, true, true); + tableGD.heightHint = 300; + table.setLayoutData(tableGD); + table.setHeaderVisible(true); + table.setLinesVisible(true); + table.setTopIndex(10); + TableColumn serialno = new TableColumn(table, SWT.LEFT); + serialno.setText(MessageConfigLoader.getProperty(IMessagesConstants.SERIAL_NO)); + TableColumn totalLine = new TableColumn(table, SWT.LEFT); + totalLine.setText(org.opengauss.mppdbide.utils.loader.MessageConfigLoader.getProperty( + IMessagesConstants.TOTAL_LINE)); + TableColumn totalRunLineNum = new TableColumn(table, SWT.LEFT); + totalRunLineNum.setText(org.opengauss.mppdbide.utils.loader.MessageConfigLoader.getProperty( + IMessagesConstants.TOTAL_RUN_LINE_NUM)); + TableColumn totalCoverage = new TableColumn(table, SWT.LEFT); + totalCoverage.setText(org.opengauss.mppdbide.utils.loader.MessageConfigLoader.getProperty( + IMessagesConstants.TOTAL_COVERAGE)); + TableColumn remarkLine = new TableColumn(table, SWT.LEFT); + remarkLine.setText(org.opengauss.mppdbide.utils.loader.MessageConfigLoader.getProperty( + IMessagesConstants.REMARK_LINE)); + TableColumn remarkRunLineNum = new TableColumn(table, SWT.LEFT); + remarkRunLineNum.setText(org.opengauss.mppdbide.utils.loader.MessageConfigLoader.getProperty( + IMessagesConstants.REMARK_RUM_LINE_NUM)); + TableColumn remarkCoverage = new TableColumn(table, SWT.LEFT); + remarkCoverage.setText(org.opengauss.mppdbide.utils.loader.MessageConfigLoader.getProperty( + IMessagesConstants.REMARK_COVERAGE)); + TableColumn updateTime = new TableColumn(table, SWT.LEFT); + updateTime.setText(org.opengauss.mppdbide.utils.loader.MessageConfigLoader.getProperty( + IMessagesConstants.UPDATE_TIME)); + serialno.pack(); + totalLine.pack(); + totalRunLineNum.pack(); + totalCoverage.pack(); + remarkCoverage.pack(); + updateTime.setWidth(150); + remarkLine.setWidth(200); + remarkRunLineNum.setWidth(200); + displaySqlHistoryObject(); + mainSc.setExpandHorizontal(true); + mainSc.setExpandVertical(true); + mainSc.setMinSize(currentComposite.computeSize(SWT.DEFAULT, SWT.DEFAULT)); + mainSc.pack(); + return parent; + } + + /** + * configureShell + * + * @param shell shell + */ + protected void configureShell(Shell shell) { + super.configureShell(shell); + shell.setText(MessageConfigLoader.getProperty(IMessagesConstants.COVERAGE_HISTORY_TITLE, profileName)); + shell.setImage(IconUtility.getIconImage(IiconPath.SQL_HISTORY1, this.getClass())); + shell.setSize(1000, 750); + } + + /** + * the display Sql History Object + */ + public void displaySqlHistoryObject() { + PLSourceEditor pl = UIElement.getInstance().getVisibleSourceViewer(); + long oid = pl.getDebugObject().getOid(); + coverageServiceFactory = new CoverageServiceFactory( + new DBConnectionProvider(pl.getDebugObject().getDatabase())); + CoverageService coverageService = null; + try { + coverageService = coverageServiceFactory.getCoverageService(); + List ls = coverageService.getCoverageInfoByOid(oid); + setInput(ls); + } catch (SQLException e) { + MPPDBIDELoggerUtility.error(e.getMessage()); + } finally { + if (coverageService != null) { + coverageService.closeService(); + } + } + } + + /** + * setInput + * + * @param items the value + */ + public void setInput(List items) { + int index = 1; + for (CoverageVo item : items) { + TableItem row = new TableItem(table, SWT.NONE); + setColValues(row, item, index); + index++; + row.setData(item); + } + if (table != null) { + if (table.getItems().length > 0) { + enablebuttons(true); + } + } + } + + private void setColValues(TableItem row, CoverageVo item, Integer count) { + row.setText(SERIAL_NUMBER_COLUMN, count.toString()); + row.setText(TOTAL_LINE, String.valueOf(item.totalLineNum)); + row.setText(TOTAL_RUN_LINE_NUM, String.valueOf(item.coverageLineNum)); + row.setText(TOTAL_COVERAGE, String.valueOf(item.totalPercent)); + row.setText(REMARK_LINE, String.valueOf(item.remarkLinesArr)); + row.setText(REMARK_RUM_LINE_NUM, String.valueOf(item.remarkCoverageLinesArr)); + row.setText(REMARK_COVERAGE, String.valueOf(item.remarkPercent)); + row.setText(UPDATE_TIME, item.parseDate()); + } + + public SQLSyntax getSyntax() { + return syntax; + } + + public void setSyntax(SQLSyntax syntax) { + this.syntax = syntax; + } + + /** + * getCompositeRuler + * + * @return CompositeRuler the return value + */ + public CompositeRuler getCompositeRuler() { + fCompositeRuler = new CompositeRuler(SPACE_BETWEEN_RULER); + fCompositeRuler.addDecorator(1, new LineNumberRulerColumn()); + + return fCompositeRuler; + } + + private void createToolbar(final Composite parent) { + final ToolBar bar = new ToolBar(parent, SWT.FLAT | SWT.FOCUSED); + final Image sqlcloseIcon = IconUtility.getIconImage(IiconPath.LOAD_QUERY_SQL, getClass()); + saveToolItem = new ToolItem(bar, SWT.PUSH); + saveToolItem.setEnabled(false); + saveToolItem.setImage(sqlcloseIcon); + saveToolItem.setToolTipText(MessageConfigLoader.getProperty(IMessagesConstants.EXPORT_REPORT)); + saveToolItem.addSelectionListener(new ExportCoverageReport()); + + final Image deleteIcon = IconUtility.getIconImage(IiconPath.DELETE_SELECTED, getClass()); + deleteToolItem = new ToolItem(bar, SWT.PUSH); + deleteToolItem.setEnabled(false); + deleteToolItem.setImage(deleteIcon); + deleteToolItem.setToolTipText(MessageConfigLoader.getProperty(IMessagesConstants.DELETE_COVERAGE)); + deleteToolItem.addSelectionListener(new DeletesqlClass()); + + final Image deleteallIcon = IconUtility.getIconImage(IiconPath.DELETE_ALL, getClass()); + deleteAllToolItem = new ToolItem(bar, SWT.PUSH); + deleteAllToolItem.setEnabled(false); + deleteAllToolItem.setImage(deleteallIcon); + deleteAllToolItem.setToolTipText(MessageConfigLoader.getProperty(IMessagesConstants.DELETE_COVERAGE_ALL)); + deleteAllToolItem.addSelectionListener(new DeleteAllsqlClass()); + } + + private final class DeletesqlClass implements SelectionListener { + @Override + public void widgetSelected(SelectionEvent event) { + TableItem[] tableItems = table.getSelection(); + if (tableItems.length == 0) { + MPPDBIDEDialogs.generateOKMessageDialog(MESSAGEDIALOGTYPE.INFORMATION, true, + MessageConfigLoader.getProperty(IMessagesConstants.DELETE_COVERAGE_REPORT_TITLE), + MessageConfigLoader.getProperty(IMessagesConstants.SELECT_QUERY_TO_DELETE)); + return; + } + int type = MPPDBIDEDialogs.generateOKCancelMessageDialog(MESSAGEDIALOGTYPE.WARNING, true, + MessageConfigLoader.getProperty(IMessagesConstants.DELETE_COVERAGE_REPORT_TITLE), + MessageConfigLoader.getProperty( + IMessagesConstants.DELETE_SELECTED_COVERAGE_HISTORY_ALERT, profileName, + MPPDBIDEConstants.LINE_SEPARATOR)); + deleteSQLHistory(type, tableItems); + resetSerialNumber(); + } + + private void displayInfoMessage() { + MPPDBIDEDialogs.generateOKMessageDialog(MESSAGEDIALOGTYPE.INFORMATION, true, + MessageConfigLoader.getProperty(IMessagesConstants.DELETE_SQL), + MessageConfigLoader.getProperty(IMessagesConstants.PINNED_DELETION)); + } + + @Override + public void widgetDefaultSelected(SelectionEvent event) { + + } + } + + private final class ExportCoverageReport implements SelectionListener { + @Override + public void widgetSelected(SelectionEvent event) { + TableItem[] items = table.getSelection(); + if (items.length == 0) { + MPPDBIDEDialogs.generateOKMessageDialog(MESSAGEDIALOGTYPE.INFORMATION, true, + MessageConfigLoader.getProperty(IMessagesConstants.EXPORT_REPORT), + MessageConfigLoader.getProperty(IMessagesConstants.COVERAGE_REPORT_TO_SELECT)); + return; + } + int type = MPPDBIDEDialogs.generateOKCancelMessageDialog(MESSAGEDIALOGTYPE.WARNING, true, + MessageConfigLoader.getProperty(IMessagesConstants.EXPORT_REPORT), + MessageConfigLoader.getProperty(IMessagesConstants.SURE_EXPORT_REPORT)); + if (type != 0) { + return; + } + Boolean isFlag = true; + String html = null; + String serialNum; + for (int index = 0; index < items.length; index++) { + TableItem item = items[index]; + if (!(item.getData() instanceof CoverageVo)) { + break; + } + CoverageVo vo = (CoverageVo) item.getData(); + List list = getData(item); + serialNum = String.valueOf(index + 1); + list.add(0, serialNum); + Map code = getCode(vo.sourceCode); + ExportParamVo expVo = new ExportParamVo(); + expVo.oid = vo.oid; + expVo.index = serialNum; + expVo.executeSql = code; + expVo.remarkLines = vo.remarkLinesArr.stream().collect(Collectors.toSet()); + expVo.coveragePassLines = vo.coverageLinesArr.stream().collect(Collectors.toSet()); + expVo.list = list; + if (isFlag) { + html = ExportUtil.exportReport(expVo); + isFlag = false; + } else { + expVo.html = html; + html = ExportUtil.exportReport(expVo); + } + } + try { + ExportUtil.loadText(ExportUtil.getPath(), html); + MPPDBIDEDialogs.generateOKMessageDialog(MESSAGEDIALOGTYPE.INFORMATION, true, + MessageConfigLoader.getProperty(IMessagesConstants.EXECDIALOG_HINT), + MessageConfigLoader.getProperty(IMessagesConstants.EXPORT_PATH, ExportUtil.getPath(), + MPPDBIDEConstants.LINE_SEPARATOR)); + } catch (IOException e) { + MPPDBIDELoggerUtility.error(e.getMessage()); + } + } + + @Override + public void widgetDefaultSelected(SelectionEvent event) { + } + } + + private Map getCode(String sourceCode) { + Map code = new HashMap(); + List codes = SourceCodeService.CodeDescription.getLines(sourceCode); + for (int i = 0; i < codes.size(); i++) { + code.put(i + 1, codes.get(i)); + } + return code; + } + + private List getData(TableItem item) { + if (item.getData() instanceof CoverageVo) { + CoverageVo coverageVo = (CoverageVo) item.getData(); + return Stream.of(String.valueOf(coverageVo.totalLineNum), String.valueOf(coverageVo.coverageLineNum), + coverageVo.totalPercent, + String.valueOf(coverageVo.remarkLinesArr), String.valueOf(coverageVo.remarkCoverageLinesArr), + coverageVo.remarkPercent, coverageVo.params, + coverageVo.parseDate()).collect(Collectors.toList()); + } else { + return Collections.emptyList(); + } + } + + private final class DeleteAllsqlClass implements SelectionListener { + @Override + public void widgetSelected(SelectionEvent event) { + TableItem[] items = table.getItems(); + int type = MPPDBIDEDialogs.generateOKCancelMessageDialog(MESSAGEDIALOGTYPE.WARNING, true, + MessageConfigLoader.getProperty(IMessagesConstants.DELETE_COVERAGE_REPORT_TITLE), + MessageConfigLoader.getProperty(IMessagesConstants.DELETE_ALL_COVERAGE_HISTORY_ALERT, profileName, + MPPDBIDEConstants.LINE_SEPARATOR)); + deleteSQLHistory(type, items); + resetSerialNumber(); + } + + @Override + public void widgetDefaultSelected(SelectionEvent event) { + + } + } + + private void deleteSQLHistory(int type, TableItem[] items) { + if (type == 0) { + List historyItems = new LinkedList(); + int counter = 0; + for (TableItem item : items) { + if (item.getData() instanceof CoverageVo) { + historyItems.add((CoverageVo) item.getData()); + item.dispose(); + counter++; + } + } + if (counter != 0) { + CoverageService[] service = new CoverageService[1]; + try { + service[0] = coverageServiceFactory.getCoverageService(); + historyItems.forEach(item -> { + service[0].delCoverageInfoByOid(item.oid, item.cid); + }); + } catch (SQLException e) { + MPPDBIDELoggerUtility.error(e.getMessage()); + } finally { + service[0].closeService(); + } + } + } + } + + private void resetSerialNumber() { + if (table != null) { + TableItem[] items = table.getItems(); + int size = items.length; + if (size <= 0) { + enablebuttons(false); + return; + } + + for (int indx = 0; indx < size; indx++) { + items[indx].setText(0, Integer.toString(indx + 1)); + } + } + } + + /** + * enablebuttons + * + * @param hasValue the param + */ + protected void enablebuttons(boolean hasValue) { + saveToolItem.setEnabled(hasValue); + deleteAllToolItem.setEnabled(hasValue); + deleteToolItem.setEnabled(hasValue); + } +} diff --git a/code/datastudio/src/org.opengauss.mppdbide.view/src/org/opengauss/mppdbide/view/ui/PLSourceEditor.java b/code/datastudio/src/org.opengauss.mppdbide.view/src/org/opengauss/mppdbide/view/ui/PLSourceEditor.java index d919022039e91ee3041eaeda2d58c98ae2bef21e..f948607994538c81f89ed94ac9c119a4d4215821 100644 --- a/code/datastudio/src/org.opengauss.mppdbide.view/src/org/opengauss/mppdbide/view/ui/PLSourceEditor.java +++ b/code/datastudio/src/org.opengauss.mppdbide.view/src/org/opengauss/mppdbide/view/ui/PLSourceEditor.java @@ -45,10 +45,8 @@ import org.eclipse.jface.text.DocumentEvent; import org.eclipse.jface.text.IDocument; import org.eclipse.jface.text.IDocumentExtension3; import org.eclipse.jface.text.IDocumentListener; -import org.eclipse.jface.text.IDocumentPartitioner; import org.eclipse.jface.text.IInformationControl; import org.eclipse.jface.text.IInformationControlCreator; -import org.eclipse.jface.text.IRegion; import org.eclipse.jface.text.ITextSelection; import org.eclipse.jface.text.Position; import org.eclipse.jface.text.source.Annotation; @@ -60,10 +58,6 @@ import org.eclipse.jface.text.source.CompositeRuler; import org.eclipse.jface.text.source.IAnnotationAccess; import org.eclipse.jface.text.source.LineNumberRulerColumn; import org.eclipse.jface.text.source.SourceViewer; -import org.eclipse.jface.text.source.projection.ProjectionViewer; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.ISelectionChangedListener; -import org.eclipse.jface.viewers.SelectionChangedEvent; import org.eclipse.swt.SWT; import org.eclipse.swt.custom.SashForm; import org.eclipse.swt.dnd.Clipboard; @@ -77,7 +71,6 @@ import org.eclipse.swt.events.MouseListener; import org.eclipse.swt.events.SelectionEvent; import org.eclipse.swt.events.SelectionListener; import org.eclipse.swt.graphics.Color; -import org.eclipse.swt.graphics.RGB; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.widgets.Composite; @@ -86,8 +79,6 @@ import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.Menu; import org.eclipse.swt.widgets.MenuItem; import org.eclipse.swt.widgets.Shell; -import org.eclipse.ui.texteditor.AnnotationPreference; - import org.opengauss.mppdbide.adapter.keywordssyntax.SQLSyntax; import org.opengauss.mppdbide.bl.errorlocator.IErrorLocator; import org.opengauss.mppdbide.bl.serverdatacache.Database; @@ -102,6 +93,7 @@ import org.opengauss.mppdbide.presentation.grid.IDSGridDataProvider; import org.opengauss.mppdbide.presentation.resultset.ActionAfterResultFetch; import org.opengauss.mppdbide.presentation.resultsetif.IConsoleResult; import org.opengauss.mppdbide.presentation.resultsetif.IResultConfig; +import org.opengauss.mppdbide.utils.DebuggerStartVariable; import org.opengauss.mppdbide.utils.IMessagesConstants; import org.opengauss.mppdbide.utils.MPPDBIDEConstants; import org.opengauss.mppdbide.utils.MemoryCleaner; @@ -112,13 +104,16 @@ import org.opengauss.mppdbide.utils.loader.MessageConfigLoader; import org.opengauss.mppdbide.utils.logger.ILogger; import org.opengauss.mppdbide.utils.logger.MPPDBIDELoggerUtility; import org.opengauss.mppdbide.utils.messaging.MessageQueue; +import org.opengauss.mppdbide.utils.vo.DebuggerStartInfoVo; import org.opengauss.mppdbide.view.core.ConsoleCoreWindow; import org.opengauss.mppdbide.view.core.ConsoleMessageWindow; +import org.opengauss.mppdbide.view.core.sourceeditor.AnnotationHelper.AnnotationType; import org.opengauss.mppdbide.view.core.sourceeditor.AnnotationHover; import org.opengauss.mppdbide.view.core.sourceeditor.BreakpointAnnotation; +import org.opengauss.mppdbide.view.core.sourceeditor.DebugFailPositionAnnotation; +import org.opengauss.mppdbide.view.core.sourceeditor.DebugPassPositionAnnotation; import org.opengauss.mppdbide.view.core.sourceeditor.DebugPositionAnnotation; import org.opengauss.mppdbide.view.core.sourceeditor.ErrorAnnotation; -import org.opengauss.mppdbide.view.core.sourceeditor.ErrorPositionAnnotation; import org.opengauss.mppdbide.view.core.sourceeditor.PLAnnotationMarkerAccess; import org.opengauss.mppdbide.view.core.sourceeditor.PLSourceEditorCore; import org.opengauss.mppdbide.view.core.sourceeditor.SQLDocumentPartitioner; @@ -126,12 +121,9 @@ import org.opengauss.mppdbide.view.core.sourceeditor.SQLEditorPlugin; import org.opengauss.mppdbide.view.core.sourceeditor.SQLPartitionScanner; import org.opengauss.mppdbide.view.core.sourceeditor.SQLSourceViewerConfig; import org.opengauss.mppdbide.view.core.sourceeditor.SQLSyntaxColorProvider; -import org.opengauss.mppdbide.view.core.sourceeditor.AnnotationHelper.AnnotationType; import org.opengauss.mppdbide.view.handler.ExecuteEditorItem; import org.opengauss.mppdbide.view.handler.HandlerUtilities; -import org.opengauss.mppdbide.view.handler.debug.DebugHandlerUtils; import org.opengauss.mppdbide.view.handler.debug.DebugServiceHelper; -import org.opengauss.mppdbide.view.prefernces.PreferenceWrapper; import org.opengauss.mppdbide.view.terminal.executioncontext.FuncProcEditorTerminalExecutionContext; import org.opengauss.mppdbide.view.ui.autosave.AbstractAutoSaveObject; import org.opengauss.mppdbide.view.ui.autosave.IAutoSaveDbgObject; @@ -140,8 +132,6 @@ import org.opengauss.mppdbide.view.ui.terminal.FuncProcTerminalResultDisplayUIMa import org.opengauss.mppdbide.view.ui.terminal.resulttab.ResultTabManager; import org.opengauss.mppdbide.view.ui.uiif.PLSourceEditorIf; import org.opengauss.mppdbide.view.uidisplay.UIDisplayFactoryProvider; -import org.opengauss.mppdbide.view.uidisplay.UIDisplayState; -import org.opengauss.mppdbide.view.utils.IUserPreference; import org.opengauss.mppdbide.view.utils.UIElement; import org.opengauss.mppdbide.view.utils.UserPreference; import org.opengauss.mppdbide.view.utils.common.SourceViewerUtil; @@ -697,6 +687,9 @@ public class PLSourceEditor extends AbstractAutoSaveObject sourceEditor.setDocument(new Document(debugObject.getLatestSouceCode().getCode()), 0); debugObject.setCodeReloaded(false); } + String sourceCode = debugObject.getLatestSouceCode().getCode(); + DebuggerStartInfoVo info = DebuggerStartVariable.getStartInfo(debugObject.getOid()); + info.sourceCode = sourceCode; registerModifyListener(); setSourceChangedInEditor(false); setSourceViewerConfiguration(); @@ -1335,17 +1328,40 @@ public class PLSourceEditor extends AbstractAutoSaveObject */ public void removeDebugPosition() { Iterator annoIterator = fAnnotationModel.getAnnotationIterator(); - List needRemoveAnnotations = - new ArrayList(1); + List needRemoveAnnotations = + new ArrayList(1); while (annoIterator.hasNext()) { Annotation annotation = annoIterator.next(); if (annotation instanceof DebugPositionAnnotation) { needRemoveAnnotations.add((DebugPositionAnnotation) annotation); } + if (annotation instanceof DebugPassPositionAnnotation) { + needRemoveAnnotations.add((DebugPassPositionAnnotation) annotation); + } + if (annotation instanceof DebugFailPositionAnnotation) { + needRemoveAnnotations.add((DebugFailPositionAnnotation) annotation); + } } - for (DebugPositionAnnotation anno: needRemoveAnnotations) { - fAnnotationModel.removeAnnotation(anno); - deHighlightLine(anno.getLine()); + for (Object anno : needRemoveAnnotations) { + Annotation annotation = null; + int line = -1; + if (anno instanceof DebugPositionAnnotation) { + DebugPositionAnnotation debug = (DebugPositionAnnotation) anno; + annotation = debug; + line = debug.getLine(); + } + if (anno instanceof DebugPassPositionAnnotation) { + DebugPassPositionAnnotation pass = (DebugPassPositionAnnotation) anno; + annotation = pass; + line = pass.getLine(); + } + if (anno instanceof DebugFailPositionAnnotation) { + DebugFailPositionAnnotation fail = (DebugFailPositionAnnotation) anno; + annotation = fail; + line = fail.getLine(); + } + fAnnotationModel.removeAnnotation(annotation); + deHighlightLine(line); } } @@ -1365,6 +1381,30 @@ public class PLSourceEditor extends AbstractAutoSaveObject setDebugPositionLine(line); } + /** + * create Pass Position + * + * @param line the debug pass line + */ + public void createPassPosition(int line) throws BadLocationException { + DebugPassPositionAnnotation annotation = new DebugPassPositionAnnotation(line); + fAnnotationModel.addAnnotation(annotation, + new Position(sourceEditor.getDocument().getLineOffset(line)) + ); + } + + /** + * create Fail Position + * + * @param line the debug fail line + */ + public void createFailPosition(int line) throws BadLocationException { + DebugFailPositionAnnotation annotation = new DebugFailPositionAnnotation(line); + fAnnotationModel.addAnnotation(annotation, + new Position(sourceEditor.getDocument().getLineOffset(line)) + ); + } + /** * Search for any annotation for given line. * diff --git a/code/datastudio/src/org.opengauss.mppdbide.view/src/org/opengauss/mppdbide/view/ui/VariableTableWindow.java b/code/datastudio/src/org.opengauss.mppdbide.view/src/org/opengauss/mppdbide/view/ui/VariableTableWindow.java index b09e44328b098b7ccf9932bb088db41615309005..47eea161299e19b2bcb1e9caf9813b32d3348900 100644 --- a/code/datastudio/src/org.opengauss.mppdbide.view/src/org/opengauss/mppdbide/view/ui/VariableTableWindow.java +++ b/code/datastudio/src/org.opengauss.mppdbide.view/src/org/opengauss/mppdbide/view/ui/VariableTableWindow.java @@ -33,7 +33,7 @@ import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.Table; import org.eclipse.swt.widgets.TableItem; - +import org.opengauss.mppdbide.adapter.gauss.Datatype; import org.opengauss.mppdbide.adapter.gauss.GaussDatatypeUtils; import org.opengauss.mppdbide.bl.serverdatacache.DefaultParameter; import org.opengauss.mppdbide.bl.serverdatacache.IDebugObject; @@ -164,7 +164,11 @@ public class VariableTableWindow extends WindowBase { private String getType() { int typeCode = variableVo.dtype.intValue(); - String type = GaussDatatypeUtils.getDataTypeHashMap().get(typeCode).getTypename(); + Datatype datatype = GaussDatatypeUtils.getDataTypeHashMap().get(typeCode); + if (datatype == null) { + return ""; + } + String type = datatype.getTypename(); return type; } diff --git a/code/datastudio/src/org.opengauss.mppdbide.view/src/org/opengauss/mppdbide/view/utils/ExportUtil.java b/code/datastudio/src/org.opengauss.mppdbide.view/src/org/opengauss/mppdbide/view/utils/ExportUtil.java new file mode 100644 index 0000000000000000000000000000000000000000..b1760198b01456bcd3db412d0eab5657eb4beabd --- /dev/null +++ b/code/datastudio/src/org.opengauss.mppdbide.view/src/org/opengauss/mppdbide/view/utils/ExportUtil.java @@ -0,0 +1,173 @@ +/* + * Copyright (c) 2022 Huawei Technologies Co.,Ltd. + * + * openGauss is licensed under Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * 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. + * See the Mulan PSL v2 for more details. + */ + +package org.opengauss.mppdbide.view.utils; + +import java.io.BufferedWriter; +import java.io.File; +import java.io.FileWriter; +import java.io.IOException; +import java.net.URL; +import java.util.ArrayList; +import java.util.List; +import java.util.Locale; +import java.util.Map; +import java.util.stream.Collectors; + +import org.eclipse.core.runtime.FileLocator; +import org.jsoup.Jsoup; +import org.jsoup.nodes.Document; +import org.jsoup.nodes.Element; +import org.opengauss.mppdbide.debuger.vo.dbe.ExportParamVo; +import org.opengauss.mppdbide.utils.MPPDBIDEConstants; +import org.opengauss.mppdbide.utils.logger.MPPDBIDELoggerUtility; + +/** + * Export Util + * + * @since 3.0.0 + */ +public final class ExportUtil { + private static String outpath; + private static File file; + + private ExportUtil() { + + } + + public static String getPath() { + return outpath; + } + + /** + * exportReport + * + * @param vo the vo + * @return the value + */ + public static String exportReport(ExportParamVo vo) { + long oid = vo.oid; + Map executeSql = vo.executeSql; + List list = vo.list; + String html = vo.html; + URL url = getUrl("exportTemplate.html"); + Document parse = null; + parse = getText(html, url, oid); + List offset = getOffset(executeSql); + Element data = parse.getElementById("data"); + Element datatr = data.appendElement("tr"); + list.forEach(item -> { + Element td = datatr.appendElement("td"); + td.text(item); + }); + String index = vo.index; + boolean[] flag = new boolean[]{true}; + Element excuteSql = parse.getElementById("executeSql"); + executeSql.forEach((k, v) -> { + Element tr = excuteSql.appendElement("tr"); + if (flag[0]) { + Element td0 = tr.appendElement("td"); + td0.attr("rowspan", executeSql.values().size() + ""); + td0.text(index); + flag[0] = false; + } + Element serialNo = tr.appendElement("td"); + serialNo.text(k.toString()); + Element td = tr.appendElement("td"); + Element td2 = tr.appendElement("td"); + Element div = td.appendElement("div"); + td2.text(v); + if (vo.remarkLines.contains(k.toString())) { + td2.addClass("bac_remark"); + } + if (vo.coveragePassLines.contains((k - 1) + "")) { + div.addClass("bac_pass"); + } else { + if (k > (offset.get(0) + 1) && k < (offset.get(1) + 1)) { + div.addClass("bac_fail"); + } + } + }); + return parse.outerHtml(); + } + + private static URL getUrl(String propertiesFileName) { + ClassLoader classLoader = ExportUtil.class.getClassLoader(); + StringBuffer msgFileCon = new StringBuffer("exportTemplate_"); + String messageFileName = propertiesFileName; + String locale = Locale.getDefault().toString(); + if (locale.equals(MPPDBIDEConstants.CHINESE_LOCALE)) { + messageFileName = msgFileCon.append(locale).append(".html").toString(); + } + return classLoader.getResource(messageFileName); + } + + private static Document getText(String html, URL url, long oid) { + Document parse = null; + try { + if (html == null) { + String path = FileLocator.toFileURL(url).getPath().substring(1); + file = new File(path); + String workDirectory = System.getProperty("user.dir"); + String fileSeparator = System.getProperty("file.separator"); + outpath = workDirectory + fileSeparator + oid + "_" + System.currentTimeMillis() + ".html"; + parse = Jsoup.parse(file, "gbk"); + } else { + parse = Jsoup.parse(html); + } + } catch (IOException e) { + MPPDBIDELoggerUtility.error(e.getMessage()); + } + return parse; + } + + private static List getOffset(Map executeSql) { + int begin = -1; + int end = -1; + List val = executeSql.values().stream().collect(Collectors.toList()); + for (int i = 0; i < val.size(); i++) { + String code = val.get(i); + if (code.toUpperCase(Locale.ENGLISH).trim().startsWith("BEGIN")) { + begin = i; + } + if (code.toUpperCase(Locale.ENGLISH).trim().startsWith("END;")) { + end = i; + break; + } + } + List list = new ArrayList<>(); + list.add(begin); + list.add(end); + return list; + } + + /** + * loadText + * + * @param path the path + * @param text the text + * @throws IOException the exception + */ + public static void loadText(String path, String text) throws IOException { + BufferedWriter bw = new BufferedWriter(new FileWriter(new File(path))); + String[] split = text.split(" "); + for (String str : split) { + bw.write(str + System.getProperty("line.separator")); + } + if (bw != null) { + bw.close(); + } + } +} diff --git a/code/datastudio/src/org.opengauss.mppdbide.view/src/org/opengauss/mppdbide/view/utils/icon/IiconPath.java b/code/datastudio/src/org.opengauss.mppdbide.view/src/org/opengauss/mppdbide/view/utils/icon/IiconPath.java index b5e1d7ae38c5de75230bffb4ad056ea87a89a645..beb042185c89d5ec495fca94855535e1dd0e4605 100644 --- a/code/datastudio/src/org.opengauss.mppdbide.view/src/org/opengauss/mppdbide/view/utils/icon/IiconPath.java +++ b/code/datastudio/src/org.opengauss.mppdbide.view/src/org/opengauss/mppdbide/view/utils/icon/IiconPath.java @@ -979,4 +979,19 @@ public interface IiconPath { * The ico breakpoint arrow. */ String ICO_BREAKPOINT_ARROW = PRE_DEBUG_PATH + "debugarrows.png"; + + /** + * The ico execute pass + */ + String ICO_EXECUTE_PASS = PRE_DEBUG_PATH + "debug_pass.png"; + + /** + * The ico execute fail + */ + String ICO_EXECUTE_FAIL = PRE_DEBUG_PATH + "debug_fail.png"; + + /** + * The icon remark coverage + */ + String ICON_REMARK_COVERAGE = "icon-remarkCoverage.png"; } diff --git a/code/datastudio/src/org.opengauss.mppdbide.view/src/org/opengauss/mppdbide/view/vo/CoverageVo.java b/code/datastudio/src/org.opengauss.mppdbide.view/src/org/opengauss/mppdbide/view/vo/CoverageVo.java new file mode 100644 index 0000000000000000000000000000000000000000..bcca7798bcd15cf84ca4704eae0e869cbe7dd95c --- /dev/null +++ b/code/datastudio/src/org.opengauss.mppdbide.view/src/org/opengauss/mppdbide/view/vo/CoverageVo.java @@ -0,0 +1,168 @@ +/* + * Copyright (c) 2022 Huawei Technologies Co.,Ltd. + * + * openGauss is licensed under Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * 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. + * See the Mulan PSL v2 for more details. + */ + +package org.opengauss.mppdbide.view.vo; + +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Date; +import java.util.List; + +import org.opengauss.mppdbide.debuger.annotation.DumpFiled; + +/** + * CoverageVo + * + * @since 3.0.0 + */ +public class CoverageVo { + /** + * stored procedure key + */ + @DumpFiled + public long oid; + + /** + * coverage report key + */ + @DumpFiled + public long cid; + + /** + * Stored procedure total number of rows + */ + public int totalLineNum; + + /** + * The number of executed statements + */ + public int coverageLineNum; + + /** + * The line number of the executed statement + */ + @DumpFiled + public String coverageLines; + + /** + * Set of executed statement line numbers + */ + public List coverageLinesArr; + + /** + * total coverage + */ + public String totalPercent; + + /** + * number of lines marked + */ + public int remarkLineNum; + + /** + * marked line number + */ + @DumpFiled + public String remarkLines; + + /** + * collection of marked line numbers + */ + public List remarkLinesArr; + + /** + * Mark the number of lines executed + */ + public int remarkCoverageLineNum; + + /** + * The set of line numbers to which the flag is executed + */ + public List remarkCoverageLinesArr; + + /** + * markup coverage + */ + public String remarkPercent; + + /** + * End Time + */ + @DumpFiled + public long endTime; + + /** + * execute statement + */ + @DumpFiled + public String sourceCode; + + /** + * the params + */ + @DumpFiled + public String params; + + private final SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + + + /** + * Get the remark list + * + * @return List + */ + public List getRemarkList() { + if (remarkLines == null || "".equals(remarkLines)) { + return new ArrayList(); + } else { + remarkLinesArr = new ArrayList<>(Arrays.asList(remarkLines.split(","))); + } + return remarkLinesArr; + } + + /** + * Get the run list + * + * @return List + */ + public List getRunList() { + if (coverageLines == null || "".equals(coverageLines)) { + return new ArrayList(); + } else { + coverageLinesArr = new ArrayList<>(Arrays.asList(coverageLines.split(","))); + } + return coverageLinesArr; + } + + /** + * parseDate + * + * @return String + */ + public String parseDate() { + Date date = new Date(this.endTime); + return df.format(date); + } + + /** + * getEndTime + * + * @return String + */ + public long getEndTime() { + return endTime; + } +} diff --git a/code/datastudio/src/org.opengauss.mppdbide.view/src/resources/exportTemplate.html b/code/datastudio/src/org.opengauss.mppdbide.view/src/resources/exportTemplate.html new file mode 100644 index 0000000000000000000000000000000000000000..89c325daa94d4111241f9f447c3afacc73a103e3 --- /dev/null +++ b/code/datastudio/src/org.opengauss.mppdbide.view/src/resources/exportTemplate.html @@ -0,0 +1,70 @@ + + + + + + + + + + + +
Execute statement
+ + + + + + + + + + + + + + + + +
Serial numberTotal rowsNumber of execution linesTotal coverageMark RowMark execution lineMarker coverageInput ParamsEnd time
+ + + \ No newline at end of file diff --git a/code/datastudio/src/org.opengauss.mppdbide.view/src/resources/exportTemplate_zh_CN.html b/code/datastudio/src/org.opengauss.mppdbide.view/src/resources/exportTemplate_zh_CN.html new file mode 100644 index 0000000000000000000000000000000000000000..51f5b1fd143a1b0a8a1e276cb75e096f390c6864 --- /dev/null +++ b/code/datastudio/src/org.opengauss.mppdbide.view/src/resources/exportTemplate_zh_CN.html @@ -0,0 +1,70 @@ + + + + + + + + + + + +
ִ
+ + + + + + + + + + + + + + + + +
ִִܸǸʱ
+ + + \ No newline at end of file diff --git a/code/datastudio/testcode/LLT/org.opengauss.mppdbide.bl.debug.test.fragment/META-INF/MANIFEST.MF b/code/datastudio/testcode/LLT/org.opengauss.mppdbide.bl.debug.test.fragment/META-INF/MANIFEST.MF index c858f20adf6a07ac4d60349b1b7e96b3a7e329d2..f305ab141216d099f73f37969d788ea3c1a83c14 100644 --- a/code/datastudio/testcode/LLT/org.opengauss.mppdbide.bl.debug.test.fragment/META-INF/MANIFEST.MF +++ b/code/datastudio/testcode/LLT/org.opengauss.mppdbide.bl.debug.test.fragment/META-INF/MANIFEST.MF @@ -23,4 +23,11 @@ Require-Bundle: org.junit;bundle-version="4.12.0", org.opengauss.mppdbide.util, org.apache.commons.codec;bundle-version="1.10.0", org.opengauss.mppdbide.debuger;bundle-version="1.0.0" -Export-Package: org.opengauss.mppdbide.bl.mock.debug +Export-Package: org.opengauss.mppdbide.bl.mock.debug, + org.opengauss.mppdbide.bl.test.debug +Import-Package: org.eclipse.e4.ui.workbench, + org.eclipse.jface.window, + org.eclipse.swt.widgets, + org.opengauss.mppdbide.view.handler.debug, + org.opengauss.mppdbide.view.ui, + org.opengauss.mppdbide.view.utils diff --git a/code/datastudio/testcode/LLT/org.opengauss.mppdbide.bl.debug.test.fragment/src/org/opengauss/mppdbide/bl/mock/debug/CommonLLTUtils.java b/code/datastudio/testcode/LLT/org.opengauss.mppdbide.bl.debug.test.fragment/src/org/opengauss/mppdbide/bl/mock/debug/CommonLLTUtils.java index 5caa5b09ce1dfa13ecad2167b2179051073bc01f..0c125984894cccdb03c9d0d9318f41d803fe4e7a 100644 --- a/code/datastudio/testcode/LLT/org.opengauss.mppdbide.bl.debug.test.fragment/src/org/opengauss/mppdbide/bl/mock/debug/CommonLLTUtils.java +++ b/code/datastudio/testcode/LLT/org.opengauss.mppdbide.bl.debug.test.fragment/src/org/opengauss/mppdbide/bl/mock/debug/CommonLLTUtils.java @@ -378,7 +378,7 @@ public class CommonLLTUtils } public static void prepareProxyInfo( - PreparedStatementResultSetHandler preparedstatementHandler) + PreparedStatementResultSetHandler preparedstatementHandler, String... version) { mockCheckDebugSupport(preparedstatementHandler); mockCheckExplainPlanSupport(preparedstatementHandler); @@ -1525,7 +1525,34 @@ public class CommonLLTUtils getUserRoleRs.addRow(new Object[] {"tom", false, 16410}); preparedstatementHandler.prepareResultSet( "SELECT rolname,rolcanlogin,oid FROM pg_catalog.pg_roles WHERE rolsuper = false;", getUserRoleRs); - + + MockResultSet queryVersion = preparedstatementHandler.createResultSet(); + queryVersion.addColumn("version"); + if (version.length == 0) { + version = new String[]{ + "(openGauss 2.0.0 build 02c14696) compiled at 2022-04-01 18:29:12 commit 0 last mr release"}; + } + queryVersion.addRow(version); + preparedstatementHandler.prepareResultSet("select version()", queryVersion); + + MockResultSet turnOn = preparedstatementHandler.createResultSet(); + turnOn.addColumn("nodename"); + turnOn.addColumn("port"); + turnOn.addRow(new Object[]{"gaussdb", 0}); + preparedstatementHandler.prepareResultSet( + "select * from DBE_PLDEBUGGER.turn_on(?)", turnOn); + + MockResultSet attachDebug = preparedstatementHandler.createResultSet(); + attachDebug.addColumn("funcoid"); + attachDebug.addColumn("funcname"); + attachDebug.addColumn("lineno"); + attachDebug.addColumn("query"); + attachDebug.addRow( + new Object[]{16407, + "insert_data", 3, "INSERT INTO graderecord VALUES(param1, param2, param3, param4);"}); + preparedstatementHandler.prepareResultSet( + "select * from DBE_PLDEBUGGER.attach(?,?)", attachDebug); + mockServerEncoding(preparedstatementHandler); } diff --git a/code/datastudio/testcode/LLT/org.opengauss.mppdbide.bl.debug.test.fragment/src/org/opengauss/mppdbide/bl/mock/debug/DebugerJdbcTestCaseBase.java b/code/datastudio/testcode/LLT/org.opengauss.mppdbide.bl.debug.test.fragment/src/org/opengauss/mppdbide/bl/mock/debug/DebugerJdbcTestCaseBase.java index 282b84635b8bbde31ddf31cf967bc4d339cfec40..5bd9b0d03e312f0ed8118823551a1a13276a0320 100644 --- a/code/datastudio/testcode/LLT/org.opengauss.mppdbide.bl.debug.test.fragment/src/org/opengauss/mppdbide/bl/mock/debug/DebugerJdbcTestCaseBase.java +++ b/code/datastudio/testcode/LLT/org.opengauss.mppdbide.bl.debug.test.fragment/src/org/opengauss/mppdbide/bl/mock/debug/DebugerJdbcTestCaseBase.java @@ -107,7 +107,7 @@ public class DebugerJdbcTestCaseBase extends BasicJDBCTestCaseAdapter { * * @see com.mockrunner.jdbc.BasicJDBCTestCaseAdapter#setUp() */ - protected void basicSetUp() throws Exception + protected void basicSetUp(String... version) throws Exception { super.setUp(); CommonLLTUtilsHelper.runLinuxFilePermissionInstance(); @@ -121,7 +121,7 @@ public class DebugerJdbcTestCaseBase extends BasicJDBCTestCaseAdapter { preparedstatementHandler = connection.getPreparedStatementResultSetHandler(); MPPDBIDELoggerUtility.setArgs(null); getJDBCMockObjectFactory().getMockDriver().setupConnection(connection); - CommonLLTUtils.prepareProxyInfo(preparedstatementHandler); + CommonLLTUtils.prepareProxyInfo(preparedstatementHandler, version); CommonLLTUtilsHelper.mockConnection(getJDBCMockObjectFactory().getMockDriver()); connProfCache = DBConnProfCache.getInstance(); diff --git a/code/datastudio/testcode/LLT/org.opengauss.mppdbide.bl.debug.test.fragment/src/org/opengauss/mppdbide/bl/mock/debug/MockDebugServiceHelper.java b/code/datastudio/testcode/LLT/org.opengauss.mppdbide.bl.debug.test.fragment/src/org/opengauss/mppdbide/bl/mock/debug/MockDebugServiceHelper.java index befec4901de8490a9834370d0df2e914f61060ae..b6eb7a8a72b29080c5970ed8259d9a4d788d8f1e 100644 --- a/code/datastudio/testcode/LLT/org.opengauss.mppdbide.bl.debug.test.fragment/src/org/opengauss/mppdbide/bl/mock/debug/MockDebugServiceHelper.java +++ b/code/datastudio/testcode/LLT/org.opengauss.mppdbide.bl.debug.test.fragment/src/org/opengauss/mppdbide/bl/mock/debug/MockDebugServiceHelper.java @@ -19,6 +19,7 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; +import org.opengauss.mppdbide.debuger.service.DbeDebugService; import org.opengauss.mppdbide.debuger.vo.FunctionVo; import com.mockrunner.jdbc.PreparedStatementResultSetHandler; import com.mockrunner.mock.jdbc.MockResultSet; @@ -45,7 +46,33 @@ public class MockDebugServiceHelper { true, 22L, 1}; mockOneRow(sql, variables, oneRow); } - + + /** + * the mockDbeVariable + * + * @param sql the sql value + */ + public void mockDbeVariable(String sql) { + DbeDebugService.map.put(funcVo.oid, Arrays.asList("param1")); + String[] variables = new String[]{"varname", "vartype", "value", "package_name", "isconst"}; + mockOneRow(sql, variables, Arrays.asList("param1", "int4", "210101", "", false).toArray()); + } + + /** + * the mockDbeInfoCode + * + * @param sql the sql value + */ + public void mockDbeInfoCode(String sql) { + String[] breakPointTitle = new String[]{"lineno", "query", "canbreak"}; + ResultColumnHelper helper = new ResultColumnHelper(breakPointTitle); + helper.addRow(Arrays.asList(1, "AS DECLARE", false).toArray()); + helper.addRow(Arrays.asList(2, "BEGIN", false).toArray()); + helper.addRow(Arrays.asList(3, " IF param1 > 100 THEN", false).toArray()); + helper.addRow(Arrays.asList(4, "END;", false).toArray()); + mockHelper(sql, helper); + } + public void mockStack(String sql) { String[] stackColumn = new String[] {"level", "targetname", "func", "linenumber", "args"}; @@ -54,10 +81,30 @@ public class MockDebugServiceHelper { mockOneRow(sql, stackColumn, oneRowValues); } + /** + * the function mockDbeStack + * + * @param sql the sql + */ + public void mockDbeStack(String sql) { + String[] stackColumn = new String[]{"frameno", "funcname", "lineno", "query", "funcoid"}; + mockOneRow(sql, stackColumn, Arrays.asList(0, funcVo.proname, 3, "add_test", funcVo.oid).toArray()); + } + public void mockBreakPoint(String sql) { mockPositionOneLine(sql); } - + + /** + * the mockDbeBreakPoint + * + * @param sql the sql + */ + public void mockDbeBreakPoint(String sql) { + String[] breakPointTitle = new String[]{"breakpointno", "funcoid", "lineno", "query", "enable"}; + mockOneRow(sql, breakPointTitle, Arrays.asList(5, funcVo.oid, -1, funcVo.proname, false).toArray()); + } + public void mockPositionOneLine(String sql) { String[] breakPointTitle = new String[] {"func", "linenumber", "targetname"}; Object[] oneRow = new Object[] {new Long(funcVo.oid), @@ -65,7 +112,17 @@ public class MockDebugServiceHelper { funcVo.proname}; mockOneRow(sql, breakPointTitle, oneRow); } - + + /** + * the mockDbePositionOneLine + * + * @param sql the sql statement + */ + public void mockDbePositionOneLine(String sql) { + String[] breakPointTitle = new String[]{"funcoid", "funcname", "lineno", "query"}; + mockOneRow(sql, breakPointTitle, Arrays.asList(funcVo.oid, funcVo.proname, 4, "funcVo.proname").toArray()); + } + public void mockAbortDebug(String sql) { mockOneRow(sql, new String[] {"result"}, new Object[] {new Boolean(true)}); } @@ -89,7 +146,18 @@ public class MockDebugServiceHelper { new Integer(1), new Long(1)}; mockOneRow(sql, columns, oneRow); } - + + /** + * the mockDbeDebugVersion + * + * @param sql the value + */ + public void mockDbeDebugVersion(String sql) { + String[] columns = new String[]{"version"}; + String ver = "(openGauss 3.0.0 build 02c14696) compiled at 2022-04-01 18:29:12 commit 0 last mr release"; + mockOneRow(sql, columns, Arrays.asList(ver).toArray()); + } + public void mockFunctionVo(String sql, Object[] args) { String[] columns = new String[] {"oid", "proname", "proretset", "prorettype", "pronargs", "pronargdefaults", diff --git a/code/datastudio/testcode/LLT/org.opengauss.mppdbide.bl.debug.test.fragment/src/org/opengauss/mppdbide/bl/test/debug/DbeDebugerTest.java b/code/datastudio/testcode/LLT/org.opengauss.mppdbide.bl.debug.test.fragment/src/org/opengauss/mppdbide/bl/test/debug/DbeDebugerTest.java new file mode 100644 index 0000000000000000000000000000000000000000..bacebff1f83fe9c6b360c504df4ec33b326b5169 --- /dev/null +++ b/code/datastudio/testcode/LLT/org.opengauss.mppdbide.bl.debug.test.fragment/src/org/opengauss/mppdbide/bl/test/debug/DbeDebugerTest.java @@ -0,0 +1,254 @@ +/* + * Copyright (c) 2022 Huawei Technologies Co.,Ltd. + * + * openGauss is licensed under Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * 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. + * See the Mulan PSL v2 for more details. + */ + +package org.opengauss.mppdbide.bl.test.debug; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; + +import java.lang.reflect.Field; +import java.sql.SQLException; +import java.sql.SQLWarning; +import java.util.Arrays; +import java.util.List; +import java.util.Locale; +import java.util.Optional; + +import org.junit.After; +import org.junit.Before; +import org.junit.Test; +import org.opengauss.mppdbide.bl.mock.debug.DebugerJdbcTestCaseBase; +import org.opengauss.mppdbide.bl.mock.debug.MockDebugServiceHelper; +import org.opengauss.mppdbide.common.IConnectionProvider; +import org.opengauss.mppdbide.debuger.debug.DebugConstants.DebugOpt; +import org.opengauss.mppdbide.debuger.debug.DebugState; +import org.opengauss.mppdbide.debuger.debug.DebugState.State; +import org.opengauss.mppdbide.debuger.exception.DebugExitException; +import org.opengauss.mppdbide.debuger.service.DebuggerReportService; +import org.opengauss.mppdbide.debuger.service.SourceCodeService; +import org.opengauss.mppdbide.debuger.service.SourceCodeService.CodeDescription; +import org.opengauss.mppdbide.debuger.service.chain.PrepareMsgChian; +import org.opengauss.mppdbide.debuger.service.chain.ServerPortMsgChain; +import org.opengauss.mppdbide.debuger.vo.PositionVo; +import org.opengauss.mppdbide.debuger.vo.SourceCodeVo; +import org.opengauss.mppdbide.debuger.vo.StackVo; +import org.opengauss.mppdbide.debuger.vo.VariableVo; +import org.opengauss.mppdbide.debuger.vo.VersionVo; +import org.opengauss.mppdbide.view.handler.debug.DBConnectionProvider; + +/** + * Title: DbeDebugerTest for use + * + * @since 3.0.0 + */ +public class DbeDebugerTest extends DebugerJdbcTestCaseBase { + /** + * debugger Report Service + */ + public DebuggerReportService debuggerReportService = null; + + /* + * (non-Javadoc) + * + * @see com.mockrunner.jdbc.BasicJDBCTestCaseAdapter#setUp() + */ + @Before + public void setUp() throws Exception { + basicSetUp(new String[]{ + "(openGauss 3.0.0 build 02c14696) compiled at 2022-04-01 18:29:12 commit 0 last mr release"}); + } + + /* + * (non-Javadoc) + * + * @see com.mockrunner.jdbc.BasicJDBCTestCaseAdapter#tearDown() + */ + @After + public void tearDown() throws Exception { + basicTearDown(); + } + + @Override + protected void startDebugService() throws SQLException, InterruptedException { + serviceFactory = createServiceFactory(); + queryService = serviceFactory.getQueryService(); + functionVo = queryService.queryFunction(funcDescAddTest.proname); + mockHelper = new MockDebugServiceHelper(preparedstatementHandler, functionVo); + debuggerReportService = DebuggerReportService.getInstance(); + IConnectionProvider provider = new DBConnectionProvider(database); + debuggerReportService.setAttr(provider, functionVo); + debugService = serviceFactory.getDebugService(functionVo); + debugService.init(); + debugService.noticeReceived(new SQLWarning(PrepareMsgChian.PREPARE_SUCCESS + " SERVER ")); + debugService.noticeReceived(new SQLWarning(ServerPortMsgChain.SERVER_PORT_MATCH + "0")); + try { + debugService.begin(Arrays.asList(null, null, null, null)); + } catch (SQLException sqlExp) { + DebugState debugState = debugService.getServerDebugState(); + forceModifyDebugState(debugState, State.RUNNING); + debugService.attachDebug(); + } + } + + private void forceModifyDebugState(DebugState state, DebugState.State newState) { + try { + Field stackLockField = DebugState.class.getDeclaredField("stateLocked"); + stackLockField.setAccessible(true); + stackLockField.set(state, false); + state.setState(newState); + } catch (NoSuchFieldException | SecurityException | IllegalArgumentException | IllegalAccessException e) { + fail(e.getMessage()); + } + } + + @Test + public void testDbeSourceCodeVo() { + mockHelper.mockDbeInfoCode("select * from DBE_PLDEBUGGER.info_code(?)"); + try { + Optional sourceCode = queryService.getSourceCode(functionVo.oid); + SourceCodeService.CodeDescription.getRunLines(sourceCode.get().getSourceCode()); + SourceCodeService.CodeDescription.getRunLinesNums(sourceCode.get().getSourceCode()); + } catch (SQLException e) { + fail("get breakpoints failed!"); + } + } + + @Test + public void testReportService() { + StringBuffer base = new StringBuffer(); + String sep = System.getProperty("line.separator"); + String baseParam1 = String.format(Locale.ENGLISH, "AS DECLARE%s BEGIN%s IF param1 > 100%s", sep, sep, sep); + base.append(baseParam1); + String baseParam2 = String.format(Locale.ENGLISH, + "THEN%s param4=1;%s END IF;%s IF param4 > 100 THEN%s param4=1;%s END IF;%s", + sep, sep, sep, sep, sep, sep); + base.append(baseParam2); + String baseParam3 = String.format(Locale.ENGLISH, + "IF param2 > 100 THEN%s param4=2;%s END IF;%s END;%s ", sep, sep, sep, sep); + base.append(baseParam3); + CodeDescription baseCode = new CodeDescription(base.toString()); + debuggerReportService.setBaseCode(baseCode); + StringBuffer total = new StringBuffer(); + total.append("CREATE OR REPLACE PROCEDURE gaussdb.insert_777"); + String toParam1 = String.format(Locale.ENGLISH, + "(param1 INT = 0, param2 CHAR(20), param3 CHAR(20), param4 INT = 0)%s AS ", sep); + total.append(toParam1); + String toParam2 = String.format(Locale.ENGLISH, + "DECLARE%s BEGIN%s IF param1 > 100 THEN%s param4=1;%s END IF;%s", sep, sep, sep, sep, sep); + total.append(toParam2); + String toParam3 = String.format(Locale.ENGLISH, + "IF param4 > 100 THEN%s param4=1;%s END IF;%s IF param2 > 100 THEN%s", sep, sep, sep, sep); + total.append(toParam3); + String toParam4 = String.format(Locale.ENGLISH, + "param4=2;%s END IF;%s END;%s", sep, sep, sep); + total.append(toParam4); + CodeDescription totalCode = new CodeDescription(total.toString()); + debuggerReportService.setTotalCode(totalCode); + debuggerReportService.makeReport(); + } + + @Test + public void testDbeBreakPoints() { + mockHelper.mockDbeBreakPoint("select * from DBE_PLDEBUGGER.info_breakpoints()"); + try { + List breakpoints = debugService.getBreakPoints(); + assertEquals(1, breakpoints.size()); + PositionVo positionVo = breakpoints.get(0); + assertEquals(positionVo.func.longValue(), functionVo.oid.longValue()); + assertEquals(positionVo.linenumber.intValue(), -1); + assertEquals(positionVo.targetname, functionVo.proname); + } catch (SQLException e) { + fail("get breakpoints failed!"); + } + } + + @Test + public void testDbeVariable() { + mockHelper.mockDbeVariable("select * from DBE_PLDEBUGGER.print_var(?)"); + try { + List variables = debugService.getVariables(); + assertEquals(1, variables.size()); + VariableVo var = variables.get(0); + assertEquals(var.name, "param1"); + assertTrue(var.value instanceof Object); + if (var.value instanceof String) { + assertEquals((Long.parseLong((String) var.value)), 210101); + } + } catch (SQLException e) { + fail("get variable failed!"); + } + } + + @Test + public void testDbeStack() { + mockHelper.mockDbeStack("SELECT * FROM DBE_PLDEBUGGER.backtrace()"); + try { + List stacks = debugService.getStacks(); + assertEquals(1, stacks.size()); + StackVo stackVo = stacks.get(0); + assertEquals(stackVo.targetname, funcDescAddTest.proname); + assertEquals(stackVo.func.longValue(), functionVo.oid.longValue()); + } catch (SQLException e) { + fail("get breakpoints failed!"); + } + } + + @Test + public void testDbeStepDebug() { + debugService.updateServerPort(1); + DebugOpt[] toTestOpt = new DebugOpt[]{DebugOpt.DBE_STEP_OVER, DebugOpt.DBE_CONTINUE_EXEC}; + List sqls = Arrays + .asList("select * from DBE_PLDEBUGGER.next()", "select * from DBE_PLDEBUGGER.continue()"); + for (String sql : sqls) { + mockHelper.mockDbePositionOneLine(sql); + } + for (DebugOpt opt : toTestOpt) { + try { + PositionVo positionVo = debugService.getPositionVo(opt).get(); + } catch (SQLException e) { + fail("get step pos failed!"); + } catch (DebugExitException e) { + assertTrue(true); + } + } + } + + @Test + public void testDbeSupportDebugVersion() { + mockHelper.mockDbeDebugVersion("select * from version()"); + try { + VersionVo versionVo = debugService.version().get(); + StringBuffer sb = new StringBuffer(); + sb.append("(openGauss 3.0.0 build 02c14696) "); + sb.append("compiled at 2022-04-01 18:29:12 commit 0 last mr release"); + assertEquals(versionVo.version, sb.toString()); + } catch (SQLException sqlExp) { + fail("can\'t run here!"); + } + } + + @Test + public void testDbeStepOutDebug() { + try { + debugService.stepOut().get(); + fail("can\'t run here!"); + } catch (SQLException sqlExp) { + assertTrue(true); + } catch (DebugExitException e) { + fail("can\'t run here!"); + } + } +} diff --git a/code/datastudio/testcode/LLT/org.opengauss.mppdbide.bl.debug.test.fragment/src/org/opengauss/mppdbide/bl/test/debug/vo/BreakPointNoVo.java b/code/datastudio/testcode/LLT/org.opengauss.mppdbide.bl.debug.test.fragment/src/org/opengauss/mppdbide/bl/test/debug/vo/BreakPointNoVo.java new file mode 100644 index 0000000000000000000000000000000000000000..ce98e72e77fc7e3e148adeff8cad6b8575de6b7e --- /dev/null +++ b/code/datastudio/testcode/LLT/org.opengauss.mppdbide.bl.debug.test.fragment/src/org/opengauss/mppdbide/bl/test/debug/vo/BreakPointNoVo.java @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2022 Huawei Technologies Co.,Ltd. + * + * openGauss is licensed under Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * 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. + * See the Mulan PSL v2 for more details. + */ + +package org.opengauss.mppdbide.bl.test.debug.vo; + +import org.opengauss.mppdbide.debuger.annotation.DumpFiled; + +/** + * Title: class + * Description: The Class BreakPointNoVo. + * + * @since 3.0.0 + */ +public class BreakPointNoVo { + /** + * breakpointno of function + */ + @DumpFiled + public int breakpointno; +} diff --git a/code/datastudio/testcode/LLT/org.opengauss.mppdbide.bl.debug.test.fragment/src/org/opengauss/mppdbide/bl/test/debug/vo/ContinueDebugVo.java b/code/datastudio/testcode/LLT/org.opengauss.mppdbide.bl.debug.test.fragment/src/org/opengauss/mppdbide/bl/test/debug/vo/ContinueDebugVo.java new file mode 100644 index 0000000000000000000000000000000000000000..274802db253a175e275183a27ab292cb74e3518d --- /dev/null +++ b/code/datastudio/testcode/LLT/org.opengauss.mppdbide.bl.debug.test.fragment/src/org/opengauss/mppdbide/bl/test/debug/vo/ContinueDebugVo.java @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2022 Huawei Technologies Co.,Ltd. + * + * openGauss is licensed under Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * 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. + * See the Mulan PSL v2 for more details. + */ + +package org.opengauss.mppdbide.bl.test.debug.vo; + +import org.opengauss.mppdbide.debuger.annotation.DumpFiled; + +/** + * Title: class + * Description: The Class ContinueDebugVo. + * + * @since 3.0.0 + */ +public class ContinueDebugVo { + /** + * funcoid of function + */ + @DumpFiled + public Long funcoid; + + /** + * funcname of function + */ + @DumpFiled + public String funcname; + + /** + * lineno of function + */ + @DumpFiled + public int lineno; + + /** + * query of function + */ + @DumpFiled + public String query; +} diff --git a/code/datastudio/testcode/LLT/org.opengauss.mppdbide.bl.debug.test.fragment/src/org/opengauss/mppdbide/bl/test/debug/vo/DelPointVo.java b/code/datastudio/testcode/LLT/org.opengauss.mppdbide.bl.debug.test.fragment/src/org/opengauss/mppdbide/bl/test/debug/vo/DelPointVo.java new file mode 100644 index 0000000000000000000000000000000000000000..8639c5a4e1e794e4230ca180182ae7a7ac87ad4f --- /dev/null +++ b/code/datastudio/testcode/LLT/org.opengauss.mppdbide.bl.debug.test.fragment/src/org/opengauss/mppdbide/bl/test/debug/vo/DelPointVo.java @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2022 Huawei Technologies Co.,Ltd. + * + * openGauss is licensed under Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * 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. + * See the Mulan PSL v2 for more details. + */ + +package org.opengauss.mppdbide.bl.test.debug.vo; + +import org.opengauss.mppdbide.debuger.annotation.DumpFiled; + +/** + * Title: class + * Description: The Class DelPointVo. + * + * @since 3.0.0 + */ +public class DelPointVo { + /** + * delete_breakpoint of function + */ + @DumpFiled + public Boolean delete_breakpoint; +} diff --git a/code/datastudio/testcode/LLT/org.opengauss.mppdbide.bl.debug.test.fragment/src/org/opengauss/mppdbide/bl/test/debug/vo/OidVo.java b/code/datastudio/testcode/LLT/org.opengauss.mppdbide.bl.debug.test.fragment/src/org/opengauss/mppdbide/bl/test/debug/vo/OidVo.java new file mode 100644 index 0000000000000000000000000000000000000000..5dd7bcb2482535175248fa1cbe9f96dd32a04544 --- /dev/null +++ b/code/datastudio/testcode/LLT/org.opengauss.mppdbide.bl.debug.test.fragment/src/org/opengauss/mppdbide/bl/test/debug/vo/OidVo.java @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2022 Huawei Technologies Co.,Ltd. + * + * openGauss is licensed under Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * 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. + * See the Mulan PSL v2 for more details. + */ + +package org.opengauss.mppdbide.bl.test.debug.vo; + +import org.opengauss.mppdbide.debuger.annotation.DumpFiled; + +/** + * Title: class + * Description: The Class OidVo. + * + * @since 3.0.0 + */ +public class OidVo { + /** + * oid of function + */ + @DumpFiled + public Long oid; +} diff --git a/code/datastudio/testcode/LLT/org.opengauss.mppdbide.bl.debug.test.fragment/src/org/opengauss/mppdbide/bl/test/debug/vo/TurnOffVo.java b/code/datastudio/testcode/LLT/org.opengauss.mppdbide.bl.debug.test.fragment/src/org/opengauss/mppdbide/bl/test/debug/vo/TurnOffVo.java new file mode 100644 index 0000000000000000000000000000000000000000..5e48186b5deb4def2367a8c59a9083ac6597979f --- /dev/null +++ b/code/datastudio/testcode/LLT/org.opengauss.mppdbide.bl.debug.test.fragment/src/org/opengauss/mppdbide/bl/test/debug/vo/TurnOffVo.java @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2022 Huawei Technologies Co.,Ltd. + * + * openGauss is licensed under Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * 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. + * See the Mulan PSL v2 for more details. + */ + +package org.opengauss.mppdbide.bl.test.debug.vo; + +import org.opengauss.mppdbide.debuger.annotation.DumpFiled; + +/** + * Title: class + * Description: The Class TurnOffVo. + * + * @since 3.0.0 + */ +public class TurnOffVo { + /** + * turn_off of function + */ + @DumpFiled + public Boolean turn_off; +} diff --git a/information/datastudio/Data Studio User Manual.pdf b/information/datastudio/Data Studio User Manual.pdf index 8a4193887ac0f10eea365f2379c9ab939be4849d..e7cae1b1f8d3b9fb53d28124bbca857b53c45be4 100644 Binary files a/information/datastudio/Data Studio User Manual.pdf and b/information/datastudio/Data Studio User Manual.pdf differ diff --git "a/information/datastudio/Data Studio \347\224\250\346\210\267\346\211\213\345\206\214.pdf" "b/information/datastudio/Data Studio \347\224\250\346\210\267\346\211\213\345\206\214.pdf" index 1aa4721072966781f6e05580ab3ffce2c1a74f6f..a027832b1806141db744138a72dab7ad0048894d 100644 Binary files "a/information/datastudio/Data Studio \347\224\250\346\210\267\346\211\213\345\206\214.pdf" and "b/information/datastudio/Data Studio \347\224\250\346\210\267\346\211\213\345\206\214.pdf" differ diff --git a/information/datastudio/DataStudio 3.0.0 Open Source Software List.xlsx b/information/datastudio/DataStudio 3.1.0 Open Source Software List.xlsx similarity index 100% rename from information/datastudio/DataStudio 3.0.0 Open Source Software List.xlsx rename to information/datastudio/DataStudio 3.1.0 Open Source Software List.xlsx diff --git "a/information/datastudio/DataStudio\346\226\260\345\242\236\345\212\237\350\203\275\350\257\264\346\230\216.docx" "b/information/datastudio/DataStudio\346\226\260\345\242\236\345\212\237\350\203\275\350\257\264\346\230\216.docx" new file mode 100644 index 0000000000000000000000000000000000000000..92cd323cac53b4d225a095df45623bb903f751ca Binary files /dev/null and "b/information/datastudio/DataStudio\346\226\260\345\242\236\345\212\237\350\203\275\350\257\264\346\230\216.docx" differ diff --git a/information/datastudio/New features to DataStudio.docx b/information/datastudio/New features to DataStudio.docx new file mode 100644 index 0000000000000000000000000000000000000000..d6bfb4dd46239d057dca0cbca7e7416b5e7ddc15 Binary files /dev/null and b/information/datastudio/New features to DataStudio.docx differ diff --git a/information/datastudio/changelog.txt b/information/datastudio/changelog.txt index 80e5573e23ab5e6c49037e37d1a3bfa66d7c8f8f..8f5787422a0ea78964dc1862eeca7ab3065b849c 100644 --- a/information/datastudio/changelog.txt +++ b/information/datastudio/changelog.txt @@ -1,4 +1,4 @@ -Data Studio 3.0.0 +Data Studio 3.1.0 ===================================================================================================== -This is the first version of Data Studio supporting openGauss 3.0.0 +This is a version of Data Studio supporting openGauss 3.1.0 ===================================================================================================== diff --git a/information/datastudio/readme.txt b/information/datastudio/readme.txt index d93a095ddb654ee0704b57209765095fcbdc106e..095f1981e40f688e2774504fee19b03377b1391f 100644 --- a/information/datastudio/readme.txt +++ b/information/datastudio/readme.txt @@ -1,4 +1,4 @@ -Data Studio 3.0.0 +Data Studio 3.1.0 ======================================================================== @@ -23,12 +23,12 @@ Minimum 1GB free disk space Software: ---------------------------------------------------------------------- -Java 1.8.0_181 or later +Java 11 or later Databases: ---------------------------------------------------------------------- -openGauss 3.0.0 +openGauss 3.1.0 INSTALLATION