diff --git a/3rd_src/pom.xml b/3rd_src/pom.xml index 022739ae66eaa407d8d6ed72d9d902922efa9689..e49474a379c29547437ee00ad704b28bc10b5e9d 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/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.adapter.gauss/.classpath b/code/datastudio/src/org.opengauss.mppdbide.adapter.gauss/.classpath index 6ae8eb6f0a8021436940397b1574147090eb7259..81a01f259ef4a73d31506ac44d9c4fca34e2005f 100644 --- a/code/datastudio/src/org.opengauss.mppdbide.adapter.gauss/.classpath +++ b/code/datastudio/src/org.opengauss.mppdbide.adapter.gauss/.classpath @@ -1,11 +1,12 @@ - + + diff --git a/code/datastudio/src/org.opengauss.mppdbide.bl/.classpath b/code/datastudio/src/org.opengauss.mppdbide.bl/.classpath index 682e4d0ba30be0b8c0d1f79fe9a0864fc9123e86..273945efda8655a8b9ed6218c8b5c292575ebca5 100644 --- a/code/datastudio/src/org.opengauss.mppdbide.bl/.classpath +++ b/code/datastudio/src/org.opengauss.mppdbide.bl/.classpath @@ -1,5 +1,6 @@ + @@ -9,6 +10,7 @@ - + + 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..574ddf4d47aaaeb7477a585c0a61ae993f3b3e9c 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 @@ -55,6 +55,7 @@ public class DebugObjects extends BatchDropServerObject implements ObjectChange, private ObjectParameter returnType; private Database db; private String usageHint; + private static String coverageHint; private Namespace namespace; private String lang; @@ -88,6 +89,7 @@ public class DebugObjects extends BatchDropServerObject implements ObjectChange, */ public void setUsagehint(String usagehint) { this.usageHint = usagehint; + this.coverageHint = usagehint; } /** @@ -868,7 +870,10 @@ 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..444ff7a6910560a31816741caa150baf7182ffa0 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 @@ -258,6 +258,8 @@ public interface IDebugObject { * @return the template parameters */ ArrayList getTemplateParameters(); + + 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/QueryResVoConvertHelper.java b/code/datastudio/src/org.opengauss.mppdbide.debuger/src/org/opengauss/mppdbide/common/QueryResVoConvertHelper.java new file mode 100644 index 0000000000000000000000000000000000000000..07bf45268dd818e969976b72704f0bcf7683e153 --- /dev/null +++ b/code/datastudio/src/org.opengauss.mppdbide.debuger/src/org/opengauss/mppdbide/common/QueryResVoConvertHelper.java @@ -0,0 +1,161 @@ +package org.opengauss.mppdbide.common; + +import java.sql.ResultSet; +import java.sql.ResultSetMetaData; +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Locale; +import java.util.Map; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +import org.apache.commons.lang.StringUtils; +import org.opengauss.mppdbide.debuger.annotation.ParseVo; +import org.opengauss.mppdbide.debuger.debug.DebugConstants; +import org.opengauss.mppdbide.debuger.vo.BreakPointListVo; +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.debuger.vo.dbe.BacktraceVo; +import org.opengauss.mppdbide.debuger.vo.dbe.InfoBreakpointsVo; +import org.opengauss.mppdbide.debuger.vo.dbe.InfoCodeVo; +import org.opengauss.mppdbide.debuger.vo.dbe.VariablesVo; + +/** + * Convert openGauss 3.0 vo to openGauss2.0 vo + * + * @author gitam + */ +public class QueryResVoConvertHelper { + + public static T parse(ResultSet rs,Class clazz,IConnection conn) throws SQLException { + VersionVo version=VersionHelper.getDebuggerVersion(conn); + return parse(rs,clazz,version); + } + + public static T parse(ResultSet rs,Class clazz,VersionVo versionVo) throws SQLException { + String className= clazz.getName(); + T obj = null; + //if openGauss2.0 command do not need to convert + boolean needConvert=versionVo.getDebuggerVersion().equalsIgnoreCase(DebugConstants.DBE_DEBUGGER); + if(!needConvert) { + obj= ParseVo.parse(rs, clazz); + }else { + switch(className) { + case "org.opengauss.mppdbide.debuger.vo.SourceCodeVo": + obj= convertToSourceCodeVo(rs); + break; + case "org.opengauss.mppdbide.debuger.vo.TotalSourceCodeVo": + break; + } + } + return obj; + } + + public static List parseList(ResultSet rs,Class clazz,IConnection conn) throws SQLException { + VersionVo version=VersionHelper.getDebuggerVersion(conn); + return parseList(rs,clazz,version); + } + + public static List parseList(ResultSet rs,Class clazz,VersionVo versionVo) throws SQLException { + String className= clazz.getName(); + List list = null; + //if openGauss2.0 command do not need to convert + boolean needConvert=versionVo.getDebuggerVersion().equalsIgnoreCase(DebugConstants.DBE_DEBUGGER); + if(!needConvert) { + list= ParseVo.parseList(rs, clazz); + }else { + switch(className) { + case "org.opengauss.mppdbide.debuger.vo.BreakpointVo": + list= covertToInofBreakpointsVo(rs); + break; + case "org.opengauss.mppdbide.debuger.vo.StackVo": + list= covertToInofBacktraceVo(rs); + break; + case "org.opengauss.mppdbide.debuger.vo.VariableVo": + list = covertToInofVariablesVo(rs); + break; + case "org.opengauss.mppdbide.debuger.vo.BreakPointListVo": + list = covertToInofBreakPointList(rs); + break; + } + } + return list; + } + + public static List covertToInofBreakPointList(ResultSet rs) throws SQLException { + List list = new ArrayList(); + List vos = ParseVo.parseList(rs,BreakPointListVo.class); + vos.forEach(item -> { + BreakPointListVo vo = new BreakPointListVo(); + vo.breakpointno = item.breakpointno; + vo.enable = item.enable; + vo.funcoid = item.funcoid; + vo.lineno = item.lineno; + vo.query = item.query; + list.add((T) vo); + }); + return list; + } + + public static List covertToInofVariablesVo(ResultSet rs) throws SQLException { + 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; + } + + public static List covertToInofBacktraceVo(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.getFuncoid(); + vo.linenumber = item.getLineno(); + vo.level = 0; + vo.targetname = item.getQuery(); + list.add((T) vo); + }); + return list; + } + + public static List covertToInofBreakpointsVo(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.getFuncoid(); + vo.linenumber = item.getLineno(); + vo.breakpointno = item.getBreakpointno(); + list.add((T) vo); + }); + return list; + } + + public static T convertToSourceCodeVo(ResultSet rs) throws SQLException { + SourceCodeVo sourceCodeVo = new SourceCodeVo(); + List infoCodeList= ParseVo.parseList(rs,InfoCodeVo.class); + StringBuffer buffer=new StringBuffer(); + infoCodeList.forEach(a->{ + if (a.query.toLowerCase().contains("begin")) { + a.query = a.query.toUpperCase(Locale.ROOT).replaceFirst("BEGIN", "\rBEGIN"); + } + if (a.query.toLowerCase().contains("end")) { + a.query = a.query.toUpperCase(Locale.ROOT).replaceFirst("END", "\rEND"); + } + buffer.append(a.query); + }); + sourceCodeVo.setCodes(infoCodeList); + sourceCodeVo.setSourceCode(buffer.toString()); + return (T) sourceCodeVo; + } +} 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..2fec8519312996ff8f7923b8b8a9931c7a60d7e4 --- /dev/null +++ b/code/datastudio/src/org.opengauss.mppdbide.debuger/src/org/opengauss/mppdbide/common/VersionHelper.java @@ -0,0 +1,50 @@ +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; + +public class VersionHelper { + + /** + * get openGauss debugger version + * @return pl_debugger or dbe_debugger + */ + public static VersionVo getDebuggerVersion(IConnection serverConn) throws SQLException { + if (null == serverConn) { + MPPDBIDELoggerUtility.error("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.setVersion(version); + } + MPPDBIDELoggerUtility.debug("openGauss db info is empty!"); + return versionVo; + } + } + } + + public static DebugOpt getDebugOptByDebuggerVersion(IConnection serverConn,DebugOpt debugOpt) throws SQLException { + if (null == serverConn) { + return debugOpt; + } + VersionVo versionVo=getDebuggerVersion(serverConn); + DebugOpt res=DebugConstants.getDebugOptByDebuggerVersion(debugOpt,versionVo.getDebuggerVersion()); + if (null == res) { + 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..8c26b1628e9991254c6d301d30de96c18dee43c4 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,6 +15,8 @@ package org.opengauss.mppdbide.debuger.debug; +import java.util.HashMap; +import java.util.LinkedHashMap; import java.util.Locale; import java.util.stream.Stream; @@ -28,28 +30,87 @@ public class DebugConstants { * default string length */ public static final int DEFAULT_STRING_BUILD_LEN = 128; + public static final String PL_DEBUGGER="pl_debugger"; + public static final String DBE_DEBUGGER="dbe_debugger"; + public static final Integer DBE_DEBUGGER_MIN_VERSION=300; + public static final LinkedHashMap enumMap=getEnumMap(DebugOpt.class); + public static HashMap oidSqlMap = new HashMap<>(); + + /** + * get DebugOpt by different debugger + * @param debugOpt + * @param debuggerVersion + * @return DebugOpt + */ + public static DebugOpt getDebugOptByDebuggerVersion(DebugOpt debugOpt,String debuggerVersion) { + if(PL_DEBUGGER.equalsIgnoreCase(debuggerVersion)) { + return debugOpt; + }else { + String optName=debugOpt.name(); + optName="DBE_"+optName; + return enumMap.get(optName); + } + } + + /** + * get name and all enum map + * @param + * @param 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), ATTACH_SESSION("pldbg_attach_to_port", 1), STEP_INTO("pldbg_step_into", 1), STEP_OVER("pldbg_step_over", 1), - STEP_OUT("pldbg_step_out", 1), + STEP_OUT("pldbg_step_out", 1),//not support CONTINUE_EXEC("pldbg_continue", 1), ABORT_TARGET("pldbg_abort_target", 1), GET_VARIABLES("pldbg_get_variables", 1), 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),//not support + 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 +156,12 @@ 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/DebugService.java b/code/datastudio/src/org.opengauss.mppdbide.debuger/src/org/opengauss/mppdbide/debuger/service/DebugService.java index ea5d4e2dbb80fc7af994312a22d1188481887edf..98830729c0f1f58d09424176784c49328bdbf2ec 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 @@ -1,4 +1,4 @@ -/* +/* * Copyright (c) 2022 Huawei Technologies Co.,Ltd. * * openGauss is licensed under Mulan PSL v2. @@ -6,7 +6,7 @@ * You may obtain a copy of Mulan PSL v2 at: * * http://license.coscl.org.cn/MulanPSL2 - * + * * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. @@ -27,15 +27,23 @@ import org.opengauss.mppdbide.debuger.debug.DebugState; import org.opengauss.mppdbide.debuger.thread.DebugServerRunable; import org.opengauss.mppdbide.debuger.thread.DebugServerThreadProxy; import org.opengauss.mppdbide.debuger.thread.EventQueueThread; +import org.opengauss.mppdbide.debuger.vo.BreakPointListVo; import org.opengauss.mppdbide.debuger.vo.FunctionVo; import org.opengauss.mppdbide.debuger.vo.PositionVo; import org.opengauss.mppdbide.debuger.vo.SessionVo; 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.debuger.vo.dbe.AttachVo; +import org.opengauss.mppdbide.debuger.vo.dbe.TurnOnVo; import org.opengauss.mppdbide.common.IConnection; +import org.opengauss.mppdbide.common.QueryResVoConvertHelper; +import org.opengauss.mppdbide.utils.ConstantRunLine; import org.opengauss.mppdbide.utils.logger.MPPDBIDELoggerUtility; import org.postgresql.core.NoticeListener; +import org.opengauss.mppdbide.common.VersionHelper; +import org.opengauss.mppdbide.utils.vo.DebuggerStartInfoVo; +import org.opengauss.mppdbide.utils.DebuggerStartConstants; import java.lang.Thread.State; import java.sql.PreparedStatement; @@ -45,7 +53,11 @@ 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; /** * Title: the DebugService class @@ -53,632 +65,814 @@ import java.util.Optional; * you can use by this step: * 1. create and DebugService by new DebugService() * 2. set DebugService.functionVo which come from QueryService.queryFunction - * by functionName + * by functionName * 3. set DebugService.clientConn and DebugService.serverConn, - * this is IConnection instance, your can create ConnectionAdapter objects + * this is IConnection instance, your can create ConnectionAdapter objects * 4. set DebugService.clinetConn and DebugService.serverConn's NoticeListener, - * which is DebugService instance self + * which is DebugService instance self * 5. call DebugService.prepareDebug * 6. call DebugService.startDebug and receive return value for close back server - * thread in end + * thread in end * 7. call DebugService.attachDebug * 8. then you can use stepOver/StepInto/continueExec to control debug process * 9. you can use getVariables and getStacks get variables and stacks info * 10. you can use getBreakPoints/setBreakpoint/dropBreakpoint function to manager - * breakpoints + * breakpoints * 11. when debug over, call DebugService.abortDebug, if forget this operation, - * threadleak will occur + * threadleak will occur * 12. call DebugService.debugOff, if forget this operation, openGauss Database - * will exit!! + * will exit!! * 13. call DebugService.closeConn * sample use you can see DebugTest.java * * @since 3.0.0 */ public class DebugService implements NoticeListener, EventHander, IDebugService { - private static final int DEFAULT_WAIT_LOCK_TIME = 2000; // ms - private IConnection serverConn; - private IConnection clientConn; - private FunctionVo functionVo; - private MsgChainHelper msgChainHelper; - private boolean isRollback = false; - private SessionVo sessionVo = new SessionVo(); - private final Object waitLock = new int[0]; - private DebugState serverState = new DebugState(); - private DebugState clientState = new DebugState(); - private EventQueueThread eventQueueThread = new EventQueueThread(); - private DebugServerThreadProxy serverThreadProxy = new DebugServerThreadProxy(); - - public DebugService() { - eventQueueThread.addHandler(this); - msgChainHelper = new MsgChainHelper(this); - } - - /** - * prepare to debug - * - * @return void - * @throws SQLException the exp - */ - public void prepareDebug() throws SQLException { - List inputsParams = Arrays.asList(functionVo.oid); - serverConn.getDebugOptPrepareStatement( - DebugConstants.DebugOpt.START_SESSION, - inputsParams).execute(); - } - - /** - * start to debug - * - * @param args input args to function - * @return DebugServerThreadProxy debug manager thread - */ - public DebugServerThreadProxy startDebug(List args) { - DebugServerRunable debugServerRunable = new DebugServerRunable( - this, - args, - eventQueueThread); - serverThreadProxy.setDebugServerRunable(debugServerRunable); - serverThreadProxy.start(); - return serverThreadProxy; - } - - /** - * get debug manager thread - * - * @return DebugServerThreadProxy debug manager thread - */ - public DebugServerThreadProxy getServerThreadProxy() { - return serverThreadProxy; - } - - /** - * when server backthread started, this will callback - * - * @param args input args to function - * @return Optional the function result - * @throws SQLException the exp - */ - public Optional serverDebugCallBack(List args) throws SQLException { - try { - serverCallBackBegin(); - 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)); - } - try (ResultSet rs = ps.executeQuery()) { - if (rs.next()) { - return Optional.ofNullable(rs.getObject(1)); - } - return Optional.empty(); - } - } - } finally { - serverCallBackEnd(); - } - } - - /** - * client attach debug - * - * @return void - * @throws SQLException the exp - */ - public void attachDebug() throws SQLException { - waitServerStart(); - List inputParams = Arrays.asList(sessionVo.serverPort); - try (PreparedStatement ps = clientConn.getDebugOptPrepareStatement( - DebugConstants.DebugOpt.ATTACH_SESSION, inputParams)) { - try (ResultSet rs = ps.executeQuery()) { - if (rs.next()) { - clientState.attached(); - sessionVo.clientPort = rs.getInt(1); - return; - } - } - } - throw new SQLException("client attach failed, please check"); - } - - private void waitServerStart() throws SQLException { - synchronized (waitLock) { - try { - waitLock.wait(DEFAULT_WAIT_LOCK_TIME); - } catch (InterruptedException intExp) { - MPPDBIDELoggerUtility.debug("wait has error!!!! err=" + intExp.toString()); - Thread.currentThread().interrupt(); - } - } - - if (!serverState.isRunning()) { - throw new SQLException("server not running, please check!"); - } - } - - /** - * server set debug session off - * - * @return void - * @throws SQLException the exp - */ - public void debugOff() throws SQLException { - serverConn.getDebugOptPrepareStatement( - DebugConstants.DebugOpt.DEBUG_OFF, - new ArrayList(1)).execute(); - } - - /** - * client abort debug - * - * @return Optional true if success - * @throws SQLException the exp - */ - public Optional abortDebug() throws SQLException { - if (clientState.isStopped()) { - return Optional.empty(); - } - List inputParams = Arrays.asList(sessionVo.clientPort); - try (PreparedStatement ps = clientConn.getDebugOptPrepareStatement( - DebugConstants.DebugOpt.ABORT_TARGET, inputParams)) { - clientState.stop(); - clientState.stateLocked(); - try (ResultSet rs = ps.executeQuery()) { - Boolean result = false; - if (rs.next()) { - result = rs.getBoolean(1); - } - return Optional.of(result); - } - } - } - - /** - * step over run - * - * @return Optional the breakpoint line position - * @throws SQLException the exp - * @throws DebugExitException the debug exit exp - */ - @Override - public Optional stepOver() throws SQLException, DebugExitException { - return getPositionVo(DebugConstants.DebugOpt.STEP_OVER); - } - - /** - * step into run - * - * @return Optional the breakpoint line position - * @throws SQLException the exp - * @throws DebugExitException the debug exit exp - */ - @Override - public Optional stepInto() throws SQLException, DebugExitException { - return getPositionVo(DebugConstants.DebugOpt.STEP_INTO); - } - - /** - * step out run - * - * @return Optional the breakpoint line position - * @throws SQLException the exp - * @throws DebugExitException the debug exit exp - */ - @Override - public Optional stepOut() throws SQLException, DebugExitException { - return getPositionVo(DebugOpt.STEP_OUT); - } - - /** - * continue exec run - * - * @return Optional the breakpoint line position - * @throws SQLException the exp - * @throws DebugExitException the debug exit exp - */ - @Override - public Optional continueExec() throws SQLException, DebugExitException { - return getPositionVo(DebugConstants.DebugOpt.CONTINUE_EXEC); - } - - /** - * 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( - DebugConstants.DebugOpt debugOpt - ) throws SQLException, DebugExitException { - clientState.running(); - if (debugOpt == DebugOpt.STEP_OUT) { - throw new SQLException("not support method!"); - } - List inputParams = Arrays.asList(sessionVo.clientPort); - try (PreparedStatement ps = clientConn.getDebugOptPrepareStatement( - debugOpt, inputParams)) { - try (ResultSet rs = ps.executeQuery()) { - // this order is very important, because when debug opt is return, - // maybe server is already over, so must stop debug! - if (!serverState.isRunning()) { - throw new DebugExitException(); - } - PositionVo positionVo = null; - if (rs.next()) { - positionVo = ParseVo.parse(rs, PositionVo.class); - } - return Optional.ofNullable(positionVo); - } - } - } - - /** - * get cur variables - * - * @return List all variables - * @throws SQLException the exp - */ - @Override - public List getVariables() throws SQLException { - return getListVos(DebugConstants.DebugOpt.GET_VARIABLES, VariableVo.class); - } - - /** - * get cur stacks - * - * @return List all stacks - * @throws SQLException the exp - */ - @Override - public List getStacks() throws SQLException { - return getListVos(DebugConstants.DebugOpt.GET_STACKS, StackVo.class); - } - - /** - * get cur breakpoints - * - * @return List all breakpoints - * @throws SQLException the exp - */ - @Override - public List getBreakPoints() throws SQLException { - return getListVos(DebugConstants.DebugOpt.GET_BREAKPOINTS, PositionVo.class); - } - - private List getListVos(DebugConstants.DebugOpt debugOpt, Class clazz) throws SQLException { - List inputParams = Arrays.asList(sessionVo.clientPort); - try (PreparedStatement ps = clientConn.getDebugOptPrepareStatement( - debugOpt, inputParams)) { - try (ResultSet rs = ps.executeQuery()) { - List results = ParseVo.parseList(rs, clazz); - return results; - } - } - } - - /** - * 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 disposeBreakpoint(DebugConstants.DebugOpt.SET_BREAKPOINT, positionVo); - } - - /** - * 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 disposeBreakpoint(DebugConstants.DebugOpt.DROP_BREAKPOINT, positionVo); - } - - /** - * set/delete breakpoint - * - * @param debugOpt which opteration to exec - * @param positionVo which line will set breakpoint - * @return boolean true if success - * @throws SQLException the exp - */ - public boolean disposeBreakpoint(DebugConstants.DebugOpt debugOpt, - PositionVo positionVo) throws SQLException { - if (positionVo.func == null || positionVo.func.intValue() == 0) { - positionVo.func = functionVo.oid; - } - - List inputParams = Arrays.asList( - sessionVo.clientPort, - positionVo.func, - positionVo.linenumber - ); - try (PreparedStatement ps = clientConn.getDebugOptPrepareStatement( - debugOpt, inputParams)) { - try (ResultSet rs = ps.executeQuery()) { - boolean result = false; - if (rs.next()) { - result = rs.getBoolean(1); - } - return result; - } - } - } - - /** - * set server connection - * - * @param serverConn connection to set of server - * @return void - */ - public void setServerConn(IConnection serverConn) { - this.serverConn = serverConn; - this.serverConn.setNoticeListener(this); - } - - /** - * set client connection - * - * @param clientConn connection - * @return void - */ - public void setClientConn(IConnection clientConn) { - this.clientConn = clientConn; - this.clientConn.setNoticeListener(this); - } - - /** - * close all connection - * - * @return void - */ - @Override - public void closeService() { - eventQueueThread.stopThread(); - try { - if (clientConn != null) { - clientConn.close(); - clientConn = null; - } - } catch (SQLException sqlErr) { - MPPDBIDELoggerUtility.warn("clientConn close failed!err=" + sqlErr.toString()); - } - - try { - if (serverConn != null) { - serverConn.close(); - serverConn = null; - } - } catch (SQLException sqlErr) { - MPPDBIDELoggerUtility.warn("serverConn close failed, err=" + sqlErr.toString()); - } - } - - /** - * dispose sql warning of notice - * - * @param notice the notice - * @return void - */ - @Override - public void noticeReceived(SQLWarning notice) { - if (notice == null || notice.getMessage() == null) { - return; - } - String msgString = notice.getMessage(); - MPPDBIDELoggerUtility.debug("sql message:" + msgString); - msgChainHelper.handleSqlMsg(new Event(EventMessage.ON_SQL_MSG, msgString)); - } - - /** - * handle event - * - * @param event event to handle - * @return void - */ - @Override - public void handleEvent(Event event) { - msgChainHelper.handleEventMsg(event); - } - - /** - * update server port - * - * @param serverPort the port to set - * @return void - */ - public void updateServerPort(int serverPort) { - sessionVo.serverPort = serverPort; - serverState.running(); - synchronized (waitLock) { - waitLock.notifyAll(); - } - } - - /** - * update server state with exception - * - * @return void - */ - public void updateServerWithException() { - serverState.terminaled(); - } - - /** - * update server state with normal exit - * - * @param result the execute result - * @return void - */ - public void updateServerWithResult(Object result) { - serverState.stop(); - serverState.stateLocked(); - sessionVo.result = result; - serverThreadProxy.start(); - } - - @Override - public Optional version() throws SQLException { - try (PreparedStatement ps = serverConn.getDebugOptPrepareStatement( - DebugConstants.DebugOpt.DEBUG_VERSION, new ArrayList<>(1))) { - try (ResultSet rs = ps.executeQuery()) { - if (rs.next()) { - return Optional.ofNullable(ParseVo.parse(rs, VersionVo.class)); - } - return Optional.empty(); - } - } - } - - /** - * begin debug - * - * @param args function input args - * @return void - * @throws SQLException sql exception - */ - @Override - public void begin(List args) throws SQLException { - init(); - prepareDebug(); - startDebug(args); - attachDebug(); - } - - /** - * end debug - * - * @return void - */ - @Override - public void end() { - try { - abortDebug(); - } catch (SQLException e) { - MPPDBIDELoggerUtility.debug("abortDebug with error:" + e.toString()); - } - serverThreadProxy.join(); - try { - debugOff(); - } catch (SQLException e) { - MPPDBIDELoggerUtility.debug("debugOff with error:" + e.toString()); - } - closeService(); - } - - /** - * get normal end result - * - * @return Optional the result - */ - @Override - public Optional getResult() { - if (isNormalEnd()) { - return Optional.ofNullable(sessionVo.result); - } - return Optional.empty(); - } - - /** - * is normal end - * - * @return true if normal end - */ - @Override - public boolean isNormalEnd() { - return serverState.isNormalStopped(); - } - - /** - * is debug server still running - * - * @return true if running - */ - @Override - public boolean isRunning() { - return getServerDebugState().isRunning(); - } - - /** - * set function vo - * - * @param functionVo function vo - * @return void - */ - public void setFunctionVo(FunctionVo functionVo) { - this.functionVo = functionVo; - } - - /** - * get server state - * - * @return DebugState state of server - */ - public DebugState getServerDebugState() { - return serverState; - } - - /** - * get server state - * - * @return DebugState state of client - */ - public DebugState getClientDebugState() { - return clientState; - } - - /** - * add server debug exit listener - * - * @param handler event handler of exit - * @return void - */ - @Override - public void addServerExistListener(EventHander handler) { - eventQueueThread.addHandler(handler); - } - - @Override - public void init() { - if (eventQueueThread.getState() == State.NEW) { - eventQueueThread.start(); - } - } - - @Override - public boolean isRollback() { - return isRollback; - } - - @Override - public void setRollback(boolean isRollback) { - this.isRollback = isRollback; - } - - private void serverCallBackBegin() throws SQLException { - serverExecuteInner("begin;"); - } - - private void serverCallBackEnd() throws SQLException { - if (isRollback()) { - serverExecuteInner("rollback;"); - } else { - serverExecuteInner("commit;"); - } - } - - private void serverExecuteInner(String sql) throws SQLException { - try (PreparedStatement ps = serverConn.getStatement(sql)) { - ps.execute(); - } - } + private static final int DEFAULT_WAIT_LOCK_TIME = 2000; // ms + private IConnection serverConn; + private IConnection clientConn; + private FunctionVo functionVo; + private MsgChainHelper msgChainHelper; + private boolean isRollback = false; + private SessionVo sessionVo = new SessionVo(); + private TurnOnVo turnOnVo=null; + private final Object waitLock = new int[0]; + private DebugState serverState = new DebugState(); + private DebugState clientState = new DebugState(); + private EventQueueThread eventQueueThread = new EventQueueThread(); + private DebugServerThreadProxy serverThreadProxy = new DebugServerThreadProxy(); + public static final Map> map = new ConcurrentHashMap<>(); + public DebuggerReportService reportService = DebuggerReportService.getInstance(); + + public DebugService() { + eventQueueThread.addHandler(this); + msgChainHelper = new MsgChainHelper(this); + } + + /** + * prepare to debug + * + * @return void + * @throws SQLException the exp + */ + public void prepareDebug() throws SQLException { + List inputsParams = Arrays.asList(functionVo.oid); + DebugOpt opt=VersionHelper.getDebugOptByDebuggerVersion(clientConn,DebugConstants.DebugOpt.START_SESSION); + ResultSet rs=serverConn.getDebugOptPrepareStatement(opt,inputsParams).executeQuery(); + if(rs.next()) { + if (!getVersion()) { + turnOnVo=ParseVo.parse(rs, TurnOnVo.class); + SQLWarning sql=new SQLWarning("Pldebugger is started successfully, you are SERVER now."); + noticeReceived(sql); + } + + } + } + + /** + * start to debug + * + * @param args input args to function + * @return DebugServerThreadProxy debug manager thread + */ + public DebugServerThreadProxy startDebug(List args) { + DebugServerRunable debugServerRunable = new DebugServerRunable( + this, + args, + eventQueueThread); + serverThreadProxy.setDebugServerRunable(debugServerRunable); + serverThreadProxy.start(); + return serverThreadProxy; + } + + /** + * get debug manager thread + * + * @return DebugServerThreadProxy debug manager thread + */ + public DebugServerThreadProxy getServerThreadProxy() { + return serverThreadProxy; + } + + /** + * when server backthread started, this will callback + * + * @param args input args to function + * @return Optional the function result + * @throws SQLException the exp + */ + public Optional serverDebugCallBack(List args) throws SQLException { + try { + serverCallBackBegin(); + 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)); + } + if (!getVersion()) { + Timer timer = new Timer(); + timer.schedule(new TimerTask() { + 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 { + serverCallBackEnd(); + } + } + + /** + * client attach debug + * + * @return void + * @throws SQLException the exp + */ + public void attachDebug() throws SQLException { + if (!getVersion()) { + try { + Thread.sleep(DEFAULT_WAIT_LOCK_TIME); + } catch (InterruptedException e) { + e.printStackTrace(); + } + } + waitServerStart(); + List inputParams = Arrays.asList(sessionVo.serverPort); + DebugOpt opt=VersionHelper.getDebugOptByDebuggerVersion(clientConn,DebugConstants.DebugOpt.ATTACH_SESSION); + + if (!getVersion()) { + inputParams=Arrays.asList(turnOnVo.nodename,sessionVo.serverPort); + } + try (PreparedStatement ps = clientConn.getDebugOptPrepareStatement(opt, inputParams)) { + try (ResultSet rs = ps.executeQuery()) { + if (rs.next()) { + clientState.attached(); + if (getVersion()) { + sessionVo.clientPort = rs.getInt(1); + }else { + AttachVo attachVo=ParseVo.parse(rs, AttachVo.class); + sessionVo.clientPort=attachVo.lineno; + } + + return; + } + }catch(Exception e) { + e.printStackTrace(); + } + } + throw new SQLException("client attach failed, please check"); + } + + private void waitServerStart() throws SQLException { + synchronized (waitLock) { + try { + waitLock.wait(DEFAULT_WAIT_LOCK_TIME); + } catch (InterruptedException intExp) { + MPPDBIDELoggerUtility.debug("wait has error!!!! err=" + intExp.toString()); + Thread.currentThread().interrupt(); + } + } + + if (!serverState.isRunning()) { + throw new SQLException("server not running, please check!"); + } + } + + /** + * server set debug session off + * + * @return void + * @throws SQLException the exp + */ + public void debugOff() throws SQLException { + List inputParams = new ArrayList(1); + DebugOpt opt=DebugConstants.DebugOpt.DEBUG_OFF; + if (!getVersion()) { + inputParams = Arrays.asList(functionVo.oid); + opt = DebugConstants.DebugOpt.DBE_DEBUG_OFF; + clientConn.getDebugOptPrepareStatement(opt,inputParams).execute(); + } else if (null != serverConn){ + serverConn.getDebugOptPrepareStatement(opt,inputParams).execute(); + } + } + + /** + * client abort debug + * + * @return Optional true if success + * @throws SQLException the exp + */ + public Optional abortDebug() throws SQLException { + if (clientState.isStopped()) { + return Optional.empty(); + } + List inputParams = Arrays.asList(sessionVo.clientPort); + DebugConstants.DebugOpt opt=VersionHelper.getDebugOptByDebuggerVersion(clientConn,DebugConstants.DebugOpt.ABORT_TARGET); + if (!getVersion()) { + inputParams=new ArrayList(); + } + try (PreparedStatement ps = clientConn.getDebugOptPrepareStatement(opt, inputParams)) { + clientState.stop(); + clientState.stateLocked(); + try (ResultSet rs = ps.executeQuery()) { + Boolean result = false; + if (rs.next()) { + result = rs.getBoolean(1); + } + return Optional.of(result); + }catch(Exception e) { + e.printStackTrace(); + return Optional.of(true); + } + } + } + + /** + * step over run + * + * @return Optional the breakpoint line position + * @throws SQLException the exp + * @throws DebugExitException the debug exit exp + */ + @Override + public Optional stepOver() throws SQLException, DebugExitException { + return getPositionVo(DebugConstants.DebugOpt.STEP_OVER); + } + + /** + * step into run + * + * @return Optional the breakpoint line position + * @throws SQLException the exp + * @throws DebugExitException the debug exit exp + */ + @Override + public Optional stepInto() throws SQLException, DebugExitException { + return getPositionVo(DebugConstants.DebugOpt.STEP_INTO); + } + + /** + * step out run + * + * @return Optional the breakpoint line position + * @throws SQLException the exp + * @throws DebugExitException the debug exit exp + */ + @Override + public Optional stepOut() throws SQLException, DebugExitException { + return getPositionVo(DebugOpt.STEP_OUT); + } + + /** + * continue exec run + * + * @return Optional the breakpoint line position + * @throws SQLException the exp + * @throws DebugExitException the debug exit exp + */ + @Override + public Optional continueExec() throws SQLException, DebugExitException { + return getPositionVo(DebugConstants.DebugOpt.CONTINUE_EXEC); + } + + /** + * 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( + DebugConstants.DebugOpt debugOpt + ) throws SQLException, DebugExitException { + clientState.running(); + if (debugOpt == DebugOpt.STEP_OUT) { + throw new SQLException("not support method!"); + } + List inputParams = Arrays.asList(sessionVo.clientPort); + DebugOpt opt=VersionHelper.getDebugOptByDebuggerVersion(clientConn,debugOpt); + if (!getVersion()) { + inputParams=new ArrayList(); + } + try (PreparedStatement ps = clientConn.getDebugOptPrepareStatement(opt, inputParams)) { + try (ResultSet rs = ps.executeQuery()) { + // this order is very important, because when debug opt is return, + // maybe server is already over, so must stop debug! + if (!serverState.isRunning()) { + throw new DebugExitException(); + } + PositionVo positionVo = null; + if (rs.next()) { + if (getVersion()) { + positionVo = ParseVo.parse(rs, PositionVo.class); + }else { + AttachVo vo = new AttachVo(); + vo = ParseVo.parse(rs, AttachVo.class); + positionVo = new PositionVo(vo.funcoid,vo.lineno,vo.funcname); + } + } + return Optional.ofNullable(positionVo); + }catch(Exception e) { + e.printStackTrace(); + return Optional.empty(); + } + } + } + + /** + * get cur variables + * + * @return List all variables + * @throws SQLException the exp + */ + @Override + public List getVariables() throws SQLException { + return getAllVariable(DebugConstants.DebugOpt.GET_VARIABLES, VariableVo.class); + } + + private List getAllVariable(DebugConstants.DebugOpt debugOpt, Class clazz) throws SQLException { + if (!getVersion()) { + List vos = new ArrayList(); + map.get(functionVo.oid).forEach(item -> { + DebugOpt opt; + try { + opt = DebugConstants.DebugOpt.DBE_GET_VARIABLES; + List inputParams = Arrays.asList(item); + try (PreparedStatement ps = clientConn.getDebugOptPrepareStatement(opt, inputParams)) { + try (ResultSet rs = ps.executeQuery()) { + if (rs.next()) { + vos.addAll(QueryResVoConvertHelper.parseList(rs,clazz,clientConn)); + } + + }catch(Exception e) { + e.printStackTrace(); + } + } + } catch (SQLException e1) { + e1.printStackTrace(); + } + }); + return vos; + } else { + return getListVos(debugOpt, clazz); + } + } + + /** + * get cur stacks + * + * @return List all stacks + * @throws SQLException the exp + */ + @Override + public List getStacks() throws SQLException { + if (getVersion()) { + return getListVos(DebugConstants.DebugOpt.GET_STACKS, StackVo.class); + } else { + return getListVos_v3(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 { + if (getVersion()) { + return getListVos(DebugConstants.DebugOpt.GET_BREAKPOINTS, PositionVo.class); + } else { + List list = getListVos_v3(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.enable = item.enable; + vo.func = item.funcoid; + vo.linenumber = item.lineno; + vo.targetname = item.query; + vos.add(vo); + }); + return vos; + } + } + + private List getListVos_v3(DebugConstants.DebugOpt debugOpt, Class clazz, List inputParams) throws SQLException { + DebugOpt opt=VersionHelper.getDebugOptByDebuggerVersion(clientConn,debugOpt); + try (PreparedStatement ps = clientConn.getDebugOptPrepareStatement(opt, inputParams)) { + try (ResultSet rs = ps.executeQuery()) { + List results = QueryResVoConvertHelper.parseList(rs,clazz,clientConn); + return results; + }catch(Exception e) { + e.printStackTrace(); + return new ArrayList(); + } + } + } + + private List getListVos(DebugConstants.DebugOpt debugOpt, Class clazz) throws SQLException { + List inputParams = Arrays.asList(sessionVo.clientPort); + try (PreparedStatement ps = clientConn.getDebugOptPrepareStatement( + debugOpt, inputParams)) { + try (ResultSet rs = ps.executeQuery()) { + List results = ParseVo.parseList(rs, clazz); + return results; + } + } + } + + /** + * 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 { + if (getVersion()) { + return disposeBreakpoint(DebugConstants.DebugOpt.SET_BREAKPOINT, positionVo,false); + }else { + return disposeBreakpoint(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 { + if (getVersion()) { + return disposeBreakpoint(DebugConstants.DebugOpt.DROP_BREAKPOINT, positionVo, true); + }else { + return disposeBreakpoint(DebugConstants.DebugOpt.DBE_DROP_BREAKPOINT, positionVo, true); + } + } + + /** + * set/delete breakpoint + * + * @param debugOpt which opteration to exec + * @param positionVo which line will set breakpoint + * @return boolean true if success + * @throws SQLException the exp + */ + public boolean disposeBreakpoint(DebugConstants.DebugOpt debugOpt,PositionVo positionVo, Boolean isDelete) throws SQLException { + if (positionVo.func == null || positionVo.func.intValue() == 0) { + positionVo.func = functionVo.oid; + } + List inputParams; + if (getVersion()) { + inputParams = Arrays.asList(sessionVo.clientPort,positionVo.func,positionVo.linenumber); + } else { + 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); + } + } + try (PreparedStatement ps = clientConn.getDebugOptPrepareStatement(debugOpt, inputParams)) { + try (ResultSet rs = ps.executeQuery()) { + boolean result = false; + if (rs.next() && getVersion()) { + result = rs.getBoolean(1); + } + return result; + } + } + } + + /** + * set server connection + * + * @param serverConn connection to set of server + * @return void + */ + public void setServerConn(IConnection serverConn) { + this.serverConn = serverConn; + this.serverConn.setNoticeListener(this); + } + + /** + * set client connection + * + * @param clientConn connection + * @return void + */ + public void setClientConn(IConnection clientConn) { + this.clientConn = clientConn; + this.clientConn.setNoticeListener(this); + } + + /** + * close all connection + * + * @return void + */ + @Override + public void closeService() { + eventQueueThread.stopThread(); + try { + if (clientConn != null) { + clientConn.close(); + clientConn = null; + } + } catch (SQLException sqlErr) { + MPPDBIDELoggerUtility.warn("clientConn close failed!err=" + sqlErr.toString()); + } + + try { + if (serverConn != null) { + serverConn.close(); + serverConn = null; + } + } catch (SQLException sqlErr) { + MPPDBIDELoggerUtility.warn("serverConn close failed, err=" + sqlErr.toString()); + } + if (null != reportService) { + try { + if (null != reportService.serverConn) { + reportService.serverConn.close(); + reportService.serverConn=null; + } + } catch (SQLException sqlErr) { + MPPDBIDELoggerUtility.warn("reportService serverConn close failed, err=" + sqlErr.toString()); + } + try { + if (null != reportService.clientConn) { + reportService.clientConn.close(); + reportService.clientConn=null; + } + } catch (SQLException sqlErr) { + MPPDBIDELoggerUtility.warn("reportService clientConn close failed, err=" + sqlErr.toString()); + } + } + } + + /** + * dispose sql warning of notice + * + * @param notice the notice + * @return void + */ + @Override + public void noticeReceived(SQLWarning notice) { + if (notice == null || notice.getMessage() == null) { + return; + } + String msgString = notice.getMessage(); + MPPDBIDELoggerUtility.debug("sql message:" + msgString); + msgChainHelper.handleSqlMsg(new Event(EventMessage.ON_SQL_MSG, msgString)); + } + + /** + * handle event + * + * @param event event to handle + * @return void + */ + @Override + public void handleEvent(Event event) { + msgChainHelper.handleEventMsg(event); + } + + /** + * update server port + * + * @param serverPort the port to set + * @return void + */ + public void updateServerPort(int serverPort) { + sessionVo.serverPort = serverPort; + serverState.running(); + synchronized (waitLock) { + waitLock.notifyAll(); + } + } + + /** + * update server state with exception + * + * @return void + */ + public void updateServerWithException() { + serverState.terminaled(); + } + + /** + * update server state with normal exit + * + * @param result the execute result + * @return void + */ + public void updateServerWithResult(Object result) { + serverState.stop(); + serverState.stateLocked(); + sessionVo.result = result; + serverThreadProxy.start(); + } + + @Override + public Optional version() throws SQLException { + try (PreparedStatement ps = serverConn.getDebugOptPrepareStatement( + DebugConstants.DebugOpt.DEBUG_VERSION, new ArrayList<>(1))) { + try (ResultSet rs = ps.executeQuery()) { + if (rs.next()) { + return Optional.ofNullable(ParseVo.parse(rs, VersionVo.class)); + } + return Optional.empty(); + } + } + } + + /** + * begin debug + * + * @param args function input args + * @return void + * @throws SQLException sql exception + */ + @Override + public void begin(List args) throws SQLException { + ConstantRunLine.isContinue = null; + ConstantRunLine.isPldebugger = null; + ConstantRunLine.passLine.clear(); + ConstantRunLine.isTerminate = true; + DebuggerStartInfoVo startInfo=DebuggerStartConstants.getStartInfo(functionVo.oid); + startInfo.args=args; + startInfo.oid=functionVo.oid; + startInfo.ifMakeReport=true; + DebuggerStartConstants.setStartInfo(functionVo.oid, startInfo); + getVersion(); + init(); + prepareDebug(); + startDebug(args); + attachDebug(); + } + + public boolean getVersion() { + if (null == ConstantRunLine.isPldebugger) { + try { + ConstantRunLine.isPldebugger = VersionHelper.getDebuggerVersion(clientConn).isPldebugger(); + } catch (SQLException e) { + e.printStackTrace(); + } + } + return ConstantRunLine.isPldebugger; + } + + /** + * end debug + * + * @return void + */ + @Override + public void end() { + try { + abortDebug(); + } catch (SQLException e) { + MPPDBIDELoggerUtility.debug("abortDebug with error:" + e.toString()); + } + + serverThreadProxy.join(); + + try { + debugOff(); + Thread.sleep(500); + } catch (Exception e) { + MPPDBIDELoggerUtility.debug("debugOff with error:" + e.toString()); + } + closeService(); + } + + /** + * get normal end result + * + * @return Optional the result + */ + @Override + public Optional getResult() { + if (isNormalEnd()) { + return Optional.ofNullable(sessionVo.result); + } + return Optional.empty(); + } + + /** + * is normal end + * + * @return true if normal end + */ + @Override + public boolean isNormalEnd() { + return serverState.isNormalStopped(); + } + + /** + * is debug server still running + * + * @return true if running + */ + @Override + public boolean isRunning() { + return getServerDebugState().isRunning(); + } + + /** + * set function vo + * + * @param functionVo function vo + * @return void + */ + public void setFunctionVo(FunctionVo functionVo) { + this.functionVo = functionVo; + } + + /** + * get server state + * + * @return DebugState state of server + */ + public DebugState getServerDebugState() { + return serverState; + } + + /** + * get server state + * + * @return DebugState state of client + */ + public DebugState getClientDebugState() { + return clientState; + } + + /** + * add server debug exit listener + * + * @param handler event handler of exit + * @return void + */ + @Override + public void addServerExistListener(EventHander handler) { + eventQueueThread.addHandler(handler); + } + + @Override + public void init() { + if (eventQueueThread.getState() == State.NEW) { + eventQueueThread.start(); + } + } + + @Override + public boolean isRollback() { + return isRollback; + } + + @Override + public void setRollback(boolean isRollback) { + this.isRollback = isRollback; + } + + private void serverCallBackBegin() throws SQLException { + serverExecuteInner("begin;"); + } + + private void serverCallBackEnd() throws SQLException { + if (isRollback()) { + serverExecuteInner("rollback;"); + } else { + serverExecuteInner("commit;"); + } + } + + private void serverExecuteInner(String sql) throws SQLException { + if (null != serverConn) { + try (PreparedStatement ps = serverConn.getStatement(sql)) { + ps.execute(); + } + } + } } 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..e70e0870b33be1333a50c7218d2a14dc332b094b --- /dev/null +++ b/code/datastudio/src/org.opengauss.mppdbide.debuger/src/org/opengauss/mppdbide/debuger/service/DebuggerReportService.java @@ -0,0 +1,261 @@ +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 java.util.stream.Collectors; + +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.ConstantRunLine; +import org.opengauss.mppdbide.utils.DebuggerStartConstants; +import org.opengauss.mppdbide.utils.logger.MPPDBIDELoggerUtility; +import org.opengauss.mppdbide.utils.vo.DebuggerEndInfoVo; +import org.opengauss.mppdbide.utils.vo.DebuggerStartInfoVo; + +/** + * 覆盖率记录生成 + * + * @author gitam + */ +public class DebuggerReportService { + private static DebuggerReportService debuggerReportService = new DebuggerReportService(); + public IConnection serverConn; + public IConnection clientConn; + private FunctionVo functionVo; + private TurnOnVo turnOnVo; + private DebuggerStartInfoVo startInfo; + public static final int CODE_BASE_OFFSET = 1; + + private CodeDescription baseCodeDesc = null; + private CodeDescription totalCodeDesc = null; + + public static DebuggerReportService getInstance() { + return debuggerReportService; + } + + public void setBaseCode(CodeDescription baseCodeDesc) { + this.baseCodeDesc = baseCodeDesc; + } + + public void setTotalCode(CodeDescription totalCodeDesc) { + this.totalCodeDesc = totalCodeDesc; + } + + public DebuggerReportService() { + + } + + 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"; + } + + public void setAttr(IConnectionProvider connectProvider, FunctionVo functionVo) { + try { + this.serverConn = connectProvider.getValidFreeConnection(); + this.clientConn = connectProvider.getValidFreeConnection(); + this.functionVo = functionVo; + } catch (SQLException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + + /** + * 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; + } + + /** + * 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 = DebuggerStartConstants.getStartInfo(functionVo.oid); + if(!startInfo.ifMakeReport) { + return; + } + List inputsParams = Arrays.asList(functionVo.oid); + try { + //DBE_DEBUG_OFF + DebugOpt opt = DebugConstants.DebugOpt.DBE_DEBUG_OFF; + ResultSet 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(() -> { + try { + doClient(); + } catch (Exception e) { + e.printStackTrace(); + } + }); + ps.executeQuery(); + } + } catch (SQLException e) { + e.printStackTrace(); + } + } + + public void doClient() { + ConstantRunLine.runList.clear(); + List runLinks = new ArrayList(); + List historyList=DebuggerStartConstants.getHistoryList(functionVo.oid); + // 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(); +// if (rs.next()) { +// AttachVo attachVo=ParseVo.parse(rs, AttachVo.class); +// Integer lineNo=attachVo.lineno; +// lineNo++; +// runLinks.add(lineNo.toString()); +// } + } catch (SQLException e1) { + // TODO Auto-generated catch block + e1.printStackTrace(); + } + 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)); + } +// if (lineNo == 0) { +// Integer last = Integer.valueOf(runLinks.get(runLinks.size() - 1)); +// last++; +// //runLinks.add(String.valueOf(last)); +// hasNext = false; +// } else { +// lineNo++; +// runLinks.add(String.valueOf(lineNo)); +// } + } else { + hasNext = false; + } + + } catch (Exception e) { + hasNext = false; + } + } + ConstantRunLine.runList.addAll(runLinks); + DebuggerEndInfoVo endInfo = new DebuggerEndInfoVo(); + String runStr = runLinks.stream().map(String::valueOf).collect(Collectors.joining(",")); + endInfo.runStr = runStr; + endInfo.setInfo(startInfo); + historyList.add(endInfo); + DebuggerStartConstants.setHistoryList(functionVo.oid, historyList); + String createTableSql="CREATE TABLE IF NOT EXISTS his_coverage( oid BIGINT, cid BIGINT, coverageLines VARCHAR, remarkLines VARCHAR, endTime BIGINT,sourceCode VARCHAR);"; + try { + clientConn.getStatement(createTableSql).execute(); + String insertSql="insert into his_coverage VALUES(?,?,?,?,?,?);"; + PreparedStatement preparedStatement= clientConn.getStatement(insertSql); + 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); + preparedStatement.execute(); + } catch (SQLException e) { + e.printStackTrace(); + } + } + + 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/IDebugService.java b/code/datastudio/src/org.opengauss.mppdbide.debuger/src/org/opengauss/mppdbide/debuger/service/IDebugService.java index 6ddb1c65120fa61d76d57e4bd75e943476a34c2b..4cb3c42a1aa6cd49595b97e8213dacd9181de792 100644 --- a/code/datastudio/src/org.opengauss.mppdbide.debuger/src/org/opengauss/mppdbide/debuger/service/IDebugService.java +++ b/code/datastudio/src/org.opengauss.mppdbide.debuger/src/org/opengauss/mppdbide/debuger/service/IDebugService.java @@ -194,4 +194,7 @@ public interface IDebugService extends IService { * @return true if running */ boolean isRunning(); + + + } \ No newline at end of file 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..14322c473c9a023e00928c94663576e7adee77ad 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 @@ -18,10 +18,14 @@ 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.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.debuger.vo.VersionVo; import org.opengauss.mppdbide.common.IConnection; +import org.opengauss.mppdbide.common.QueryResVoConvertHelper; +import org.opengauss.mppdbide.common.VersionHelper; import org.opengauss.mppdbide.utils.logger.MPPDBIDELoggerUtility; import java.sql.PreparedStatement; @@ -66,9 +70,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 +98,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..2100564ee22420b78ceb39a28c0adcd727c110cc 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 @@ -1,4 +1,4 @@ -/* +/* * Copyright (c) 2022 Huawei Technologies Co.,Ltd. * * openGauss is licensed under Mulan PSL v2. @@ -6,7 +6,7 @@ * You may obtain a copy of Mulan PSL v2 at: * * http://license.coscl.org.cn/MulanPSL2 - * + * * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. @@ -23,7 +23,6 @@ import org.opengauss.mppdbide.common.IConnection; import org.opengauss.mppdbide.common.IConnectionProvider; import org.opengauss.mppdbide.debuger.vo.VersionVo; import org.opengauss.mppdbide.utils.logger.MPPDBIDELoggerUtility; - import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; 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..a8b6065f5e6d19994a9b29491a699fc5df323792 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 @@ -15,12 +15,16 @@ package org.opengauss.mppdbide.debuger.service; +import org.apache.commons.lang.StringUtils; import org.opengauss.mppdbide.debuger.exception.DebugPositionNotFoundException; +import java.util.ArrayList; import java.util.Arrays; +import java.util.Iterator; import java.util.List; import java.util.Locale; import java.util.stream.Collectors; +import java.util.stream.Stream; /** * Title: the SourceCodeService class @@ -223,8 +227,70 @@ public class SourceCodeService implements IService { * @return List the list of code */ public static List getLines(String srcCode) { - return Arrays.stream(srcCode.split("[\\n]")).collect(Collectors.toList()); + List s1 = Arrays.stream(srcCode.split("[\r]")).filter(item-> !item.isBlank()).collect(Collectors.toList()); + List s2 = Arrays.stream(srcCode.split("[\\n]")).filter(item-> !item.isBlank()).collect(Collectors.toList()); + List s3 = Arrays.stream(srcCode.split("[\r\\n]")).filter(item-> !item.isBlank()).collect(Collectors.toList()); + return Stream.of(s1,s2,s3).max((v1,v2)-> v1.size() -v2.size()).get().stream().map(item->item.trim()).filter(item-> StringUtils.isNotBlank(item)).collect(Collectors.toList()); } + + /** + * get code to run lines + * @param srcCode + * @return + */ + 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().contains("BEGIN"); + } + isEnd=line.toUpperCase().contains("END;"); + if(isEnd) { + break; + } + if(isStart) { + isBegin=line.toUpperCase().contains("BEGIN"); + if(!isBegin) { + runLines.add(line); + } + } + } + return runLines; + + } + + + 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().contains("BEGIN"); + } + isEnd=line.toUpperCase().contains("END;"); + if(isEnd) { + break; + } + if(isStart) { + isBegin=line.toUpperCase().contains("BEGIN"); + if(!isBegin) { + runLines.add(count.toString()); + } + } + } + return runLines; + + } + private int getBeginFromCode(List lines) { for (int i = 0; i < lines.size(); i ++) { 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..44b66f5482b3b481043dd4875789c5bc0c6aef86 --- /dev/null +++ b/code/datastudio/src/org.opengauss.mppdbide.debuger/src/org/opengauss/mppdbide/debuger/vo/BreakPointListVo.java @@ -0,0 +1,17 @@ +package org.opengauss.mppdbide.debuger.vo; + +import org.opengauss.mppdbide.debuger.annotation.DumpFiled; + +public class BreakPointListVo { + + @DumpFiled + public int breakpointno; + @DumpFiled + public Long funcoid; + @DumpFiled + public int lineno; + @DumpFiled + public String query; + @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..2b09cca24301e16e384ba1933e7d078d1b7b29dd 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..aabe8df6ac0c78f1ee6ede95e529e998b57ed2d5 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 @@ -29,7 +29,10 @@ public class PositionVo { * the format of this vo */ public static final String FORMAT = "%8s %20s"; + + public Boolean enable; + public Integer breakpointno; /** * func of positionvo */ @@ -51,6 +54,10 @@ public class PositionVo { public PositionVo() { this(null, null, null); } + + public Integer getBreakpointno() { + return breakpointno; + } public PositionVo(Long func, Integer linenumber, String targetname) { this.func = func; 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..2d48c503e203a39310a166377975e9753befc7fc 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 @@ -28,7 +34,9 @@ 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 (null == codes) { + 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..966ccc6b85438006c3a43821e53b100cbbe00836 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 @@ -1,4 +1,4 @@ -/* +/* * Copyright (c) 2022 Huawei Technologies Co.,Ltd. * * openGauss is licensed under Mulan PSL v2. @@ -6,7 +6,7 @@ * You may obtain a copy of Mulan PSL v2 at: * * http://license.coscl.org.cn/MulanPSL2 - * + * * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. @@ -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,52 @@ public class VersionVo { * this is version str */ @DumpFiled + public String version; + + 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; + + + public void setVersion(String version) { + this.version = version; + } + + 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 version = Integer.valueOf(versionStr); + if (version < DebugConstants.DBE_DEBUGGER_MIN_VERSION) { + return DebugConstants.PL_DEBUGGER; + } else { + return DebugConstants.DBE_DEBUGGER; + } + } + + 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..d967763e053de755599e0f552cc09a647895d6e4 --- /dev/null +++ b/code/datastudio/src/org.opengauss.mppdbide.debuger/src/org/opengauss/mppdbide/debuger/vo/dbe/AttachVo.java @@ -0,0 +1,16 @@ +package org.opengauss.mppdbide.debuger.vo.dbe; + +import org.opengauss.mppdbide.debuger.annotation.DumpFiled; + +public class AttachVo { + + @DumpFiled + public long funcoid; + @DumpFiled + public String funcname; + @DumpFiled + public int lineno; + @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..812740e2ae9dc518afcef173ccce0fb7e7401ae0 --- /dev/null +++ b/code/datastudio/src/org.opengauss.mppdbide.debuger/src/org/opengauss/mppdbide/debuger/vo/dbe/BacktraceVo.java @@ -0,0 +1,37 @@ +package org.opengauss.mppdbide.debuger.vo.dbe; + +import org.opengauss.mppdbide.debuger.annotation.DumpFiled; + +public class BacktraceVo { + + @DumpFiled + public Integer frameno; + @DumpFiled + public String funcname; + @DumpFiled + public Integer lineno; + @DumpFiled + public String query; + @DumpFiled + public long funcoid; + + public Integer getFrameno() { + return frameno; + } + + public String getFuncname() { + return funcname; + } + + public Integer getLineno() { + return lineno; + } + + public String getQuery() { + return query; + } + + public long getFuncoid() { + return funcoid; + } +} 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..b10a1abe31d4366b96cc441284db6ac682efda5a --- /dev/null +++ b/code/datastudio/src/org.opengauss.mppdbide.debuger/src/org/opengauss/mppdbide/debuger/vo/dbe/InfoBreakpointsVo.java @@ -0,0 +1,37 @@ +package org.opengauss.mppdbide.debuger.vo.dbe; + +import org.opengauss.mppdbide.debuger.annotation.DumpFiled; + +public class InfoBreakpointsVo { + + @DumpFiled + private Integer breakpointno; + @DumpFiled + private long funcoid; + @DumpFiled + private Integer lineno; + @DumpFiled + private String query; + @DumpFiled + private Boolean enable; + + public Integer getBreakpointno() { + return breakpointno; + } + + public long getFuncoid() { + return funcoid; + } + + public Integer getLineno() { + return lineno; + } + + public String getQuery() { + return query; + } + + public Boolean getEnable() { + return 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..228c00682fa9e9abcf88ae0f8086990b9ed2140c --- /dev/null +++ b/code/datastudio/src/org.opengauss.mppdbide.debuger/src/org/opengauss/mppdbide/debuger/vo/dbe/InfoCodeVo.java @@ -0,0 +1,22 @@ +package org.opengauss.mppdbide.debuger.vo.dbe; + +import org.opengauss.mppdbide.debuger.annotation.DumpFiled; + +public class InfoCodeVo { + + @DumpFiled + public int lineno; + @DumpFiled + public String query; + @DumpFiled + public boolean canbreak; + + public Integer getLineno() { + return lineno; + } + + 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..f3ffb9d2df9b23be34861d5d782e35fea52f1f30 --- /dev/null +++ b/code/datastudio/src/org.opengauss.mppdbide.debuger/src/org/opengauss/mppdbide/debuger/vo/dbe/ServerInfoVo.java @@ -0,0 +1,13 @@ +package org.opengauss.mppdbide.debuger.vo.dbe; + +import org.opengauss.mppdbide.debuger.annotation.DumpFiled; + +public class ServerInfoVo { + + @DumpFiled + String nodename; + @DumpFiled + Long port; + @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..f4f1c7e4d4fc61310d39fe84573cb0c99a840e81 --- /dev/null +++ b/code/datastudio/src/org.opengauss.mppdbide.debuger/src/org/opengauss/mppdbide/debuger/vo/dbe/TurnOnVo.java @@ -0,0 +1,13 @@ +package org.opengauss.mppdbide.debuger.vo.dbe; + +import org.opengauss.mppdbide.debuger.annotation.DumpFiled; + +public class TurnOnVo { + + + @DumpFiled + public String nodename; + @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..79b2b2a673e783448e78266e0733ff8a389ef758 --- /dev/null +++ b/code/datastudio/src/org.opengauss.mppdbide.debuger/src/org/opengauss/mppdbide/debuger/vo/dbe/VariablesVo.java @@ -0,0 +1,112 @@ +package org.opengauss.mppdbide.debuger.vo.dbe; + +import java.util.HashMap; +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.utils.logger.MPPDBIDELoggerUtility; + +public class VariablesVo { + + @DumpFiled + public String varname; + @DumpFiled + public String vartype; + @DumpFiled + public String value; + @DumpFiled + public String package_name; + @DumpFiled + public Boolean isconst; + public Long dtype; + + + public Long getDtype() { + String type = null; + switch (this.vartype) { + case "bpchar": { + type ="char"; + break; + } + case "bool": { + type = "boolean"; + break; + } + case "float": { + type = "binary double"; + break; + } + case "int2": { + type = "smallint"; + break; + } + case "int4": { + type = "integer"; + break; + } + case "int8": { + type = "bigint"; + break; + } + case "float8": { + type = "double precision"; + break; + } + case "float4": { + type = "real"; + break; + } + case "timetz": { + type = "time with time zone"; + break; + } + case "timestamptz": { + type = "timestamp with time zone"; + break; + } + case "time": { + type = "time without time zone"; + break; + } + case "timestamp": { + type = "timestamp without time zone"; + break; + } + } + 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; + } + + public String getVarname() { + return varname; + } + + public String getVartype() { + return vartype; + } + + public String getValue() { + return value; + } + + public String getPackage_name() { + return package_name; + } + + public Boolean getIsconst() { + return isconst; + } +} diff --git a/code/datastudio/src/org.opengauss.mppdbide.presentation/.classpath b/code/datastudio/src/org.opengauss.mppdbide.presentation/.classpath index e31912d3b25059455c950ac11dd9c8897d859a70..af6421328a39f333a185dbfcd47c034e1bbbfc31 100644 --- a/code/datastudio/src/org.opengauss.mppdbide.presentation/.classpath +++ b/code/datastudio/src/org.opengauss.mppdbide.presentation/.classpath @@ -1,6 +1,5 @@ - @@ -9,6 +8,13 @@ + + + + + + + @@ -29,10 +35,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..cf96528a3364c43c4815aed342f5e147199184de 100644 --- a/code/datastudio/src/org.opengauss.mppdbide.utils/src/messages.properties +++ b/code/datastudio/src/org.opengauss.mppdbide.utils/src/messages.properties @@ -75,7 +75,7 @@ MSG_HINT_GUI_CONNECTION_FAIL = HINT (Try one of the below): \ \n1. Verify the connection properties specified.\ \n2. Check whether the Data Studio and Server are version compatible. \ \n3. Check whether the configurations are set properly, refer the client and server manual for more information. - + MSG_HINT_GUI_CONNECTION_FAIL_FOR_SSL = HINT (Try one of the below): \ \n1. Verify that SSL password is valid\ \n2. Verify that valid certificate and key files are used @@ -85,7 +85,7 @@ ERR_GUI_RESULT_SET_INVALID = Result set fetch invalid. ERR_SYNONYM_NOT_SUPPORTED = Synonyms are not supported in this server, please uncheck Synonyms and search. ERR_EXPORT_TABLE_TO_CSV=Error while exporting table data - + #BL Error messages @@ -159,7 +159,7 @@ ERR_EXE_PLAN_QUERY_PARSE_FAILED=Query parsing failed. Check if the query is comp MSG_HINT_REFRESH_OBJECTBROWSER = \nHint: Check whether function/procedure has been dropped/modified from another terminal or access privilege is modified. \ \nTry refreshing after some time. - + MSG_HINT_GETSOURCE = \nHINT: Try refreshing after sometime. MSG_CLEAR_EDITOR_CONTENT_ON_ERROR = Error refreshing object opened in editor: Clearing editor contents @@ -170,7 +170,7 @@ MSG_HINT_DATABASE_CRITICAL_ERROR = Critical error occurred in database session. ERR_MSG_OUT_OF_MEMORY_ERROR_OCCURRED = Out of memory error occurred. Connection will be closed. \ \nHint: \n 1. Try increasing the heap memory size in configuration file. - + ERR_TITLE_DB_CRITICAL_ERROR = Database Critical Error ERR_QUERY_EXECUTION_FAILED = Update failed. No rows affected. Cancel changes, refresh the data and try again. @@ -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: @@ -303,7 +303,7 @@ CONSOLE_WINDOW_ERROR_SCROLLING_MSG=Error occurred while scrolling to last of mes CONSOLE_WINDOW_LINE_NUMBER_MSG=number of lines: CONSOLE_WINDOW_OFFSET_MSG = offset: CONSOLE_WINDOW_LENGTH_MSG = length: - + EXECDIALOG_PARAMETER_VALUE=Enter the parameter values. EXECDIALOG_EXEC_PL_SQL=Execute Function/Procedure @@ -314,9 +314,9 @@ EXECDIALOG_VALUE=Value EXECDIALOG_HINT= HINT: OBJECT_BROWSER_LABEL_MSG=Unknown Type - + LABEL_VIEW_SOURCE=View Source - + PL_SOURCE_EDITOR_AT= at # {0} ANALYSE_TABLE_ERROR_MSG=Error while analyzing @@ -994,7 +994,7 @@ BTN_CANCEL = Cancel BTN_CLEAR = Clear MSG_DS__NO_DATA_ENCRYPT_DISCLAIMER = 1) Data Studio does not support data encryption. Sensitive information may be accessible to hackers.\n Action Required: Ensure that the file is saved in a secure location.\n - + MSG_DS__NO_DATA_ENCRYPT_DISCLAIMER_SECONDPART2 = 2) Data Studio will not set any permissions of the exported files.\n Action Required: Read/Write permissions of folders must be set by the user. MSG_DO_NOT_SHOW_AGAIN = Do not show again. TITLE_DISCLAIMER = Data Studio Security Warning @@ -1060,7 +1060,7 @@ SECURITY_FAILURE_SUGGESTION=1. Delete the security folder from Data Studio folde EDIT_DATA_WIZARD_TITLE=Edit Table Data Wizard - + CANCEL_OPERATION_TITLE= Cancel Operation CANCEL_OPERATION_MSG= Are you sure you want to cancel the operation? @@ -1264,7 +1264,7 @@ SQL_HISTORY_DISABLED_TOOL_TIP = SQL Execution History - Profile Not Loaded SQL_HISTORY_TITLE = SQL Execution History - {0} SQL_AUTOCOMMIT_ON_TOOL_TIP = Auto Commit On SQL_AUTOCOMMIT_OFF_TOOL_TIP = Auto Commit Off - + SQL_AUTOCOMMIT_DISABLED_TOOL_TIP = Turn Auto Commit On/Off - No Active Connections ERR_SQL_AUTOCOMMIT_TOGGLE_TITLE = Turning Auto Commit On Failed @@ -1284,7 +1284,7 @@ UNPIN_SQL = Unpin SQL SERIAL_NO = Serial No CONN_PROFILE_ERROR_MSG=Error occurred while loading profiles : {0}.These profiles are removed from the profile list. CIPHER_DECRYPT_ERROR_MSG=Error occurred while loading profiles : {0}. Decrypting passwords for these profiles failed. Re-enter the password. - + TABLESPACE_NAME=Name* TABLESPACE_RELATIVE_PATH=Relative Path TABLESPACE_LOCATION=Location* @@ -1792,12 +1792,12 @@ PREFERENCE_SHORTCUT_EXECUTION_PLAN_AND_COST=Explain Plan and Cost PREFERENCE_SHORTCUT_VISUAL_EXPLAIN_PLAN=Visual Explain Plan PREFERENCE_SHORTCUT_FORMAT_SQL_STATEMENT = Format PREFERENCE_SHORTCUT_OPEN_SAVED_FILE =Open - + PREFERENCE_SHORTCUT_TO_SAVE_FILE =Save PREFERENCE_SHORTCUT_TO_SAVE_FILE_AS =Save As PREFERENCE_SHORTCUT_CANCEL_SQL_STETEMNT =Cancel PREFERENCE_SHORTCUT_CLOSE_ACTIVE_VIEWER =Close Active Source Viewer - + PREFERENCE_SHORTCUT_COLAPSE_ALL_OBJECTS=Collapse Open Objects PREFERENCE_SHORTCUT_AUTO_SUGGEST=Auto Suggest @@ -1819,31 +1819,31 @@ YES_EXPIRY_OPTION= Allow NO_EXPIRY_OPTION = Not Allow CIPHER_EXPIRY_MSG_TITLE = The password is about to expire. CIPHER_EXPIRY_INFORMATION = The password is about to expire and certain operations may be restricted. Contact administrator to reset password. - + EDITTABLE_TITLE = Table Data Save Option YES_EDITTABLE_OPTION=Valid data will be saved. All invalid data will be highlighted for correction and will not be saved. NO_EDITTABLE_OPTION=If an error occurs no data will be saved. Invalid data will be highlighted for correction. EDIT_TABLE_ENABLE_OPTION=Save Valid Data EDIT_TABLE_DISABLE_OPTION=Do Not Save - - + + SHOW_USER_MSG_ON_TABLE_UPDATE_TITLE =Table Property Update SHOW_USER_MSG_ON_TABLE_UPDATE_BODY =Modifying the {0} will delete the information from {1} tab. - - + + CONSTRAINT_INDEXES_HANDLER_NOT_SUPPORTED_TITLE=Operation Not Supported CONSTRAINT_HANDLER_FOR_COLUMN_ORIENTATION_BODY=Creation of constraints for column orientation table is not supported. CHANGE_INDEX_FOR_COLUMN_ORIENTATION_TABLE= Modification of fill factor for index in column orientation table is not supported. This value has been set by default to 100. - + DATA_DISTRIBUTION_TAB=data distribution INDEXES_TAB=indexes CONSTRAINT_TAB=constraint PARTITION_TAB=partition - + CANCEL_CONNECTION_TITLE=Cancel Connection CANCEL_CONNECTION_BODY=Do you wish to cancel connecting to the database? USER_CANCEL_MSG =Operation canceled on user request - + REFRESH_TABLE_TOOLTIP=Refresh REFRESH_TABLE_TOOLTIP_DISABLED = Save/Cancel changes to refresh INSERT_ROW_TOOLTIP= Add @@ -1872,7 +1872,7 @@ USER_CANCEL_MSG =Operation canceled on user request PASTE_INVALID_SELECTION_DIALOG_MSG=The number of pasted cell and the selected cell does not match QUERY_EXECUTION_FAILURE_ERROR_TITLE=Data Modification Failed QUERY_EXECUTION_FAILURE_ERROR=Failed to update one or more rows. Please move the cursor on row line number to check the error message in tool tip. - + GRID_EDIT_STATUS_INSERTED = Inserted: GRID_EDIT_STATUS_UPDATED = Modified: GRID_EDIT_STATUS_DELETED = Deleted: @@ -2348,6 +2348,7 @@ PROPERTIES_ERROR_MESSAGE={0} has been modified/dropped. Cancel changes, refresh, PROPERTIES_ERROR_MESSAGE_FOR_CONSTRAINT=Constraint name has been modified. Cancel changes, refresh, and try again. PROPERTIES_COMPLEX_DATATYPE_ERROR_MSG={0} has been modified/dropped, refresh, and try again. PREFERENCE_SHORTCUT_KEY_BINDING_TOGGLE_LINE_COMMENTS=Comment/Uncomment Lines +REMARK_SHORTCUT_KEY_BINDING_TOGGLE_LINE_COMMENTS=remark Line /UnRemark Line (coverage) KEY_BINDING_TOGGLE_LINE_COMMENTS_DESC=Comment/Uncomment each line individually in SQL Terminal and Procedure/Function Source Viewer PREFERENCE_SHORTCUT_KEY_BINDING_TOGGLE_BLOCK_COMMENTS=Comment/Uncomment Block KEY_BINDING_TOGGLE_BLOCK_COMMENTS_DESC=Comment/Uncomment block of lines/content in SQL Terminal and Procedure/Function Source Viewer @@ -3036,7 +3037,7 @@ CURSOR_DATA_NODE = Cursor Data RESULT_TAB_COL_VALUE = Value CURSOR_TOOLTIP_TEXT = double click to see the full data - + VOID_VALUE_TOOLTIP_TEXT = no value returned by server EDIT_TERMINAL_INPUT_VALUE = Edit Function/procedure input parameter values @@ -3178,4 +3179,26 @@ 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! + +OID=OID +TOTAL_LINE=TOTAL_LINE +TOTAL_RUN_LINE_NUM=TOTAL_RUN_LINE_NUM +TOTAL_Coverage=TOTAL_Coverage +REMARK_LINE=REMARK_LINE +REMARK_RUM_LIME_NUM=REMARK_RUM_LIME +REMARK_Coverage=REMARK_Coverage +DELETE_Coverage=DELETE_Coverage +DELETE_Coverage_All=DELETE_Coverage_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 +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! \ 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..46cd6ddfb51c77d5faeb17b0908229c187f94887 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 @@ -86,7 +86,7 @@ ERR_GUI_RESULT_SET_INVALID = \u83B7\u53D6\u7ED3\u679C\u65E0\u6548. ERR_SYNONYM_NOT_SUPPORTED = \u670D\u52A1\u5668\u4E0D\u652F\u6301\u540C\u4E49\u8BCD\u3002\u8BF7\u53D6\u6D88\u540C\u4E49\u8BCD\u68C0\u67E5\u548C\u641C\u7D22\u3002 ERR_EXPORT_TABLE_TO_CSV= \u5BFC\u51FA\u8868\u6570\u636E\u51FA\u9519.. - + EDIT_TABLE_INVALID_BOOLEAN_DATATYPE=\u7C98\u8D34\u7684\u5185\u5BB9\u4E0D\u5339\u914DBoolean/Bit\u6570\u636E\u7C7B\u578B\u683C\u5F0F\u3002 #BL Error messages @@ -158,7 +158,7 @@ ERR_EXE_PLAN_QUERY_PARSE_FAILED=\u67E5\u8BE2\u89E3\u6790\u5931\u8D25.\u8BF7\u68C MSG_HINT_REFRESH_OBJECTBROWSER = \n\u63D0\u793A: \ \u68C0\u67E5\u8FC7\u7A0B/\u51FD\u6570\u662F\u5426\u88AB\u6765\u81EA\u5176\u4ED6\u7EC8\u7AEF\u4E22\u5F03/\u4FEE\u6539.\ \n\u5C1D\u8BD5\u4E00\u6BB5\u65F6\u95F4\u540E\u5237\u65B0. - + MSG_HINT_GETSOURCE = \n\u63D0\u793A: \u5C1D\u8BD5\u4E00\u6BB5\u65F6\u95F4\u540E\u5237\u65B0. MSG_CLEAR_EDITOR_CONTENT_ON_ERROR = \u5237\u65B0\u7F16\u8F91\u5668\u4E2D\u7684\u5BF9\u8C61\u65F6\u51FA\u9519\uFF1A\u6B63\u5728\u6E05\u9664\u7F16\u8F91\u5668\u4E2D\u5185\u5BB9\u3002 @@ -166,10 +166,10 @@ MSG_CLEAR_EDITOR_CONTENT_ON_ERROR = \u5237\u65B0\u7F16\u8F91\u5668\u4E2D\u7684\ MSG_GUI_OBJECT_MAY_DROPPED = \u5BF9\u8C61\u53EF\u80FD\u672A\u5220\u9664\u3002 MSG_HINT_DATABASE_CRITICAL_ERROR = \u6570\u636E\u5E93\u4F1A\u8BDD\u53D1\u751F\u4E25\u91CD\u9519\u8BEF\uFF0C\u65E0\u6CD5\u7EE7\u7EED\u3002\u8BF7\u91CD\u65B0\u8FDE\u63A5\u670D\u52A1\u5668\u3002 - + ERR_MSG_OUT_OF_MEMORY_ERROR_OCCURRED = \u53D1\u751F\u6EA2\u51FA\u9519\u8BEF.\u8FDE\u63A5\u5C06\u88AB\u5173\u95ED. \ \n\u63D0\u793A: \n \u5C1D\u8BD5\u5728\u914D\u7F6E\u6587\u4EF6\u4E2D\u589E\u52A0\u5806\u5185\u5B58\u5927\u5C0F - + ERR_TITLE_DB_CRITICAL_ERROR = \u6570\u636E\u5E93\u4E25\u91CD\u9519\u8BEF ERR_QUERY_EXECUTION_FAILED = \u66F4\u65B0\u5931\u8D25\uFF0C\u5404\u884C\u5747\u672A\u53D7\u5230\u5F71\u54CD\u3002\u8BF7\u53D6\u6D88\u66F4\u6539\uFF0C\u5237\u65B0\u6570\u636E\uFF0C\u7136\u540E\u91CD\u8BD5\u3002 @@ -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: @@ -300,9 +300,9 @@ EXECDIALOG_VALUE=\u503C EXECDIALOG_HINT= \u63D0\u793A OBJECT_BROWSER_LABEL_MSG=\u672A\u77E5\u7C7B\u578B - + LABEL_VIEW_SOURCE=\u67E5\u770B\u6765\u6E90 - + PL_SOURCE_EDITOR_AT= \u3002\u6240\u5728\u884C\uFF1A# {0} ANALYSE_TABLE_ERROR_MSG=\u5206\u6790\u65F6\u9519\u8BEF @@ -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 @@ -930,7 +930,7 @@ LOCALE_CHANGE_APP_RESTART_TITLE=Data Studio\u5373\u5C06\u91CD\u542F LOCALE_CHANGE_APP_RESTART_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\u60F3\u73B0\u5728\u91CD\u65B0\u542F\u52A8\uFF1F LOCALE_CHANGE_APP_RESTART_NOTE=\u6CE8\u610F\uFF1A LOCALE_CHANGE_APP_RESTART_NOTE_NO= \u5982\u679C\u9009\u62E9\u201C\u5426\u201D\uFF0C\u5373\u4F7FData Studio\u91CD\u542F\u4E5F\u4E0D\u4F1A\u6539\u53D8\u5F53\u524D\u8BED\u8A00\u3002 - + TYPE_ALIGN = \u6309\u7C7B\u522B\u5206\u6790 @@ -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 @@ -978,10 +978,10 @@ TITLE_EXPORT_IN_PROGRESS = \u51FA\u53E3\u8FDB\u5EA6 ERR_WHILE_EXPORTING = \u3002\u5728\u5BFC\u51FA\u67E5\u8BE2\u6570\u636E\u9519\u8BEF\\u9519\u8BEF\uFF1A 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 @@ -1233,7 +1233,7 @@ ERR_SQL_AUTOCOMMIT_TOGGLE_TITLE = \u672A\u80FD\u542F\u7528\u81EA\u52A8\u63D0\u4E ERR_SQL_AUTOCOMMIT_TOGGLE = \u8BF7\u63D0\u4EA4\u6216\u56DE\u6EDA\u5F53\u524D\u4E8B\u52A1\u3002 SQL_AUTOCOMMIT_SAVE_CHANGES_TITLE = \u4FDD\u5B58\u66F4\u6539 SQL_AUTOCOMMIT_SAVE_CHANGES_MSG = \u65B0\u7684\u66F4\u6539\u5C06\u88AB\u4FDD\u5B58\uFF0C\u4F46\u4E0D\u4F1A\u63D0\u4EA4\u3002\n\u8BF7\u5728SQL\u7EC8\u7AEF\u4E2D\u6267\u884CCOMMIT\u547D\u4EE4\u4EE5\u63D0\u4EA4\u66F4\u6539\u3002 - + REMOVE_CONN_TITLE=\u5220\u9664\u8FDE\u63A5\u6587\u4EF6 REMOVE_CONN_MSG=\u60A8\u786E\u5B9A\u8981\u79FB\u9664\u8FDE\u63A5\u6587\u4EF6\u5417\uFF1F SELECT_CONN_TO_REMOVE=\u8BF7\u9009\u62E9\u4E00\u4E2A\u8981\u5220\u9664\u7684\u8FDE\u63A5\u6587\u4EF6 @@ -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 @@ -1255,7 +1255,7 @@ CONN_DIALOG_SAVE_CIPHER =\u4FDD\u5B58\u5BC6\u7801 CIPHER_DECRYPT_ERROR_MSG=\u52A0\u8F7D\u914D\u7F6E\u6587\u4EF6\u65F6\u51FA\u9519\uFF1A{ 0 }\u3002\u89E3\u5BC6\u8FD9\u4E9B\u914D\u7F6E\u6587\u4EF6\u7684\u5BC6\u7801\u5931\u8D25\uFF0C\u8BF7\u518D\u6B21\u8F93\u5165\u5BC6\u7801\u3002 MSG_DS__NO_DATA_ENCRYPT_DISCLAIMER = 1\uFF09Data Studio\u4E0D\u652F\u6301\u6570\u636E\u52A0\u5BC6\uFF0C\u9ED1\u5BA2\u53EF\u80FD\u8BBF\u95EE\u5230\u654F\u611F\u4FE1\u606F\u3002 \n\u5E94\u5BF9\u63AA\u65BD\uFF1A\u786E\u4FDD\u6587\u4EF6\u4FDD\u5B58\u5728\u5B89\u5168\u7684\u4F4D\u7F6E\u3002 - + MSG_DS__NO_DATA_ENCRYPT_DISCLAIMER_SECONDPART2 =\n2\uFF09Data Studio\u5BF9\u5BFC\u51FA\u7684\u6570\u636E\u6587\u4EF6\u4E0D\u8BBE\u7F6E\u4EFB\u4F55\u6743\u9650\u3002 \n\u5E94\u5BF9\u63AA\u65BD\uFF1A\u7528\u6237\u9700\u81EA\u884C\u8BBE\u7F6E\u6570\u636E\u6587\u4EF6\u6240\u5728\u6587\u4EF6\u5939\u7684\u6743\u9650\u3002 TABLESPACE_CREATION_SUCCEEDED = \u8868\u7A7A\u95F4\u521B\u5EFA\u6210\u529F @@ -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 @@ -1745,7 +1745,7 @@ PARTITION_UI_SELECT=\u8BF7\u9009\u62E9 VERSION=\u7248\u672C PREFERENCE_COMMAND_NEW_NODE_CONNECTION= \u65B0\u5EFA\u8FDE\u63A5 PREFERENCE_SHORTCUT_DISSCONN_FRM_DB =\u65AD\u5F00\u8FDE\u63A5 - + PREFERENCE_SHORTCUT_EXE_DB_OBJECT = \u6267\u884C PREFERENCE_SHORTCUT_REF_SREVER_OBJECT = \u5237\u65B0 @@ -1755,12 +1755,12 @@ PREFERENCE_SHORTCUT_EXECUTION_PLAN_AND_COST=\u89E3\u91CA\u8BA1\u5212\u548C\u6210 PREFERENCE_SHORTCUT_VISUAL_EXPLAIN_PLAN=\u53EF\u89C6\u5316\u89E3\u91CA\u8BA1\u5212 PREFERENCE_SHORTCUT_FORMAT_SQL_STATEMENT = \u683C\u5F0F\u5316 PREFERENCE_SHORTCUT_OPEN_SAVED_FILE =\u6253\u5F00 - + PREFERENCE_SHORTCUT_TO_SAVE_FILE = \u4FDD\u5B58 PREFERENCE_SHORTCUT_TO_SAVE_FILE_AS = \u53E6\u5B58\u4E3A PREFERENCE_SHORTCUT_CANCEL_SQL_STETEMNT = \u7EC8\u6B62\u8BED\u53E5 PREFERENCE_SHORTCUT_CLOSE_ACTIVE_VIEWER = \u5173\u95ED\u5F53\u524D\u7684\u6E90\u67E5\u770B\u5668 - + PREFERENCE_SHORTCUT_COLAPSE_ALL_OBJECTS= \u6298\u53E0\u5DF2\u6253\u5F00\u7684\u5BF9\u8C61 PREFERENCE_SHORTCUT_AUTO_SUGGEST= \u81EA\u52A8\u5EFA\u8BAE @@ -1772,15 +1772,15 @@ PREFERENCE_SHORTCUT_GO_TO_LINE= \u8F6C\u5230\u884C PREFERENCE_SHORTCUT_FORWARD_SEARCH= \u67E5\u627E\u4E0B\u4E00\u5904 PREFERENCE_SHORTCUT_BACKWARD_SEARCH = \u67E5\u627E\u4E0A\u4E00\u5904 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} @@ -1797,21 +1797,21 @@ VACCUME_TABLE_TITLE= \u6E05\u7A7A\u8868 SHOW_USER_MSG_ON_TABLE_UPDATE_TITLE =\u66F4\u65B0\u5217 SHOW_USER_MSG_ON_TABLE_UPDATE_BODY =\u5982\u679C\u4FEE\u6539\u8BE5\u5217\uFF0C{0}\u9875\u7B7E\u4E2D\u7684\u4FE1\u606F\u5C06\u88AB\u5220\u9664\u3002 - + CONSTRAINT_INDEXES_HANDLER_NOT_SUPPORTED_TITLE=\u4E0D\u652F\u6301\u7684\u64CD\u4F5C CONSTRAINT_HANDLER_FOR_COLUMN_ORIENTATION_BODY=\u4E0D\u652F\u6301\u4E3A\u5217\u5B58\u8868\u521B\u5EFA\u7EA6\u675F\u3002 CHANGE_INDEX_FOR_COLUMN_ORIENTATION_TABLE= \u5217\u5B58\u8868\u4E2D\u65E0\u6CD5\u4FEE\u6539\u7D22\u5F15\u7684\u586B\u5145\u56E0\u5B50\u3002\u8BE5\u503C\u5DF2\u88AB\u8BBE\u7F6E\u4E3A\u9ED8\u8BA4\u503C100\u3002 - + DATA_DISTRIBUTION_TAB=\u6570\u636E\u5206\u5E03 INDEXES_TAB=\u7D22\u5F15 CONSTRAINT_TAB=\u7EA6\u675F PARTITION_TAB= \u5206\u533A - + CANCEL_CONNECTION_TITLE=\u53D6\u6D88\u8FDE\u63A5 CANCEL_CONNECTION_BODY=\u786E\u5B9A\u8981\u53D6\u6D88\u8BE5\u6570\u636E\u5E93\u7684\u8FDE\u63A5\u5417\uFF1F USER_CANCEL_MSG =\u5DF2\u6839\u636E\u7528\u6237\u8BF7\u6C42\u53D6\u6D88\u8BE5\u64CD\u4F5C\u3002 - + REFRESH_TABLE_TOOLTIP=\u5237\u65B0 REFRESH_TABLE_TOOLTIP_DISABLED = \u5237\u65B0\u524D\u8BF7\u4FDD\u5B58/\u53D6\u6D88\u66F4\u6539 INSERT_ROW_TOOLTIP=\u6DFB\u52A0 @@ -1831,8 +1831,8 @@ USER_CANCEL_MSG =\u5DF2\u6839\u636E\u7528\u6237\u8BF7\u6C42\u53D6\u6D88\u8BE5\u6 GROUP_COLUMNS_HEADER=\u5217 NO_PHYSICAL_UNQ_KEY_MSG=\u5BF9\u8BE5\u8868\u672A\u5B9A\u4E49\u552F\u4E00\u7269\u7406\u952E\uFF1A DEFINE_UNQ_KEY_MSG =\u8981\u7EE7\u7EED\u64CD\u4F5C\uFF0C\u8BF7\u5B9A\u4E49\u552F\u4E00\u952E\u6216\u9009\u62E9\u6240\u6709\u5217\u3002 - - + + CONNECT_DB_CANCEL_MSG=\u5DF2\u6839\u636E\u7528\u6237\u8BF7\u6C42\u53D6\u6D88\u6570\u636E\u5E93\u8FDE\u63A5\u3002 @@ -1840,18 +1840,18 @@ CONNECT_DB_CANCEL_MSG=\u5DF2\u6839\u636E\u7528\u6237\u8BF7\u6C42\u53D6\u6D88\u65 PASTE_INVALID_SELECTION_DIALOG_MSG=\u590D\u5236\u7684\u5355\u5143\u683C\u6570\u5FC5\u987B\u4E0EData Studio\u4E2D\u9009\u62E9\u7684\u5355\u5143\u683C\u6570\u5339\u914D\u3002 QUERY_EXECUTION_FAILURE_ERROR_TITLE=\u6570\u636E\u4FEE\u6539\u5931\u8D25 QUERY_EXECUTION_FAILURE_ERROR=\u65E0\u6CD5\u66F4\u65B0\u4E00\u884C\u6216\u591A\u884C\u3002\u8BF7\u5C06\u9F20\u6807\u60AC\u505C\u5728\u7EA2\u8272\u884C\u53F7\u5904\uFF0C\u68C0\u67E5\u5177\u4F53\u7684\u9519\u8BEF\u4FE1\u606F\u3002 - + GRID_EDIT_STATUS_INSERTED = \u63D2\u5165\uFF1A GRID_EDIT_STATUS_UPDATED = \u4FEE\u6539\uFF1A GRID_EDIT_STATUS_DELETED = \u5220\u9664\uFF1A EDIT_TABLE_DATA_CONNECTION_LOST_ERR_MSG= \u4FDD\u5B58\u8868\u6570\u636E\u65F6\u53D1\u751F\u9519\u8BEF\uFF0C\u8FDE\u63A5\u53EF\u80FD\u4E22\u5931\u3002\u8BF7\u91CD\u65B0\u8FDE\u63A5\u5E76\u7F16\u8F91\u8868\u6570\u636E\u3002 - + 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 @@ -2317,6 +2317,7 @@ PROPERTIES_ERROR_MESSAGE_FOR_CONSTRAINT=\u7EA6\u675F\u540D\u79F0\u5DF2\u88AB\u4F TABLE_PROPERTIES_INVALID_BOOLEAN_DATATYPE=\u7C98\u8D34\u7684\u6761\u76EE\u4E0E\u5E03\u5C14\u503C\u7684\u683C\u5F0F\u4E0D\u5339\u914D\u3002 PROPERTIES_COMPLEX_DATATYPE_ERROR_MSG={0}\u5DF2\u88AB\u4FEE\u6539/\u5220\u9664\u3002\u8BF7\u5237\u65B0\u540E\u91CD\u8BD5\u3002 PREFERENCE_SHORTCUT_KEY_BINDING_TOGGLE_LINE_COMMENTS=\u884C\u6CE8\u91CA/\u53D6\u6D88\u884C\u6CE8\u91CA +REMARK_SHORTCUT_KEY_BINDING_TOGGLE_LINE_COMMENTS=\u6807\u8BB0\u884C/\u53D6\u6D88\u6807\u8BB0\u884C(\u8986\u76D6\u7387) KEY_BINDING_TOGGLE_LINE_COMMENTS_DESC=\u6CE8\u91CA/\u53D6\u6D88\u6CE8\u91CASQL\u7EC8\u7AEF\u548C\u5B58\u50A8\u8FC7\u7A0B/\u51FD\u6570\u7EC8\u7AEF\u4E2D\u7684\u884C PREFERENCE_SHORTCUT_KEY_BINDING_TOGGLE_BLOCK_COMMENTS=\u5757\u6CE8\u91CA/\u53D6\u6D88\u5757\u6CE8\u91CA KEY_BINDING_TOGGLE_BLOCK_COMMENTS_DESC=\u6CE8\u91CA/\u53D6\u6D88\u6CE8\u91CASQL\u7EC8\u7AEF\u548C\u5B58\u50A8\u8FC7\u7A0B/\u51FD\u6570\u7EC8\u7AEF\u4E2D\u7684\u6574\u6BB5\u5185\u5BB9 @@ -2324,18 +2325,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 +2403,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 +2514,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 +2558,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 +2668,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 +2722,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 +2746,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 +2791,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 +2848,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 +2862,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 +2900,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 +2912,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 +2920,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 +3064,119 @@ 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 +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_LIME_NUM=\u6807\u8BB0\u6267\u884C\u884C +REMARK_Coverage=\u6807\u8BB0\u8986\u76D6\u7387 +DELETE_Coverage=\u5220\u9664\u5386\u53F2\u8986\u76D6\u7387 +DELETE_Coverage_All=\u5220\u9664\u5168\u90E8\u8986\u76D6\u7387 +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! \ No newline at end of file diff --git a/code/datastudio/src/org.opengauss.mppdbide.utils/src/org/opengauss/mppdbide/utils/ConstantRunLine.java b/code/datastudio/src/org.opengauss.mppdbide.utils/src/org/opengauss/mppdbide/utils/ConstantRunLine.java new file mode 100644 index 0000000000000000000000000000000000000000..84a763be6795103ee918012e06ded43eb8ec2a80 --- /dev/null +++ b/code/datastudio/src/org.opengauss.mppdbide.utils/src/org/opengauss/mppdbide/utils/ConstantRunLine.java @@ -0,0 +1,19 @@ +package org.opengauss.mppdbide.utils; + +import java.util.List; +import java.util.Set; +import java.util.concurrent.CopyOnWriteArrayList; +import java.util.concurrent.CopyOnWriteArraySet; + +public class ConstantRunLine { + + public static volatile List runList = new CopyOnWriteArrayList<>(); + + public static volatile Set passLine = new CopyOnWriteArraySet(); + + public static volatile boolean isTerminate = true; + + public static volatile Boolean isContinue; + + public static volatile Boolean isPldebugger; +} diff --git a/code/datastudio/src/org.opengauss.mppdbide.utils/src/org/opengauss/mppdbide/utils/DebuggerStartConstants.java b/code/datastudio/src/org.opengauss.mppdbide.utils/src/org/opengauss/mppdbide/utils/DebuggerStartConstants.java new file mode 100644 index 0000000000000000000000000000000000000000..b464749af6bd7954b1a0ffc789d589ac59af8374 --- /dev/null +++ b/code/datastudio/src/org.opengauss.mppdbide.utils/src/org/opengauss/mppdbide/utils/DebuggerStartConstants.java @@ -0,0 +1,44 @@ +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; + +public class DebuggerStartConstants { + + public static Map beginInfoMap = new HashMap(); + + public static Map> endInfoMap = new HashMap(); + + public static List getHistoryList(Long oid) { + List list = endInfoMap.get(oid); + if (list == null) { + list = new ArrayList(); + setHistoryList(oid, list); + } + return list; + } + + public static void setHistoryList(Long oid, List list) { + endInfoMap.put(oid, list); + } + + + public static DebuggerStartInfoVo getStartInfo(Long oid) { + DebuggerStartInfoVo info = beginInfoMap.get(oid); + if (info == null) { + info = new DebuggerStartInfoVo(); + setStartInfo(oid, info); + } + return 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..f39b6cc741c48bd4508c678f543dca323705e17e 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 @@ -1,4 +1,4 @@ -/* +/* * Copyright (c) 2022 Huawei Technologies Co.,Ltd. * * openGauss is licensed under Mulan PSL v2. @@ -6,7 +6,7 @@ * You may obtain a copy of Mulan PSL v2 at: * * http://license.coscl.org.cn/MulanPSL2 - * + * * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. @@ -1027,7 +1027,7 @@ public interface IMessagesConstants extends IMessagesConstantsOne { String YES_OPTION = "YES_OPTION"; String NO_OPTION = "NO_OPTION"; - + String SECURITY_WARNING_OPTION = "SECURITY_WARNING_OPTION"; String ENABLE_OPTION = "ENABLE_OPTION"; @@ -1948,7 +1948,7 @@ public interface IMessagesConstants extends IMessagesConstantsOne { String CODE_TEMPLATE_PREFPAGE_MESSAGE = "CODE_TEMPLATE_PREFPAGE_MESSAGE"; String CODE_TEMPLATE_PREFPAGE_TITLE = "CODE_TEMPLATE_PREFPAGE_TITLE"; - + String CODE_TEMPLATE_DUPLICATE_MSG = "CODE_TEMPLATE_DUPLICATE_MSG"; String CODE_TEMPLATE_PREFPAGE_EDIT = "CODE_TEMPLATE_PREFPAGE_EDIT"; @@ -2135,6 +2135,7 @@ public interface IMessagesConstants extends IMessagesConstantsOne { String PROPERTIES_COMPLEX_DATATYPE_ERROR_MSG = "PROPERTIES_COMPLEX_DATATYPE_ERROR_MSG"; String PREFERENCE_SHORTCUT_KEY_BINDING_TOGGLE_LINE_COMMENTS = "PREFERENCE_SHORTCUT_KEY_BINDING_TOGGLE_LINE_COMMENTS"; + String REMARK_SHORTCUT_KEY_BINDING_TOGGLE_LINE_COMMENTS="REMARK_SHORTCUT_KEY_BINDING_TOGGLE_LINE_COMMENTS"; String PREFERENCE_SHORTCUT_KEY_BINDING_TOGGLE_BLOCK_COMMENTS = "PREFERENCE_SHORTCUT_KEY_BINDING_TOGGLE_BLOCK_COMMENTS"; @@ -2921,6 +2922,8 @@ public interface IMessagesConstants extends IMessagesConstantsOne { String BREAKPOINT_ANNOTATION_LABEL = "BREAKPOINT_ANNOTATION_LABEL"; String DEBUG_POSITION_LABEL = "DEBUG_POSITION_LABEL"; + String DEBUG_POSITION_LABEL_PASS = "DEBUG_POSITION_LABEL_PASS"; + String DEBUG_POSITION_LABEL_FAIL = "DEBUG_POSITION_LABEL_FAIL"; String DEBUG_TABLE_ORDER = "DEBUG_TABLE_ORDER"; String DEBUG_STACK_INVOKING_LEVEL = "DEBUG_STACK_INVOKING_LEVEL"; @@ -3015,4 +3018,25 @@ 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"; + + String OID="OID"; + String TOTAL_LINE="TOTAL_LINE"; + String TOTAL_RUN_LINE_NUM="TOTAL_RUN_LINE_NUM"; + String TOTAL_Coverage="TOTAL_Coverage"; + String REMARK_LINE="REMARK_LINE"; + String REMARK_RUM_LIME_NUM="REMARK_RUM_LIME_NUM"; + String REMARK_Coverage="REMARK_Coverage"; + String DELETE_Coverage = "DELETE_Coverage"; + String DELETE_Coverage_All="DELETE_Coverage_All"; + String EXPORT_REPORT="EXPORT_REPORT"; + + String COVERAGE_HISTORY_TITLE = "COVERAGE_HISTORY_TITLE"; + String DELETE_COVERAGE_REPORT_TITLE = "DELETE_COVERAGE_REPORT_TITLE"; + String DELETE_SELECTED_COVERAGE_HISTORY_ALERT = "DELETE_SELECTED_COVERAGE_HISTORY_ALERT"; + String DELETE_ALL_COVERAGE_HISTORY_ALERT = "DELETE_ALL_COVERAGE_HISTORY_ALERT"; + String SURE_EXPORT_REPORT = "SURE_EXPORT_REPORT"; + String COVERAGE_REPORT_NOT_EXIST = "COVERAGE_REPORT_NOT_EXIST"; + String COVERAGE_REPORT_TO_SELECT = "COVERAGE_REPORT_TO_SELECT"; + String UPDATE_TIME = "UPDATE_TIME"; + } 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..7e7606b50c46c754b523cd75e22c4e74248f78d9 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,5 @@ 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"; + String COVERAGE_HINT = "COVERAGE_HINT"; } \ No newline at end of file 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..d9560b6056bce497a9ce6b64206b6545d391738e --- /dev/null +++ b/code/datastudio/src/org.opengauss.mppdbide.utils/src/org/opengauss/mppdbide/utils/vo/DebuggerEndInfoVo.java @@ -0,0 +1,37 @@ +package org.opengauss.mppdbide.utils.vo; + +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Date; +import java.util.List; + +/** + * 存储过程结束后的执行信息 + * @author gitam + * + */ +public class DebuggerEndInfoVo extends DebuggerStartInfoVo{ + SimpleDateFormat dateFormat = new SimpleDateFormat("ddMMyyyyHHmmssSSS"); + public Long cid=System.currentTimeMillis(); //覆盖率id + public Long endDateLong=System.currentTimeMillis(); //结束时间 + public List runList; //跑到的行 + public String runStr; //跑到行的字符串 + + public List getRunList() { + if (runStr==null || "".equals(runStr)){ + return new ArrayList(); + }else { + remarkList =new ArrayList<>(Arrays.asList(runStr.split(","))); + } + return remarkList; + } + + 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..36cf885e938cf378a77ea23a69e33f25163ea4c1 --- /dev/null +++ b/code/datastudio/src/org.opengauss.mppdbide.utils/src/org/opengauss/mppdbide/utils/vo/DebuggerStartInfoVo.java @@ -0,0 +1,29 @@ +package org.opengauss.mppdbide.utils.vo; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +/** + * 存储过程启动时候的信息 + * @author gitam + * + */ +public class DebuggerStartInfoVo { + + public Long oid; //存储过程id + public String sourceCode; //源代码 + public List args; //启动参数 + public List remarkList; //标记的行 + public String remarLinesStr; //标记行的字符串 + public boolean ifMakeReport=true; //是否生成报告 + + 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/.classpath b/code/datastudio/src/org.opengauss.mppdbide.view/.classpath index 7d0cd38e25be936055aacb7b558c09025b56c3a5..567d5a946494a92a1516d20eb6e6d166f315f14e 100644 --- a/code/datastudio/src/org.opengauss.mppdbide.view/.classpath +++ b/code/datastudio/src/org.opengauss.mppdbide.view/.classpath @@ -1,16 +1,19 @@ + - - - - + + + + + + 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_zh_CN.properties b/code/datastudio/src/org.opengauss.mppdbide.view/OSGI-INF/l10n/bundle_zh_CN.properties index 31c510a263422049183e0214bbe87d2fd709e1be..33d27e2adf2408004cc91dddf87721955965b518 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..a28cfebe42fc3c60b3265f31eca5f15ffca6e5ec 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 @@ -16,7 +16,6 @@ package org.opengauss.mppdbide.view.core.sourceeditor; import org.eclipse.swt.graphics.RGB; - import org.opengauss.mppdbide.utils.IMessagesConstants; import org.opengauss.mppdbide.utils.loader.MessageConfigLoader; @@ -52,15 +51,23 @@ public class AnnotationHelper { * debug position annotation type label */ public static final String DEBUG_POSITION_TYPE_LABEL = IMessagesConstants.DEBUG_POSITION_LABEL; + + public static final String DEBUG_POSITION_TYPE_PASS = IMessagesConstants.DEBUG_POSITION_LABEL_PASS; + + 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"; + + public static final String DEBUG_POSITION_STRATEGY_PASS_ID = "PLSQL_DEBUGGER_DEBUG_POSITION_PASS"; + + public static final String DEBUG_POSITION_STRATEGY_FAIL_ID = "PLSQL_DEBUGGER_DEBUG_POSITION_FAIL"; /** * debug position annotation rgb */ public static final RGB DEBUG_POSITION_RGB = new RGB(255, 153, 51); - + /** * error annotation layer */ @@ -94,6 +101,15 @@ public class AnnotationHelper { * error position annotation rgb */ public static final RGB ERROR_POSITION_RGB = new RGB(255, 255, 0); + + public static final int DEBUG_POSITION_LAYER_PASS = 4; + + public static final RGB DEBUG_POSITION_PASS_RGB = new RGB(40, 255, 15); + + public static final int DEBUG_POSITION_LAYER_FAIL = 5; + + public static final RGB DEBUG_POSITION_FAIL_RGB = new RGB(255, 30, 25); + /** * Title: AnnotationType enum this enum assocate with AnnotationWithLineNumber's instance @@ -104,6 +120,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..364f98178f8e0b88b7ea539eb0e94a8006b518d0 --- /dev/null +++ b/code/datastudio/src/org.opengauss.mppdbide.view/src/org/opengauss/mppdbide/view/core/sourceeditor/DebugFailPositionAnnotation.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 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..8841fa9a7b02d34ce6bfaa9d82a79d7503cf2a65 --- /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..d935cb85358b16b29cafb3e4b06597e07fb83fb1 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 @@ -1,4 +1,4 @@ -/* +/* * Copyright (c) 2022 Huawei Technologies Co.,Ltd. * * openGauss is licensed under Mulan PSL v2. @@ -6,7 +6,7 @@ * You may obtain a copy of Mulan PSL v2 at: * * http://license.coscl.org.cn/MulanPSL2 - * + * * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. @@ -15,9 +15,17 @@ package org.opengauss.mppdbide.view.core.sourceeditor; +import java.sql.SQLException; import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; import java.util.Iterator; +import java.util.List; import java.util.Locale; +import java.util.Map; +import java.util.Optional; +import java.util.stream.Collectors; +import java.util.stream.Stream; import javax.annotation.PreDestroy; @@ -25,6 +33,7 @@ import org.eclipse.core.commands.Command; import org.eclipse.core.commands.ParameterizedCommand; import org.eclipse.e4.core.commands.ECommandService; import org.eclipse.e4.core.commands.EHandlerService; +import org.eclipse.e4.ui.model.application.ui.MUIElement; import org.eclipse.e4.ui.workbench.modeling.ESelectionService; import org.eclipse.jface.bindings.keys.KeyStroke; import org.eclipse.jface.bindings.keys.ParseException; @@ -63,8 +72,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 +88,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; @@ -97,22 +103,27 @@ import org.eclipse.swt.widgets.MenuItem; import org.eclipse.swt.widgets.Widget; import org.eclipse.ui.internal.editors.text.EditorsPlugin; 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.DebuggerStartConstants; 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; import org.opengauss.mppdbide.view.prefernces.IAutoCompletePreference; import org.opengauss.mppdbide.view.prefernces.KeyBindingWrapper; import org.opengauss.mppdbide.view.prefernces.PreferenceWrapper; +import org.opengauss.mppdbide.view.service.CoverageServiceFactory; import org.opengauss.mppdbide.view.ui.DBAssistantWindow; import org.opengauss.mppdbide.view.ui.FindAndReplaceOptions; import org.opengauss.mppdbide.view.ui.PLSourceEditor; @@ -123,10 +134,12 @@ 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; import org.opengauss.mppdbide.view.utils.icon.IiconPath; +import org.opengauss.mppdbide.view.vo.CoverageService; import org.opengauss.mppdbide.view.workerjob.UIWorkerJob; /** @@ -135,6 +148,7 @@ import org.opengauss.mppdbide.view.workerjob.UIWorkerJob; * @since 3.0.0 */ public final class PLSourceEditorCore extends SelectMenuItem implements IPropertyChangeListener { + private static final String FORMAT_COMMAND_ID = "org.opengauss.mppdbide.command.id.format"; private ECommandService commandService; @@ -337,10 +351,10 @@ public final class PLSourceEditorCore extends SelectMenuItem implements IPropert addPasteMenuItem(menu); addSelectAllMenuItem(menu); addToggleLineCommentMenuItem(menu); + addRemarkLineCommentMenuItem(menu); addToggleBlockCommentMenuItem(menu); addFormatMenuItem(menu); addExecStmtMenuItem(menu); - this.config = new SQLSourceViewerConfig(syntx); setTabStrategy(); @@ -1334,6 +1348,69 @@ 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) { + 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, + "提示", + "该版本不支持此功能!"); + return; + } + ISelection res = viewer.getSelection(); + int start = Integer.valueOf(res.toString().split("startLine: ")[1].split(",")[0]); + String[] arr = res.toString().split("endLine: "); + 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=DebuggerStartConstants.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; + DebuggerStartConstants.setStartInfo(oid, startInfo); + } catch (SQLException e1) { + e1.printStackTrace(); + } finally { + try { + conn.get().close(); + } catch (SQLException e) { + e.printStackTrace(); + } + } + } + + @Override + public void widgetDefaultSelected(SelectionEvent event) { + + } + }); + toggleLineComments.setImage(IconUtility.getIconImage(IiconPath.ICON_REMARK_COVERAGE, this.getClass())); + } + + + /** * Adds the toggle block comment menu item. * @@ -2463,7 +2540,7 @@ public final class PLSourceEditorCore extends SelectMenuItem implements IPropert /** * to remove completed Job - * + * * @param job which job need to be removed */ public void removeCompletedJob(UIWorkerJob job) { @@ -2482,7 +2559,7 @@ public final class PLSourceEditorCore extends SelectMenuItem implements IPropert public AnnotationModel getfAnnotationModel() { return fAnnotationModel; } - + /** * pre destroy */ 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..07dae8193229444072655a6cc53e3b83b3398b34 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 @@ -71,6 +71,8 @@ public class SQLSyntaxColorProvider { * The Constant BACKGROUND_COLOR. */ public static final Color BACKGROUND_COLOR = new Color(Display.getCurrent(), BACKGROUND); + + 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/handler/ExecuteEditorItem.java b/code/datastudio/src/org.opengauss.mppdbide.view/src/org/opengauss/mppdbide/view/handler/ExecuteEditorItem.java index cdcecad51bc26a5d75d8b2dfccfc904c014012bd..789a7850d2aaa9bc3d3207a6584b48dbde21c44e 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; @@ -29,16 +30,18 @@ import org.eclipse.jface.text.BadLocationException; import org.eclipse.jface.text.Document; import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.Shell; - import org.opengauss.mppdbide.adapter.gauss.DBConnection; 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 +59,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; @@ -73,802 +77,826 @@ import org.opengauss.mppdbide.view.utils.dialog.MPPDBIDEDialogs.MESSAGEDIALOGTYP */ public class ExecuteEditorItem implements ExecuteWrapper { - /** - * Executor - * - * @param application - * @param service - */ - @Inject - private ECommandService commandService; - - @Inject - private EHandlerService handlerService; - - private QueryInfo queryInfo = new QueryInfo(); - - private static final String ERROR_POSITION_IDENTIFIER = "Position:"; - - /** - * Execute. - */ - @Execute - public void execute() { - - MPPDBIDELoggerUtility - .info(MessageConfigLoader.getProperty(IMessagesConstants.GUI_EXECUTEEDITORITEM_EXECUTE_CLICKED)); - PLSourceEditor editor = UIElement.getInstance().getVisibleSourceViewer(); - if (null == editor) { - Command command = commandService.getCommand("org.opengauss.mppdbide.command.id.executeobjectbrowseritem"); - ParameterizedCommand parameterizedCommand = ParameterizedCommand.generateCommand(command, null); - handlerService.executeHandler(parameterizedCommand); - return; - } - editor.setExecuteInProgress(true); - editor.enabledisableTextWidget(false); - IDebugObject debugObject = editor.getDebugObject(); - ObjectChangeWorker objWorker = new ObjectChangeWorker("Function Change Worker", - null, debugObject, editor, this, IMessagesConstants.FUNCTN_CHANGE_MSG, - IMessagesConstants.FUNCTN_CHANGE_OVERWRITE); - objWorker.schedule(); - } - - /** - * Handle execute. - * - * @param event the event - */ - @Override - public void handleExecute(ObjectChangeEvent event) { - PLSourceEditor editor = event.getEditor(); - IDebugObject debugObject = event.getDbgObj(); - Database db = debugObject.getDatabase(); - boolean iscontinue = true; - - if (validateForRefreshStatus(event)) { - iscontinue = refreshDebugObjectOnTerminal(editor, debugObject, db); - } else { - boolean codeChanged = editor.isCodeChanged(); - int returnVal = displayIfCodeChanged(codeChanged); - - boolean debugObjChanged = true; - debugObjChanged = getDebugObjectChanged(debugObject, debugObjChanged); - - iscontinue = executeIfCodeNotChanged(editor, debugObject, db, codeChanged, returnVal, debugObjChanged); - - iscontinue = executeIfCodeIsChanged(editor, iscontinue, codeChanged, returnVal, debugObjChanged); - } - if (iscontinue) { - editor.enabledisableTextWidget(true); - editor.setCompileInProgress(false); - editor.setExecuteInProgress(false); - executeSQLObjWindow(debugObject, false); - } - } - - /** - * Execute if code is changed. - * - * @param editor the editor - * @param iscontinue the iscontinue - * @param codeChanged the code changed - * @param returnVal the return val - * @param debugObjChanged the debug obj changed - * @return true, if successful - */ - private boolean executeIfCodeIsChanged(PLSourceEditor editor, boolean iscontinue, boolean codeChanged, - int returnVal, boolean debugObjChanged) { - iscontinue = refreshOnDebugObjChange(editor, iscontinue, codeChanged, returnVal, debugObjChanged); - if (iscontinue && codeChanged && (returnVal != 0)) { - editor.enabledisableTextWidget(true); - editor.setCompileInProgress(false); - editor.setExecuteInProgress(false); - return false; - } - return iscontinue; - } - - /** - * Refresh on debug obj change. - * - * @param editor the editor - * @param iscontinue the iscontinue - * @param codeChanged the code changed - * @param returnVal the return val - * @param debugObjChanged the debug obj changed - * @return true, if successful - */ - private boolean refreshOnDebugObjChange(PLSourceEditor editor, boolean iscontinue, boolean codeChanged, - int returnVal, boolean debugObjChanged) { - if (iscontinue && codeChanged && (returnVal == 0)) { - refreshDebugObjectOnChanged(editor, debugObjChanged); - editor.setCompileInProgress(false); - editor.setExecuteInProgress(false); - editor.enabledisableTextWidget(true); - editor.getConsoleMessageWindow(true) - .logInfo(MessageConfigLoader.getProperty(IMessagesConstants.STATUS_MSG_STATUS)); - iscontinue = executeIfDebugObjectIsNotChanged(editor, debugObjChanged); - } - return iscontinue; - } - - /** - * Execute if debug object is not changed. - * - * @param editor the editor - * @param debugObjChanged the debug obj changed - * @return true, if successful - */ - private boolean executeIfDebugObjectIsNotChanged(PLSourceEditor editor, boolean debugObjChanged) { - if (!debugObjChanged) { - - // source code changed, but the debug object didnt change as new - // debug object compiled open the new function in a new tab - - IExecutionContext context = generateContext(Display.getDefault().getActiveShell(), editor); - TerminalQueryExecutionWorker worker = new TerminalQueryExecutionWorker(context) { - - private boolean isExecuted = false; - - /** - * Final cleanup. - * - * @throws MPPDBIDEException the MPPDBIDE exception - */ - public void finalCleanup() throws MPPDBIDEException { - super.finalCleanup(); - if (this.context instanceof FuncProcEditorTerminalExecutionContext) { - FuncProcEditorTerminalExecutionContext funcContext = (FuncProcEditorTerminalExecutionContext) this.context; - IResultDisplayUIManager canExecute = funcContext.getResultDisplayUIManager(); - if (CanContextContinueExecuteRule.CONTEXT_EXECUTION_PROCEED == canExecute - .canContextExecutionContinue() && !isExecuted) { - Display.getDefault().syncExec(new Runnable() { - @Override - public void run() { - PLSourceEditor editor1 = UIElement.getInstance() - .getEditorModelById(funcContext.getDebugObject()); - if (editor1 != null) { - editor1.enabledisableTextWidget(true); - editor1.setCompileInProgress(false); - editor1.setExecuteInProgress(false); - executeSQLObjWindow(editor1.getDebugObject(), false); - } - } - }); - - isExecuted = true; - } - - } - - } - }; - worker.setTaskDB(context.getTermConnection().getDatabase()); - worker.schedule(); - return false; - } - return true; - } - - /** - * Refresh debug object on changed. - * - * @param editor the editor - * @param debugObjChanged the debug obj changed - */ - private void refreshDebugObjectOnChanged(PLSourceEditor editor, boolean debugObjChanged) { - if (debugObjChanged) { - editor.refreshDebugObjectAfterEdit(editor.getDebugObject()); - } - } - - /** - * Execute if code not changed. - * - * @param editor the editor - * @param debugObject the debug object - * @param db the db - * @param codeChanged the code changed - * @param returnVal the return val - * @param debugObjChanged the debug obj changed - * @return true, if successful - */ - private boolean executeIfCodeNotChanged(PLSourceEditor editor, IDebugObject debugObject, Database db, - boolean codeChanged, int returnVal, boolean debugObjChanged) { - if (validateIfCodeChanged(codeChanged, returnVal) && debugObjChanged) { - return executeOnCodeChange(editor, debugObject, db); - } - return true; - } - - /** - * Execute on code change. - * - * @param editor the editor - * @param debugObject the debug object - * @param db the db - * @return true, if successful - */ - private boolean executeOnCodeChange(PLSourceEditor editor, IDebugObject debugObject, Database db) { - try { - executeOnTerminal(editor, debugObject, db); - editor.enabledisableTextWidget(true); - } catch (DatabaseOperationException exception) { - MPPDBIDELoggerUtility.error("error while execute debug obj.", exception); - editor.enabledisableTextWidget(true); - return false; - } - return true; - } - - /** - * Validate if code changed. - * - * @param codeChanged the code changed - * @param returnVal the return val - * @return true, if successful - */ - private boolean validateIfCodeChanged(boolean codeChanged, int returnVal) { - return (!codeChanged) || (returnVal == 0); - } - - /** - * Display if code changed. - * - * @param codeChanged the code changed - * @return the int - */ - private int displayIfCodeChanged(boolean codeChanged) { - int returnVal = -1; - if (codeChanged) { - returnVal = MPPDBIDEDialogs.generateYesNoMessageDialog(MESSAGEDIALOGTYPE.QUESTION, true, - MessageConfigLoader.getProperty(IMessagesConstants.SOURCE_CODE_CHANGE), - MessageConfigLoader.getProperty(IMessagesConstants.SOURCE_HAS_BEEN_CHANGED)); - } - return returnVal; - } - - /** - * Gets the debug object changed. - * - * @param debugObject the debug object - * @param debugObjChanged the debug obj changed - * @return the debug object changed - */ - private boolean getDebugObjectChanged(IDebugObject debugObject, boolean debugObjChanged) { - try { - debugObjChanged = debugObject.isChanged(debugObject.getLatestInfo()); - } catch (DatabaseCriticalException exception) { - MPPDBIDELoggerUtility.error("error while comparing debug obj info with server", exception); - } catch (DatabaseOperationException exception) { - MPPDBIDELoggerUtility.error("error while comparing debug obj info with server", exception); - } - return debugObjChanged; - } - - /** - * Refresh debug object on terminal. - * - * @param editor the editor - * @param debugObject the debug object - * @param db the db - * @return true, if successful - */ - private boolean refreshDebugObjectOnTerminal(PLSourceEditor editor, IDebugObject debugObject, Database db) { - editor.setDocument(new Document(debugObject.getSourceCode().getCode())); - editor.registerModifyListener(); - try { - executeOnTerminal(editor, debugObject, db); - } catch (DatabaseOperationException exception) { - MPPDBIDELoggerUtility.error("error while execute debug obj.", exception); - editor.enabledisableTextWidget(true); - return false; - } - return true; - } - - /** - * Validate for refresh status. - * - * @param event the event - * @return true, if successful - */ - private boolean validateForRefreshStatus(ObjectChangeEvent event) { - return event.getStatus() != null && event.getStatus().equals(ButtonPressed.REFRESH); - } - - /** - * Generate context. - * - * @param shell the shell - * @param editor the editor - * @return the i execution context - */ - private IExecutionContext generateContext(Shell shell, PLSourceEditor editor) { - ExecuteSourceEditor executeSourceEditor = null; - executeSourceEditor = new ExecuteSourceEditor(shell, editor); - - return executeSourceEditor.getContextForNewEditor(); - - } - - /** - * Execute on terminal. - * - * @param editor the editor - * @param debugObject the debug object - * @param db the db - * @throws DatabaseOperationException the database operation exception - */ - private void executeOnTerminal(PLSourceEditor editor, IDebugObject debugObject, Database db) - throws DatabaseOperationException { - String query = editor.getDocument(); - DBConnection conn = null; - - try { - conn = executeOnTerminal(editor, debugObject, query); - } catch (DatabaseOperationException exception) { - editor.setExecuteInProgress(false); - String message = ""; - message = getServerMessageDetails(editor, query, exception); - message = getErrorMessage(message, exception); - editor.getConsoleMessageWindow(true).logErrorInUI(message); - MPPDBIDELoggerUtility.error("ExecuteEditorItem: execute on terminal failed.", exception); - throw new DatabaseOperationException("error occured."); - } catch (DatabaseCriticalException e) { - UIDisplayFactoryProvider.getUIDisplayStateIf().handleDBCriticalError(e, db); - return; - } finally { - releaseConnection(db, conn); - } - - } - - /** - * Execute on terminal. - * - * @param editor the editor - * @param debugObject the debug object - * @param query the query - * @return the DB connection - * @throws DatabaseCriticalException the database critical exception - * @throws DatabaseOperationException the database operation exception - */ - private DBConnection executeOnTerminal(PLSourceEditor editor, IDebugObject debugObject, String query) - throws DatabaseCriticalException, DatabaseOperationException { - DBConnection conn = null; - if (query.trim().isEmpty()) { - MPPDBIDEDialogs.generateOKMessageDialog(MESSAGEDIALOGTYPE.ERROR, true, - MessageConfigLoader.getProperty(IMessagesConstants.EMPTY_PLSOURCE_TITEL), - MessageConfigLoader.getProperty(IMessagesConstants.EMPTY_PLSOURCE_VIEWER)); - return conn; - } - - conn = debugObject.getDatabase().getConnectionManager().getObjBrowserConn(); - DatabaseUtils.executeOnSqlTerminalAndReturnNothing(query, 0, conn, editor.getConsoleMsgQueue(false)); - editor.setCriticalErr(true); - editor.refreshDebugObjectAfterEdit(debugObject); - editor.setModified(false); - editor.setModifiedAfterCreate(false); - editor.setExecuteInProgress(false); - return conn; - } - - /** - * Release connection. - * - * @param db the db - * @param conn the conn - */ - private void releaseConnection(Database db, DBConnection conn) { - if (conn != null) { - db.getConnectionManager().releaseAndDisconnection(conn); - } - } - - /** - * Gets the error message. - * - * @param message the message - * @param e the e - * @return the error message - */ - private String getErrorMessage(String message, DatabaseOperationException e) { - if (message.isEmpty()) { - message = MessageConfigLoader.getProperty(IMessagesConstants.EXECUTION_FAILED_ITEM, - MPPDBIDEConstants.LINE_SEPARATOR, e.getErrorCode(), - e.getServerMessage() == null ? e.getDBErrorMessage() : e.getServerMessage()); - } - return message; - } - - /** - * Gets the server message details. - * - * @param editor the editor - * @param query the query - * @param e the e - * @return the server message details - */ - private String getServerMessageDetails(PLSourceEditor editor, String query, DatabaseOperationException e) { - String message = ""; - if (validateServerMessage(e)) { - try { - getErrorDetailsForLocator(editor, query, e); - } catch (BadLocationException exception) { - MPPDBIDELoggerUtility.error("ExecuteEditorItem: execute on terminal failed.", exception); - } - - message = MessageConfigLoader.getProperty(IMessagesConstants.EXECUTION_FAILED_ITEM, - MPPDBIDEConstants.LINE_SEPARATOR, e.getErrorCode(), - (e.getServerMessage() == null ? e.getDBErrorMessage() : e.getServerMessage()) - + MPPDBIDEConstants.LINE_SEPARATOR + " Line Number: " + queryInfo.getErrLineNo()); - } - return message; - } - - /** - * Validate server message. - * - * @param e the e - * @return true, if successful - */ - private boolean validateServerMessage(DatabaseOperationException e) { - return e.getServerMessage() != null && e.getServerMessage().contains(ERROR_POSITION_IDENTIFIER); - } - - /** - * Gets the error details for locator. - * - * @param editor the editor - * @param query the query - * @param e the e - * @return the error details for locator - * @throws BadLocationException the bad location exception - */ - private void getErrorDetailsForLocator(PLSourceEditor editor, String query, DatabaseOperationException e) - throws BadLocationException { - Database database = editor.getDatabase(); - - if (database != null) { - IErrorLocator errorLocator = database.getErrorLocator(); - String msg = e.getServerMessage(); - int errorPos = -1; - errorPos = getErrorPOsition(msg, errorPos); - - errorPos = getErrorPositionForGreaterThanSize(query, errorPos); - queryInfo.setErrorPosition(errorPos); - int errLineNo = editor.getsourceViewerLineOfOffset(getErrorLineNumber(errorLocator)); - queryInfo.setErrLineNo(errLineNo + 1); - } - } - - /** - * Gets the error line number. - * - * @param errorLocator the error locator - * @return the error line number - */ - private int getErrorLineNumber(IErrorLocator errorLocator) { - return errorLocator.errorLineNumber(queryInfo.getStartOffset(), queryInfo.getErrorPosition()); - } - - /** - * Gets the error P osition. - * - * @param msg the msg - * @param errorPos the error pos - * @return the error P osition - */ - private int getErrorPOsition(String msg, int errorPos) { - if (null != msg) { - - int idx = msg.lastIndexOf(ERROR_POSITION_IDENTIFIER); - String newStr; - newStr = getErrorPositionString(msg, idx); - - newStr = getStringForNewLine(newStr); - errorPos = convertErrorPositionToInt(errorPos, newStr); - } - - else { - errorPos++; - } - return errorPos; - } - - /** - * Gets the error position for greater than size. - * - * @param query the query - * @param errorPos the error pos - * @return the error position for greater than size - */ - private int getErrorPositionForGreaterThanSize(String query, int errorPos) { - if (errorPos > query.length()) { - errorPos = query.length(); - } - return errorPos; - } - - /** - * Convert error position to int. - * - * @param errorPos the error pos - * @param newStr the new str - * @return the int - */ - private int convertErrorPositionToInt(int errorPos, String newStr) { - try { - errorPos = Integer.parseInt(newStr.trim()); - } catch (NumberFormatException ex) { - errorPos++; - } - return errorPos; - } - - /** - * Gets the error position string. - * - * @param msg the msg - * @param idx the idx - * @return the error position string - */ - private String getErrorPositionString(String msg, int idx) { - String newStr; - if (idx != -1) { - newStr = msg.substring(idx + ERROR_POSITION_IDENTIFIER.length() + 1); - } else { - newStr = msg.substring(ERROR_POSITION_IDENTIFIER.length() + 1); - } - return newStr; - } - - /** - * Gets the string for new line. - * - * @param newStr the new str - * @return the string for new line - */ - private String getStringForNewLine(String newStr) { - if (newStr.contains(MPPDBIDEConstants.LINE_SEPARATOR)) { - newStr = newStr.substring(0, newStr.indexOf(MPPDBIDEConstants.LINE_SEPARATOR)); - } - return newStr; - } - - /** - * Execute SQL obj window. - * - * @param debugObject the debug object - */ - public void executeSQLObjWindow(IDebugObject debugObject, boolean isCurrentTerminal) { - ExcuteSQLObjectTable executeSQLObjectWindowCoreEdit = new ExcuteSQLObjectTable( - Display.getDefault().getActiveShell()); - executeSQLObjectWindowCoreEdit.setSyntax(getSqlSyntax(debugObject)); - try { - executeSQLObjectWindowCoreEdit.setDebugObject(debugObject); - } catch (DatabaseCriticalException exception) { - UIDisplayFactoryProvider.getUIDisplayStateIf().handleDBCriticalError(exception, debugObject.getDatabase()); - return; - } catch (MPPDBIDEException exception) { - handleMppDbIdeException(exception); - return; - } catch (Exception exception) { - MPPDBIDELoggerUtility.error( - MessageConfigLoader.getProperty(IMessagesConstants.ERR_WHILE_STARTING_TO_EXECUTE_SQL_OBJECT), - exception); - MPPDBIDEDialogs.generateErrorDialog(MessageConfigLoader.getProperty(IMessagesConstants.PLSQL_ERR), - MessageConfigLoader.getProperty(IMessagesConstants.UNKNOWN_INTERNAL_ERR), exception); - } - executeSQLObjectWindowCoreEdit.defaultParameterValues(); - debugObject.setIsCurrentTerminal(isCurrentTerminal); - - openParameterWindow(debugObject, executeSQLObjectWindowCoreEdit); - } - - private void handleMppDbIdeException(MPPDBIDEException exception) { - UIDisplayUtil.getDebugConsole().logError(MessageConfigLoader - .getProperty(IMessagesConstants.OPERATION_CANNOT_BE_PERFOREMD, exception.getMessage())); - MPPDBIDEDialogs.generateDSErrorDialog(MessageConfigLoader.getProperty(IMessagesConstants.EXECUTE_DEBUGE), - MessageConfigLoader.getProperty(IMessagesConstants.OPERATION_CANNOT_BE_PERFOREMD_TITLE), - MessageConfigLoader.getProperty(IMessagesConstants.OPERATION_CANNOT_BE_PERFOREMD, - exception.getServerMessage()), - exception); - } - - /** - * Open parameter window. - * - * @param debugObject the debug object - * @param executeSQLObjectWindowCoreEdit the execute SQL object window core - * edit - */ - private void openParameterWindow(IDebugObject debugObject, ExcuteSQLObjectTable executeSQLObjectWindowCoreEdit) { - if (executeFunctionProcedure(debugObject, executeSQLObjectWindowCoreEdit)) { - - executeSQLObjectWindowCoreEdit.open(); - } - } - - /** - * Gets the sql syntax. - * - * @param debugObject the debug object - * @return the sql syntax - */ - private SQLSyntax getSqlSyntax(IDebugObject debugObject) { - return debugObject.getDatabase() == null ? null : debugObject.getDatabase().getSqlSyntax(); - } - - /** - * Execute function procedure. - * - * @param debugObject the debug object - * @param executeSQLObjectWindowCoreEdit the execute SQL object window core - * edit - * @return true, if successful - */ - private boolean executeFunctionProcedure(IDebugObject debugObject, - ExcuteSQLObjectTable executeSQLObjectWindowCoreEdit) { - boolean isContinue = true; - if (validateOlapFunctions(debugObject)) { - ArrayList params = debugObject.getTemplateParameters(); - - isContinue = executeForNoParameters(executeSQLObjectWindowCoreEdit, params); - - isContinue = validateExecutableFunction(isContinue, params); - } - return isContinue; - } - - /** - * Validate executable function. - * - * @param isContinue the is continue - * @param params the params - * @return true, if successful - */ - private boolean validateExecutableFunction(boolean isContinue, ArrayList params) { - if (isContinue && !IHandlerUtilities.isFunctionExecutable(false, params)) { - return false; - } - return isContinue; - } - - /** - * Execute for no parameters. - * - * @param executeSQLObjectWindowCoreEdit the execute SQL object window core - * edit - * @param params the params - * @return true, if successful - */ - private boolean executeForNoParameters(ExcuteSQLObjectTable executeSQLObjectWindowCoreEdit, - ArrayList params) { - if (params == null || params.size() == 0) { - executeSQLObjectWindowCoreEdit.executePressed(); - return false; - } - return true; - } - - /** - * Validate olap functions. - * - * @param debugObject the debug object - * @return true, if successful - */ - private boolean validateOlapFunctions(IDebugObject debugObject) { - return debugObject.getObjectType() == OBJECTTYPE.PLSQLFUNCTION - || debugObject.getObjectType() == OBJECTTYPE.PROCEDURE - || debugObject.getObjectType() == OBJECTTYPE.SQLFUNCTION - || debugObject.getObjectType() == OBJECTTYPE.CFUNCTION; - } - - /** - * Can execute. - * - * @return true, if successful - */ - @CanExecute - public boolean canExecute() { - IDebugObject object = IHandlerUtilities.getSelectedDebugObject(); - boolean isObjectBrowserActive = UIElement.getInstance().isObjectBrowserActive(); - - if (validatePlEditorExists(object)) { - return false; - } - - object = getDebugObject(object, isObjectBrowserActive); - - PLSourceEditor editor = UIElement.getInstance().getVisibleSourceViewer(); - - if (getDbConnected(object)) { - return validateOperationInProgress(editor); - } - return false; - - } - - /** - * Validate pl editor exists. - * - * @param object the object - * @return true, if successful - */ - private boolean validatePlEditorExists(IDebugObject object) { - return object == null && null == UIElement.getInstance().getVisibleSourceViewer(); - } - - /** - * Gets the db connected. - * - * @param object the object - * @return the db connected - */ - private boolean getDbConnected(IDebugObject object) { - return object != null && object.getDatabase().isConnected(); - } - - /** - * Validate operation in progress. - * - * @param editor the editor - * @return true, if successful - */ - private boolean validateOperationInProgress(PLSourceEditor editor) { - if (validateExecutionInProgress(editor)) { - return false; - } - return true; - } - - /** - * Validate execution in progress. - * - * @param editor the editor - * @return true, if successful - */ - private boolean validateExecutionInProgress(PLSourceEditor editor) { - return editor != null && (editor.isCompileInProgress() || editor.isExecuteInProgress()); - } - - /** - * Gets the debug object. - * - * @param object the object - * @param isObjectBrowserActive the is object browser active - * @return the debug object - */ - private IDebugObject getDebugObject(IDebugObject object, boolean isObjectBrowserActive) { - PLSourceEditor sourceViewerEditor = UIElement.getInstance().getVisibleSourceViewer(); - if (sourceViewerEditor != null && (object == null || !isObjectBrowserActive)) { - object = sourceViewerEditor.getDebugObject(); - } - return object; - } - - /** - * Handle exception. - * - * @param e the e - * @param event the event - */ - @Override - public void handleException(Throwable exception, ObjectChangeEvent event) { - MPPDBIDELoggerUtility.error(MessageConfigLoader.getProperty(IMessagesConstants.ERR_GUI_SOURCE_NOT_AVAILABLE), - exception); - ConsoleCoreWindow.getInstance() - .logWarning(MessageConfigLoader.getProperty(IMessagesConstants.ERR_GUI_SOURCE_NOT_AVAILABLE)); - String msg = MessageConfigLoader.getProperty(IMessagesConstants.FUNCT_CHANGE_EXECUTE_ERR) - + exception.getMessage(); - MPPDBIDEDialogs.generateOKMessageDialog(MESSAGEDIALOGTYPE.ERROR, true, - MessageConfigLoader.getProperty(IMessagesConstants.PL_SOURCE_VIEWER_ERROR), msg); - PLSourceEditor srcEditor = event.getEditor(); - srcEditor.setExecuteInProgress(false); - srcEditor.setCompileInProgress(false); - srcEditor.enabledisableTextWidget(true); - } + /** + * Executor + * + * @param application + * @param service + */ + @Inject + private ECommandService commandService; + + @Inject + private EHandlerService handlerService; + + private QueryInfo queryInfo = new QueryInfo(); + + private static final String ERROR_POSITION_IDENTIFIER = "Position:"; + + private volatile boolean isPldebugger = true; + + /** + * Execute. + */ + @Execute + public void execute() { + + MPPDBIDELoggerUtility + .info(MessageConfigLoader.getProperty(IMessagesConstants.GUI_EXECUTEEDITORITEM_EXECUTE_CLICKED)); + PLSourceEditor editor = UIElement.getInstance().getVisibleSourceViewer(); + if (null == editor) { + Command command = commandService.getCommand("org.opengauss.mppdbide.command.id.executeobjectbrowseritem"); + ParameterizedCommand parameterizedCommand = ParameterizedCommand.generateCommand(command, null); + handlerService.executeHandler(parameterizedCommand); + return; + } + editor.setExecuteInProgress(true); + editor.enabledisableTextWidget(false); + DebugObjects debugObject = (DebugObjects)editor.getDebugObject(); + checkVersion(editor); + if (!isPldebugger) { + debugObject.setUsagehint(MessageConfigLoader.getProperty(IMessagesConstants.COVERAGE_HINT)); + } + ObjectChangeWorker objWorker = new ObjectChangeWorker("Function Change Worker", + null, debugObject, editor, this, IMessagesConstants.FUNCTN_CHANGE_MSG, + IMessagesConstants.FUNCTN_CHANGE_OVERWRITE); + objWorker.schedule(); + } + + /** + * Handle execute. + * + * @param event the event + */ + @Override + public void handleExecute(ObjectChangeEvent event) { + PLSourceEditor editor = event.getEditor(); + IDebugObject debugObject = event.getDbgObj(); + Database db = debugObject.getDatabase(); + boolean iscontinue = true; + + if (validateForRefreshStatus(event)) { + iscontinue = refreshDebugObjectOnTerminal(editor, debugObject, db); + } else { + boolean codeChanged = editor.isCodeChanged(); + int returnVal = displayIfCodeChanged(codeChanged); + + boolean debugObjChanged = true; + debugObjChanged = getDebugObjectChanged(debugObject, debugObjChanged); + + iscontinue = executeIfCodeNotChanged(editor, debugObject, db, codeChanged, returnVal, debugObjChanged); + + iscontinue = executeIfCodeIsChanged(editor, iscontinue, codeChanged, returnVal, debugObjChanged); + } + if (iscontinue) { + editor.enabledisableTextWidget(true); + editor.setCompileInProgress(false); + editor.setExecuteInProgress(false); + executeSQLObjWindow(debugObject, false); + } + } + + private void checkVersion(PLSourceEditor editor) { + IConnection conn = null; + try { + conn = new DBConnectionProvider(editor.getDebugObject().getDatabase()).getValidFreeConnection(); + isPldebugger = VersionHelper.getDebuggerVersion(conn).isPldebugger(); + } catch(Exception e) { + e.printStackTrace(); + } finally { + if (null != conn) { + try { + conn.close(); + } catch (SQLException e) { + e.printStackTrace(); + } + } + } + } + + /** + * Execute if code is changed. + * + * @param editor the editor + * @param iscontinue the iscontinue + * @param codeChanged the code changed + * @param returnVal the return val + * @param debugObjChanged the debug obj changed + * @return true, if successful + */ + private boolean executeIfCodeIsChanged(PLSourceEditor editor, boolean iscontinue, boolean codeChanged, + int returnVal, boolean debugObjChanged) { + iscontinue = refreshOnDebugObjChange(editor, iscontinue, codeChanged, returnVal, debugObjChanged); + if (iscontinue && codeChanged && (returnVal != 0)) { + editor.enabledisableTextWidget(true); + editor.setCompileInProgress(false); + editor.setExecuteInProgress(false); + return false; + } + return iscontinue; + } + + /** + * Refresh on debug obj change. + * + * @param editor the editor + * @param iscontinue the iscontinue + * @param codeChanged the code changed + * @param returnVal the return val + * @param debugObjChanged the debug obj changed + * @return true, if successful + */ + private boolean refreshOnDebugObjChange(PLSourceEditor editor, boolean iscontinue, boolean codeChanged, + int returnVal, boolean debugObjChanged) { + if (iscontinue && codeChanged && (returnVal == 0)) { + refreshDebugObjectOnChanged(editor, debugObjChanged); + editor.setCompileInProgress(false); + editor.setExecuteInProgress(false); + editor.enabledisableTextWidget(true); + editor.getConsoleMessageWindow(true) + .logInfo(MessageConfigLoader.getProperty(IMessagesConstants.STATUS_MSG_STATUS)); + iscontinue = executeIfDebugObjectIsNotChanged(editor, debugObjChanged); + } + return iscontinue; + } + + /** + * Execute if debug object is not changed. + * + * @param editor the editor + * @param debugObjChanged the debug obj changed + * @return true, if successful + */ + private boolean executeIfDebugObjectIsNotChanged(PLSourceEditor editor, boolean debugObjChanged) { + if (!debugObjChanged) { + + // source code changed, but the debug object didnt change as new + // debug object compiled open the new function in a new tab + + IExecutionContext context = generateContext(Display.getDefault().getActiveShell(), editor); + TerminalQueryExecutionWorker worker = new TerminalQueryExecutionWorker(context) { + + private boolean isExecuted = false; + + /** + * Final cleanup. + * + * @throws MPPDBIDEException the MPPDBIDE exception + */ + public void finalCleanup() throws MPPDBIDEException { + super.finalCleanup(); + if (this.context instanceof FuncProcEditorTerminalExecutionContext) { + FuncProcEditorTerminalExecutionContext funcContext = (FuncProcEditorTerminalExecutionContext) this.context; + IResultDisplayUIManager canExecute = funcContext.getResultDisplayUIManager(); + if (CanContextContinueExecuteRule.CONTEXT_EXECUTION_PROCEED == canExecute + .canContextExecutionContinue() && !isExecuted) { + Display.getDefault().syncExec(new Runnable() { + @Override + public void run() { + PLSourceEditor editor1 = UIElement.getInstance() + .getEditorModelById(funcContext.getDebugObject()); + if (editor1 != null) { + editor1.enabledisableTextWidget(true); + editor1.setCompileInProgress(false); + editor1.setExecuteInProgress(false); + executeSQLObjWindow(editor1.getDebugObject(), false); + } + } + }); + + isExecuted = true; + } + + } + + } + }; + worker.setTaskDB(context.getTermConnection().getDatabase()); + worker.schedule(); + return false; + } + return true; + } + + /** + * Refresh debug object on changed. + * + * @param editor the editor + * @param debugObjChanged the debug obj changed + */ + private void refreshDebugObjectOnChanged(PLSourceEditor editor, boolean debugObjChanged) { + if (debugObjChanged) { + editor.refreshDebugObjectAfterEdit(editor.getDebugObject()); + } + } + + /** + * Execute if code not changed. + * + * @param editor the editor + * @param debugObject the debug object + * @param db the db + * @param codeChanged the code changed + * @param returnVal the return val + * @param debugObjChanged the debug obj changed + * @return true, if successful + */ + private boolean executeIfCodeNotChanged(PLSourceEditor editor, IDebugObject debugObject, Database db, + boolean codeChanged, int returnVal, boolean debugObjChanged) { + if (validateIfCodeChanged(codeChanged, returnVal) && debugObjChanged) { + return executeOnCodeChange(editor, debugObject, db); + } + return true; + } + + /** + * Execute on code change. + * + * @param editor the editor + * @param debugObject the debug object + * @param db the db + * @return true, if successful + */ + private boolean executeOnCodeChange(PLSourceEditor editor, IDebugObject debugObject, Database db) { + try { + executeOnTerminal(editor, debugObject, db); + editor.enabledisableTextWidget(true); + } catch (DatabaseOperationException exception) { + MPPDBIDELoggerUtility.error("error while execute debug obj.", exception); + editor.enabledisableTextWidget(true); + return false; + } + return true; + } + + /** + * Validate if code changed. + * + * @param codeChanged the code changed + * @param returnVal the return val + * @return true, if successful + */ + private boolean validateIfCodeChanged(boolean codeChanged, int returnVal) { + return (!codeChanged) || (returnVal == 0); + } + + /** + * Display if code changed. + * + * @param codeChanged the code changed + * @return the int + */ + private int displayIfCodeChanged(boolean codeChanged) { + int returnVal = -1; + if (codeChanged) { + returnVal = MPPDBIDEDialogs.generateYesNoMessageDialog(MESSAGEDIALOGTYPE.QUESTION, true, + MessageConfigLoader.getProperty(IMessagesConstants.SOURCE_CODE_CHANGE), + MessageConfigLoader.getProperty(IMessagesConstants.SOURCE_HAS_BEEN_CHANGED)); + } + return returnVal; + } + + /** + * Gets the debug object changed. + * + * @param debugObject the debug object + * @param debugObjChanged the debug obj changed + * @return the debug object changed + */ + private boolean getDebugObjectChanged(IDebugObject debugObject, boolean debugObjChanged) { + try { + debugObjChanged = debugObject.isChanged(debugObject.getLatestInfo()); + } catch (DatabaseCriticalException exception) { + MPPDBIDELoggerUtility.error("error while comparing debug obj info with server", exception); + } catch (DatabaseOperationException exception) { + MPPDBIDELoggerUtility.error("error while comparing debug obj info with server", exception); + } + return debugObjChanged; + } + + /** + * Refresh debug object on terminal. + * + * @param editor the editor + * @param debugObject the debug object + * @param db the db + * @return true, if successful + */ + private boolean refreshDebugObjectOnTerminal(PLSourceEditor editor, IDebugObject debugObject, Database db) { + editor.setDocument(new Document(debugObject.getSourceCode().getCode())); + editor.registerModifyListener(); + try { + executeOnTerminal(editor, debugObject, db); + } catch (DatabaseOperationException exception) { + MPPDBIDELoggerUtility.error("error while execute debug obj.", exception); + editor.enabledisableTextWidget(true); + return false; + } + return true; + } + + /** + * Validate for refresh status. + * + * @param event the event + * @return true, if successful + */ + private boolean validateForRefreshStatus(ObjectChangeEvent event) { + return event.getStatus() != null && event.getStatus().equals(ButtonPressed.REFRESH); + } + + /** + * Generate context. + * + * @param shell the shell + * @param editor the editor + * @return the i execution context + */ + private IExecutionContext generateContext(Shell shell, PLSourceEditor editor) { + ExecuteSourceEditor executeSourceEditor = null; + executeSourceEditor = new ExecuteSourceEditor(shell, editor); + + return executeSourceEditor.getContextForNewEditor(); + + } + + /** + * Execute on terminal. + * + * @param editor the editor + * @param debugObject the debug object + * @param db the db + * @throws DatabaseOperationException the database operation exception + */ + private void executeOnTerminal(PLSourceEditor editor, IDebugObject debugObject, Database db) + throws DatabaseOperationException { + String query = editor.getDocument(); + DBConnection conn = null; + + try { + conn = executeOnTerminal(editor, debugObject, query); + } catch (DatabaseOperationException exception) { + editor.setExecuteInProgress(false); + String message = ""; + message = getServerMessageDetails(editor, query, exception); + message = getErrorMessage(message, exception); + editor.getConsoleMessageWindow(true).logErrorInUI(message); + MPPDBIDELoggerUtility.error("ExecuteEditorItem: execute on terminal failed.", exception); + throw new DatabaseOperationException("error occured."); + } catch (DatabaseCriticalException e) { + UIDisplayFactoryProvider.getUIDisplayStateIf().handleDBCriticalError(e, db); + return; + } finally { + releaseConnection(db, conn); + } + + } + + /** + * Execute on terminal. + * + * @param editor the editor + * @param debugObject the debug object + * @param query the query + * @return the DB connection + * @throws DatabaseCriticalException the database critical exception + * @throws DatabaseOperationException the database operation exception + */ + private DBConnection executeOnTerminal(PLSourceEditor editor, IDebugObject debugObject, String query) + throws DatabaseCriticalException, DatabaseOperationException { + DBConnection conn = null; + if (query.trim().isEmpty()) { + MPPDBIDEDialogs.generateOKMessageDialog(MESSAGEDIALOGTYPE.ERROR, true, + MessageConfigLoader.getProperty(IMessagesConstants.EMPTY_PLSOURCE_TITEL), + MessageConfigLoader.getProperty(IMessagesConstants.EMPTY_PLSOURCE_VIEWER)); + return conn; + } + + conn = debugObject.getDatabase().getConnectionManager().getObjBrowserConn(); + DatabaseUtils.executeOnSqlTerminalAndReturnNothing(query, 0, conn, editor.getConsoleMsgQueue(false)); + editor.setCriticalErr(true); + editor.refreshDebugObjectAfterEdit(debugObject); + editor.setModified(false); + editor.setModifiedAfterCreate(false); + editor.setExecuteInProgress(false); + return conn; + } + + /** + * Release connection. + * + * @param db the db + * @param conn the conn + */ + private void releaseConnection(Database db, DBConnection conn) { + if (conn != null) { + db.getConnectionManager().releaseAndDisconnection(conn); + } + } + + /** + * Gets the error message. + * + * @param message the message + * @param e the e + * @return the error message + */ + private String getErrorMessage(String message, DatabaseOperationException e) { + if (message.isEmpty()) { + message = MessageConfigLoader.getProperty(IMessagesConstants.EXECUTION_FAILED_ITEM, + MPPDBIDEConstants.LINE_SEPARATOR, e.getErrorCode(), + e.getServerMessage() == null ? e.getDBErrorMessage() : e.getServerMessage()); + } + return message; + } + + /** + * Gets the server message details. + * + * @param editor the editor + * @param query the query + * @param e the e + * @return the server message details + */ + private String getServerMessageDetails(PLSourceEditor editor, String query, DatabaseOperationException e) { + String message = ""; + if (validateServerMessage(e)) { + try { + getErrorDetailsForLocator(editor, query, e); + } catch (BadLocationException exception) { + MPPDBIDELoggerUtility.error("ExecuteEditorItem: execute on terminal failed.", exception); + } + + message = MessageConfigLoader.getProperty(IMessagesConstants.EXECUTION_FAILED_ITEM, + MPPDBIDEConstants.LINE_SEPARATOR, e.getErrorCode(), + (e.getServerMessage() == null ? e.getDBErrorMessage() : e.getServerMessage()) + + MPPDBIDEConstants.LINE_SEPARATOR + " Line Number: " + queryInfo.getErrLineNo()); + } + return message; + } + + /** + * Validate server message. + * + * @param e the e + * @return true, if successful + */ + private boolean validateServerMessage(DatabaseOperationException e) { + return e.getServerMessage() != null && e.getServerMessage().contains(ERROR_POSITION_IDENTIFIER); + } + + /** + * Gets the error details for locator. + * + * @param editor the editor + * @param query the query + * @param e the e + * @return the error details for locator + * @throws BadLocationException the bad location exception + */ + private void getErrorDetailsForLocator(PLSourceEditor editor, String query, DatabaseOperationException e) + throws BadLocationException { + Database database = editor.getDatabase(); + + if (database != null) { + IErrorLocator errorLocator = database.getErrorLocator(); + String msg = e.getServerMessage(); + int errorPos = -1; + errorPos = getErrorPOsition(msg, errorPos); + + errorPos = getErrorPositionForGreaterThanSize(query, errorPos); + queryInfo.setErrorPosition(errorPos); + int errLineNo = editor.getsourceViewerLineOfOffset(getErrorLineNumber(errorLocator)); + queryInfo.setErrLineNo(errLineNo + 1); + } + } + + /** + * Gets the error line number. + * + * @param errorLocator the error locator + * @return the error line number + */ + private int getErrorLineNumber(IErrorLocator errorLocator) { + return errorLocator.errorLineNumber(queryInfo.getStartOffset(), queryInfo.getErrorPosition()); + } + + /** + * Gets the error P osition. + * + * @param msg the msg + * @param errorPos the error pos + * @return the error P osition + */ + private int getErrorPOsition(String msg, int errorPos) { + if (null != msg) { + + int idx = msg.lastIndexOf(ERROR_POSITION_IDENTIFIER); + String newStr; + newStr = getErrorPositionString(msg, idx); + + newStr = getStringForNewLine(newStr); + errorPos = convertErrorPositionToInt(errorPos, newStr); + } + + else { + errorPos++; + } + return errorPos; + } + + /** + * Gets the error position for greater than size. + * + * @param query the query + * @param errorPos the error pos + * @return the error position for greater than size + */ + private int getErrorPositionForGreaterThanSize(String query, int errorPos) { + if (errorPos > query.length()) { + errorPos = query.length(); + } + return errorPos; + } + + /** + * Convert error position to int. + * + * @param errorPos the error pos + * @param newStr the new str + * @return the int + */ + private int convertErrorPositionToInt(int errorPos, String newStr) { + try { + errorPos = Integer.parseInt(newStr.trim()); + } catch (NumberFormatException ex) { + errorPos++; + } + return errorPos; + } + + /** + * Gets the error position string. + * + * @param msg the msg + * @param idx the idx + * @return the error position string + */ + private String getErrorPositionString(String msg, int idx) { + String newStr; + if (idx != -1) { + newStr = msg.substring(idx + ERROR_POSITION_IDENTIFIER.length() + 1); + } else { + newStr = msg.substring(ERROR_POSITION_IDENTIFIER.length() + 1); + } + return newStr; + } + + /** + * Gets the string for new line. + * + * @param newStr the new str + * @return the string for new line + */ + private String getStringForNewLine(String newStr) { + if (newStr.contains(MPPDBIDEConstants.LINE_SEPARATOR)) { + newStr = newStr.substring(0, newStr.indexOf(MPPDBIDEConstants.LINE_SEPARATOR)); + } + return newStr; + } + + /** + * Execute SQL obj window. + * + * @param debugObject the debug object + */ + public void executeSQLObjWindow(IDebugObject debugObject, boolean isCurrentTerminal) { + ExcuteSQLObjectTable executeSQLObjectWindowCoreEdit = new ExcuteSQLObjectTable( + Display.getDefault().getActiveShell()); + executeSQLObjectWindowCoreEdit.setSyntax(getSqlSyntax(debugObject)); + try { + executeSQLObjectWindowCoreEdit.setDebugObject(debugObject); + } catch (DatabaseCriticalException exception) { + UIDisplayFactoryProvider.getUIDisplayStateIf().handleDBCriticalError(exception, debugObject.getDatabase()); + return; + } catch (MPPDBIDEException exception) { + handleMppDbIdeException(exception); + return; + } catch (Exception exception) { + MPPDBIDELoggerUtility.error( + MessageConfigLoader.getProperty(IMessagesConstants.ERR_WHILE_STARTING_TO_EXECUTE_SQL_OBJECT), + exception); + MPPDBIDEDialogs.generateErrorDialog(MessageConfigLoader.getProperty(IMessagesConstants.PLSQL_ERR), + MessageConfigLoader.getProperty(IMessagesConstants.UNKNOWN_INTERNAL_ERR), exception); + } + executeSQLObjectWindowCoreEdit.defaultParameterValues(); + debugObject.setIsCurrentTerminal(isCurrentTerminal); + + openParameterWindow(debugObject, executeSQLObjectWindowCoreEdit); + } + + private void handleMppDbIdeException(MPPDBIDEException exception) { + UIDisplayUtil.getDebugConsole().logError(MessageConfigLoader + .getProperty(IMessagesConstants.OPERATION_CANNOT_BE_PERFOREMD, exception.getMessage())); + MPPDBIDEDialogs.generateDSErrorDialog(MessageConfigLoader.getProperty(IMessagesConstants.EXECUTE_DEBUGE), + MessageConfigLoader.getProperty(IMessagesConstants.OPERATION_CANNOT_BE_PERFOREMD_TITLE), + MessageConfigLoader.getProperty(IMessagesConstants.OPERATION_CANNOT_BE_PERFOREMD, + exception.getServerMessage()), + exception); + } + + /** + * Open parameter window. + * + * @param debugObject the debug object + * @param executeSQLObjectWindowCoreEdit the execute SQL object window core + * edit + */ + private void openParameterWindow(IDebugObject debugObject, ExcuteSQLObjectTable executeSQLObjectWindowCoreEdit) { + if (executeFunctionProcedure(debugObject, executeSQLObjectWindowCoreEdit)) { + + executeSQLObjectWindowCoreEdit.open(); + } + } + + /** + * Gets the sql syntax. + * + * @param debugObject the debug object + * @return the sql syntax + */ + private SQLSyntax getSqlSyntax(IDebugObject debugObject) { + return debugObject.getDatabase() == null ? null : debugObject.getDatabase().getSqlSyntax(); + } + + /** + * Execute function procedure. + * + * @param debugObject the debug object + * @param executeSQLObjectWindowCoreEdit the execute SQL object window core + * edit + * @return true, if successful + */ + private boolean executeFunctionProcedure(IDebugObject debugObject, + ExcuteSQLObjectTable executeSQLObjectWindowCoreEdit) { + boolean isContinue = true; + if (validateOlapFunctions(debugObject)) { + ArrayList params = debugObject.getTemplateParameters(); + + isContinue = executeForNoParameters(executeSQLObjectWindowCoreEdit, params); + + isContinue = validateExecutableFunction(isContinue, params); + } + return isContinue; + } + + /** + * Validate executable function. + * + * @param isContinue the is continue + * @param params the params + * @return true, if successful + */ + private boolean validateExecutableFunction(boolean isContinue, ArrayList params) { + if (isContinue && !IHandlerUtilities.isFunctionExecutable(false, params)) { + return false; + } + return isContinue; + } + + /** + * Execute for no parameters. + * + * @param executeSQLObjectWindowCoreEdit the execute SQL object window core + * edit + * @param params the params + * @return true, if successful + */ + private boolean executeForNoParameters(ExcuteSQLObjectTable executeSQLObjectWindowCoreEdit, + ArrayList params) { + if (params == null || params.size() == 0) { + executeSQLObjectWindowCoreEdit.executePressed(); + return false; + } + return true; + } + + /** + * Validate olap functions. + * + * @param debugObject the debug object + * @return true, if successful + */ + private boolean validateOlapFunctions(IDebugObject debugObject) { + return debugObject.getObjectType() == OBJECTTYPE.PLSQLFUNCTION + || debugObject.getObjectType() == OBJECTTYPE.PROCEDURE + || debugObject.getObjectType() == OBJECTTYPE.SQLFUNCTION + || debugObject.getObjectType() == OBJECTTYPE.CFUNCTION; + } + + /** + * Can execute. + * + * @return true, if successful + */ + @CanExecute + public boolean canExecute() { + IDebugObject object = IHandlerUtilities.getSelectedDebugObject(); + boolean isObjectBrowserActive = UIElement.getInstance().isObjectBrowserActive(); + + if (validatePlEditorExists(object)) { + return false; + } + + object = getDebugObject(object, isObjectBrowserActive); + + PLSourceEditor editor = UIElement.getInstance().getVisibleSourceViewer(); + + if (getDbConnected(object)) { + return validateOperationInProgress(editor); + } + return false; + + } + + /** + * Validate pl editor exists. + * + * @param object the object + * @return true, if successful + */ + private boolean validatePlEditorExists(IDebugObject object) { + return object == null && null == UIElement.getInstance().getVisibleSourceViewer(); + } + + /** + * Gets the db connected. + * + * @param object the object + * @return the db connected + */ + private boolean getDbConnected(IDebugObject object) { + return object != null && object.getDatabase().isConnected(); + } + + /** + * Validate operation in progress. + * + * @param editor the editor + * @return true, if successful + */ + private boolean validateOperationInProgress(PLSourceEditor editor) { + if (validateExecutionInProgress(editor)) { + return false; + } + return true; + } + + /** + * Validate execution in progress. + * + * @param editor the editor + * @return true, if successful + */ + private boolean validateExecutionInProgress(PLSourceEditor editor) { + return editor != null && (editor.isCompileInProgress() || editor.isExecuteInProgress()); + } + + /** + * Gets the debug object. + * + * @param object the object + * @param isObjectBrowserActive the is object browser active + * @return the debug object + */ + private IDebugObject getDebugObject(IDebugObject object, boolean isObjectBrowserActive) { + PLSourceEditor sourceViewerEditor = UIElement.getInstance().getVisibleSourceViewer(); + if (sourceViewerEditor != null && (object == null || !isObjectBrowserActive)) { + object = sourceViewerEditor.getDebugObject(); + } + return object; + } + + /** + * Handle exception. + * + * @param e the e + * @param event the event + */ + @Override + public void handleException(Throwable exception, ObjectChangeEvent event) { + MPPDBIDELoggerUtility.error(MessageConfigLoader.getProperty(IMessagesConstants.ERR_GUI_SOURCE_NOT_AVAILABLE), + exception); + ConsoleCoreWindow.getInstance() + .logWarning(MessageConfigLoader.getProperty(IMessagesConstants.ERR_GUI_SOURCE_NOT_AVAILABLE)); + String msg = MessageConfigLoader.getProperty(IMessagesConstants.FUNCT_CHANGE_EXECUTE_ERR) + + exception.getMessage(); + MPPDBIDEDialogs.generateOKMessageDialog(MESSAGEDIALOGTYPE.ERROR, true, + MessageConfigLoader.getProperty(IMessagesConstants.PL_SOURCE_VIEWER_ERROR), msg); + PLSourceEditor srcEditor = event.getEditor(); + srcEditor.setExecuteInProgress(false); + srcEditor.setCompileInProgress(false); + srcEditor.enabledisableTextWidget(true); + } } 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..b6b932908f4c3071b6c2f9698a9704999fad5917 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.DebuggerStartConstants; 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 (null != debugObject) { + Long oid= debugObject.getOid(); + DebuggerStartConstants.getStartInfo(oid).remarLinesStr=""; + } if (debugObject != null) { if (!(UIElement.getInstance().isEditorExistByDbgObj(debugObject))) { try { 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..9204248e4d53e192f167bbe315ab7c2caf2e5a2e 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.ConstantRunLine; /** * Title: class @@ -53,6 +54,7 @@ public class ContinueDebugHandler extends BaseDebugStepHandler { @Override public Optional debugRun() throws SQLException, DebugExitException { + ConstantRunLine.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..0562f48272b883fa14996f5d615655680d027077 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 @@ -15,15 +15,18 @@ package org.opengauss.mppdbide.view.handler.debug; +import java.util.concurrent.CompletableFuture; + import org.eclipse.core.commands.Command; import org.eclipse.core.commands.ParameterizedCommand; import org.eclipse.e4.core.commands.ECommandService; import org.eclipse.e4.core.commands.EHandlerService; 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.ConstantRunLine; 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; @@ -93,6 +96,11 @@ public class DebugHandlerUtils { public void setDebugStart(boolean isDebugStart) { this.isDebugStart = isDebugStart; } + + public void terminateDebug() { + ConstantRunLine.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..73846ae88e263ede02111a9597650c95fa962822 --- /dev/null +++ b/code/datastudio/src/org.opengauss.mppdbide.view/src/org/opengauss/mppdbide/view/handler/debug/DebugHistoryCoverageHandler.java @@ -0,0 +1,88 @@ +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.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; + +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(); + conn.close(); + if (isPldebugger) { + MPPDBIDEDialogs.generateOKMessageDialog(MESSAGEDIALOGTYPE.INFORMATION, true, + "提示", + "该版本不支持此功能!"); + return; + } + } catch (SQLException e) { + e.printStackTrace(); + } finally { + try { + if (null != conn) { + conn.close(); + } + } catch (SQLException e) { + e.printStackTrace(); + } + } + 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(), + server.getServerConnectionInfo().getProfileId()); + 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..1a9e6a975ab1e0573202c91c158c25b47899066a 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.prefernces.PreferenceWrapper; +import org.opengauss.mppdbide.view.service.CoverageServiceFactory; +import org.opengauss.mppdbide.view.vo.CoverageService; /** * 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) { @@ -143,6 +157,11 @@ public class DebugServiceHelper { public QueryService getQueryService() { 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 14ad5dcedd8205fbf1f346740dbea3370d6bc40a..5e9351ac0bf43c2c164f416fe0d47f5cae6ca498 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 @@ -19,6 +19,7 @@ import java.sql.SQLException; import java.util.ArrayList; import java.util.List; import java.util.stream.Collectors; +import java.util.stream.Stream; import org.eclipse.e4.core.di.annotations.CanExecute; import org.eclipse.e4.core.di.annotations.Execute; @@ -29,6 +30,8 @@ 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.debug.DebugConstants; +import org.opengauss.mppdbide.debuger.service.DebugService; import org.opengauss.mppdbide.utils.IMessagesConstants; import org.opengauss.mppdbide.utils.exceptions.DatabaseCriticalException; import org.opengauss.mppdbide.utils.exceptions.DatabaseOperationException; @@ -88,6 +91,11 @@ public class StartDebugHandler { plSourceEditor.setExecuteInProgress(true); debugUtils.showAllDebugView(true); startInputParamDialog(); + PLSourceEditor pl = UIElement.getInstance().getVisibleSourceViewer(); + ObjectParameter[] params = pl.getDebugObject().getObjectParameters(); + long oid = pl.getDebugObject().getOid(); + List paramNames = Stream.of(params).map(item -> item.getName()).distinct().collect(Collectors.toList()); + DebugService.map.put(oid, paramNames); } private void startInputParamDialog() { @@ -142,9 +150,26 @@ public class StartDebugHandler { .getDefaulParametertMap() .get(debugObject.getOid()); debugParams = getDebugParams(serverParams); + StringBuffer buffer=new StringBuffer("("); + int count=0; + for(DefaultParameter a:serverParams) { + if(count!=0) { + buffer.append(","); + } + buffer.append(a.getDefaultParameterName()); + buffer.append(":=?").append(""); + count++; + } + buffer.append(")"); +// DebugConstants.oidSqlMap.put(debugObject.getOid(), buffer.toString()); + } + if (serviceHelper.getDebugService() != null) { + serviceHelper.getDebugService().begin(debugParams); + debugUtils.setDebugStart(true); + } else { + MPPDBIDEDialogs.generateOKMessageDialog(MESSAGEDIALOGTYPE.INFORMATION, true,"提示","please wait for server running!"); + return; } - serviceHelper.getDebugService().begin(debugParams); - debugUtils.setDebugStart(true); } catch (DatabaseCriticalException exception) { UIDisplayFactoryProvider.getUIDisplayStateIf().handleDBCriticalError(exception, debugObject.getDatabase()); return; @@ -157,6 +182,7 @@ public class StartDebugHandler { exception); MPPDBIDEDialogs.generateErrorDialog(MessageConfigLoader.getProperty(IMessagesConstants.PLSQL_ERR), MessageConfigLoader.getProperty(IMessagesConstants.UNKNOWN_INTERNAL_ERR), exception); + MPPDBIDEDialogs.generateOKMessageDialog(MESSAGEDIALOGTYPE.INFORMATION, true,"提示","please wait for server running!"); } } 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..91be62a928562565b3033364ef3b2d58f01867ff 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.DebuggerStartConstants; 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=DebuggerStartConstants.getStartInfo(oid); + debuggerStartInfoVo.ifMakeReport=false; + DebuggerStartConstants.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..a2836e7b32fd0e5601dce36b272abfa0ff3e6c43 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.ConstantRunLine; import org.opengauss.mppdbide.utils.logger.MPPDBIDELoggerUtility; import org.opengauss.mppdbide.view.handler.debug.DebugHandlerUtils; import org.opengauss.mppdbide.view.handler.debug.DebugServiceHelper; @@ -37,6 +39,7 @@ public class ServerExitChain extends IMsgChain { private boolean isResultUpdated = false; private DebugHandlerUtils debugUtils = DebugHandlerUtils.getInstance(); private DebugServiceHelper serviceHelper = DebugServiceHelper.getInstance(); + public DebuggerReportService reportService = DebuggerReportService.getInstance(); @Override public boolean matchMsg(Event event) { @@ -52,6 +55,12 @@ public class ServerExitChain extends IMsgChain { } Display.getDefault().asyncExec(new UpdateDebugPositionTask(-1)); Display.getDefault().asyncExec(new UpdateHighlightLineNumTask()); + reportService.makeReport(); + if (null != ConstantRunLine.isContinue && ConstantRunLine.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..c9a7925d925e5e82c59fea63b39375d6945fa4ff 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 @@ -1,4 +1,4 @@ -/* +/* * Copyright (c) 2022 Huawei Technologies Co.,Ltd. * * openGauss is licensed under Mulan PSL v2. @@ -6,7 +6,7 @@ * You may obtain a copy of Mulan PSL v2 at: * * http://license.coscl.org.cn/MulanPSL2 - * + * * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. @@ -15,9 +15,19 @@ 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.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.ConstantRunLine; +import org.opengauss.mppdbide.utils.DebuggerStartConstants; +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,26 +38,150 @@ import org.opengauss.mppdbide.view.utils.UIElement; * @since 3.0.0 */ public class UpdateDebugPositionTask implements Runnable { - private int showLine = -1; - - public UpdateDebugPositionTask(int showLine) { - this.showLine = showLine; - } - - @Override - public void run() { - PLSourceEditor plSourceEditor = UIElement.getInstance().getVisibleSourceViewer(); - if (plSourceEditor == null) { - return; - } - - plSourceEditor.removeDebugPosition(); - try { - if (showLine >= 0) { - plSourceEditor.createDebugPosition(showLine); - } - } catch (BadLocationException e) { - MPPDBIDELoggerUtility.error("set debugPostion at " + showLine + " failed,err=" + e.getMessage()); - } - } + private int showLine = -1; + + public UpdateDebugPositionTask(int showLine) { + this.showLine = showLine; + ConstantRunLine.passLine.add(showLine); + } + + @Override + public void run() { + PLSourceEditor plSourceEditor = UIElement.getInstance().getVisibleSourceViewer(); + if (plSourceEditor == null) { + return; + } + Boolean isPlDebugger = true; + try { + VersionVo vo = new VersionVo(); + vo.setVersion(plSourceEditor.getDatabase().getServerVersion()); + isPlDebugger = vo.isPldebugger(); + if (isPlDebugger) { + plSourceEditor.removeDebugPosition(); + if (showLine >= 0) { + plSourceEditor.createDebugPosition(showLine); + } + }else { + //dbedebugger + if(ConstantRunLine.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()); + } + } + + public static PLSourceEditor terminateDebug() { + PLSourceEditor plSourceEditor = UIElement.getInstance().getVisibleSourceViewer(); + plSourceEditor.removeDebugPosition(); + long oid = plSourceEditor.getDebugObject().getOid(); + String covs=DebuggerStartConstants.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; + } + + public static void continueDebug() { + try { + Thread.sleep(200); + PLSourceEditor pl = terminateDebug(); + getToatlLineNo(pl).forEach(item-> { + try { + if (ConstantRunLine.runList.contains(String.valueOf(item))) { + pl.createPassPosition(item); + }else { + pl.createFailPosition(item); + } + } catch (BadLocationException e) { + e.printStackTrace(); + } + }); + } catch (Exception e1) { + e1.printStackTrace(); + } + } + + private void remarkBack(PLSourceEditor plSourceEditor) { + long oid = plSourceEditor.getDebugObject().getOid(); + String covs=DebuggerStartConstants.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) { + e.printStackTrace(); + } + } + + private void remark(int line, PLSourceEditor plSourceEditor) { + getToatlLineNo(plSourceEditor).forEach(item-> { + try { + if (item != showLine && ConstantRunLine.passLine.contains(item)) { + plSourceEditor.createPassPosition(item); + }else if(item != showLine){ + plSourceEditor.createFailPosition(item); + } + } catch (BadLocationException e) { + e.printStackTrace(); + } + }); + } + + public static Set getToatlLineNo(PLSourceEditor plSourceEditor){ + Set record = new HashSet<>(); + int begin = -1 ,end = -1;; + try { + String sourceCode = plSourceEditor.getDebugObject().getLatestSouceCode().getCode(); + List total = SourceCodeService.CodeDescription.getLines(sourceCode); + + for(int i=0;i ls =coverageService.getCoverageInfoByOid(oid); + setInput(ls); + } catch (SQLException e) { + e.printStackTrace(); + } finally { + if (null != coverageService) { + coverageService.closeService(); + } + } + } + + 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(PIN_STATUS_COLUMN, String.valueOf(item.totalLineNum)); + row.setText(SQL_QUERY_COLUMN, String.valueOf(item.coverageLineNum)); + row.setText(NUMBER_OF_ROWS_COLUMN, String.valueOf(item.totalPercent)); + row.setText(START_TIME_COLUMN, String.valueOf(item.remarkLinesArr)); + row.setText(ELAPSED_TIME, String.valueOf(item.remarkCoverageLinesArr)); + row.setText(DATABASE_NAME_COLUMN, String.valueOf(item.remarkPercent)); + row.setText(UPDATE_TIME, item.parseDate()); + } + + private void loadQuerytoSQLTerminal() { + String query = null; + StringBuilder sb = new StringBuilder(MPPDBIDEConstants.STRING_BUILDER_CAPACITY); + SQLTerminal terminal = UIElement.getInstance().getTerminal(terminalParentId); + TableItem[] items = table.getSelection(); + for (TableItem t : items) { + query = t.getText(SQL_QUERY_COLUMN); + sb.append(query); + sb.append(EnvirnmentVariableValidator.validateAndGetLineSeperator()); + } + + if (null != terminal) { + terminal.getTerminalCore().setSelectedQuery(sb.toString()); + terminal.resetSQLTerminalButton(); + terminal.resetAutoCommitButton(); + terminal.setModified(true); + terminal.setModifiedAfterCreate(true); + } + } + + public SQLSyntax getSyntax() { + return syntax; + } + + public void setSyntax(SQLSyntax syntax) { + this.syntax = syntax; + } + + public CompositeRuler getCompositeRuler() { + fCompositeRuler = new CompositeRuler(SPACE_BETWEEN_RULER); + fCompositeRuler.addDecorator(1, new LineNumberRulerColumn()); + + return fCompositeRuler; + } + + public void setDocument(IDocument document) { + sourceViewer.setDocument(document); + } + + 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_CLOSE, getClass()); + final Image deleteIcon = IconUtility.getIconImage(IiconPath.DELETE_SELECTED, getClass()); + + final Image deleteallIcon = IconUtility.getIconImage(IiconPath.DELETE_ALL, getClass()); + + saveToolItem = new ToolItem(bar, SWT.PUSH); + saveToolItem.setEnabled(false); + saveToolItem.setImage(sqlcloseIcon); + saveToolItem.setToolTipText(MessageConfigLoader.getProperty(IMessagesConstants.EXPORT_REPORT)); + saveToolItem.addSelectionListener(new ExportCoverageReport()); + + deleteToolItem = new ToolItem(bar, SWT.PUSH); + deleteToolItem.setEnabled(false); + deleteToolItem.setImage(deleteIcon); + deleteToolItem.setToolTipText(MessageConfigLoader.getProperty(IMessagesConstants.DELETE_Coverage)); + deleteToolItem.addSelectionListener(new DeletesqlClass()); + + 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) { + Boolean flag = true; + String html = null; + String serialNum; + for (int index=0; index< items.length; index++) { + TableItem item =items[index]; + List list = getData(item); + serialNum = String.valueOf(index+1); + list.add(0, serialNum); + Map code = new HashMap(); + CoverageVo vo = (CoverageVo)item.getData(); + List codes = SourceCodeService.CodeDescription.getLines(vo.sourceCode); + for (int i =0;i getData(TableItem item) { + 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.parseDate()).collect(Collectors.toList()); + } + + 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) { + 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(Exception e) { + e.printStackTrace(); + } finally { + service[0].closeService(); + } + } + sourceViewer.getDocument().set(""); + } + } + + 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)); + } + } + } + + protected void enablebuttons(boolean value) { + saveToolItem.setEnabled(value); + deleteAllToolItem.setEnabled(value); + deleteToolItem.setEnabled(value); + } +} 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..9916adafe70f60e9331a7b42f5e744eac2e75a3c 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.DebuggerStartConstants; 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= DebuggerStartConstants.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); } } @@ -1361,9 +1377,23 @@ public class PLSourceEditor extends AbstractAutoSaveObject new Position(sourceEditor.getDocument().getLineOffset(line)) ); sourceEditor.goToLineNumber(line); - highlightLine(line); + highlightLine(line); setDebugPositionLine(line); } + + public void createPassPosition(int line) throws BadLocationException { + DebugPassPositionAnnotation annotation = new DebugPassPositionAnnotation(line); + fAnnotationModel.addAnnotation(annotation, + new Position(sourceEditor.getDocument().getLineOffset(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/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..522639b21f22c5c20b2b16f0697aa0bc85e9ca65 --- /dev/null +++ b/code/datastudio/src/org.opengauss.mppdbide.view/src/org/opengauss/mppdbide/view/utils/ExportUtil.java @@ -0,0 +1,101 @@ +package org.opengauss.mppdbide.view.utils; + +import java.io.BufferedWriter; +import java.io.File; +import java.io.FileWriter; +import java.net.URL; +import java.util.List; +import java.util.Map; +import java.util.Set; +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; + +public final class ExportUtil { + + private static String outpath; + private static File file; + + private ExportUtil() { + + } + + public static String getPath() { + return outpath; + } + + public static String exportReport(long oid, String index, Map executeSql,Set remarkLines, Set coveragePassLines, List list, String html) { + try { + URL url = ExportUtil.class.getClassLoader().getResource("exportTemplate.html"); + Document parse; + if (null == html) { + String path = FileLocator.toFileURL(url).getPath().substring(1); + file = new File(path); + outpath = path.substring(0, path.indexOf("/")+1)+oid+"_"+ System.currentTimeMillis()+".html"; + parse = Jsoup.parse(file, "gbk"); + }else { + parse = Jsoup.parse(html); + } + Element data = parse.getElementById("data"); + Element datatr = data.appendElement("tr"); + list.forEach(item -> { + Element td = datatr.appendElement("td"); + td.text(item); + }); + int[] begin=new int[]{-1}, end=new int[]{-1}; + Element excuteSql = parse.getElementById("executeSql"); + List val = executeSql.values().stream().collect(Collectors.toList()); + for(int i=0;i { + Element tr = excuteSql.appendElement("tr"); + if (flag[0]) { + Element td0 = tr.appendElement("td"); + td0.attr("rowspan", val.size()+""); + td0.text(index); + flag[0] = false; + } + Element td = tr.appendElement("td"); + Element td2 = tr.appendElement("td"); + Element div = td.appendElement("div"); + td2.text(v); + if (remarkLines.contains(k.toString())) { + td2.addClass("bac_remark"); + } + if (coveragePassLines.contains((k-1)+"")) { + div.addClass("bac_pass"); + }else if (k> (begin[0]+1) && k< (end[0]+1)) { + div.addClass("bac_fail"); + } + }); + String s = parse.outerHtml(); + return s; + } catch (Exception e) { + e.printStackTrace(); + return e.getMessage(); + } + } + + public static void loadStr(String path,String text_description) throws Exception{ + BufferedWriter bw = new BufferedWriter(new FileWriter(new File(path))); + String[] split = text_description.split(" "); + for (String str : split) { + bw.write(str+"\r\n"); + } + 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..739bbd2b61d09089251c99475cc9897c60a92cd9 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,10 @@ public interface IiconPath { * The ico breakpoint arrow. */ String ICO_BREAKPOINT_ARROW = PRE_DEBUG_PATH + "debugarrows.png"; + + String ICO_EXECUTE_PASS = PRE_DEBUG_PATH + "debug_pass.png"; + + String ICO_EXECUTE_Fail = PRE_DEBUG_PATH + "debug_fail.png"; + + String ICON_REMARK_COVERAGE = "icon-remarkCoverage.png"; } diff --git a/code/datastudio/src/org.opengauss.mppdbide.view/src/org/opengauss/mppdbide/view/vo/CoverageService.java b/code/datastudio/src/org.opengauss.mppdbide.view/src/org/opengauss/mppdbide/view/vo/CoverageService.java new file mode 100644 index 0000000000000000000000000000000000000000..90b1cdd71226bdb6e264f130a15c5072bf0d1ba9 --- /dev/null +++ b/code/datastudio/src/org.opengauss.mppdbide.view/src/org/opengauss/mppdbide/view/vo/CoverageService.java @@ -0,0 +1,168 @@ +package org.opengauss.mppdbide.view.vo; + +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.DebuggerStartConstants; +import org.opengauss.mppdbide.utils.logger.MPPDBIDELoggerUtility; +import org.opengauss.mppdbide.utils.vo.DebuggerEndInfoVo; +import org.opengauss.mppdbide.utils.vo.DebuggerStartInfoVo; + +public class CoverageService implements IService { + + private IConnection conn = null; + + public void setConn(IConnection conn) { + this.conn = conn; + } + + public void setRemarkInfo(long oid, String rowLines) throws SQLException { + DebuggerStartInfoVo startInfo = DebuggerStartConstants.getStartInfo(oid); + startInfo.remarLinesStr = rowLines; + DebuggerStartConstants.setStartInfo(oid, startInfo); + } + + public String getRemarkInfo(long oid) throws SQLException { + DebuggerStartInfoVo startInfo = DebuggerStartConstants.getStartInfo(oid); + return startInfo.remarLinesStr; + } + + 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(coverageVo->{ + List toRunLines=SourceCodeService.CodeDescription.getRunLinesNums(coverageVo.sourceCode); + coverageVo.totalLineNum=toRunLines.size(); + coverageVo.coverageLineNum=coverageVo.getRunList().size(); + coverageVo.coverageLinesArr=coverageVo.getRunList(); + coverageVo.totalPercent=Double.parseDouble(String.format("%.2f", ((double)coverageVo.coverageLineNum* 100 / (double)coverageVo.totalLineNum))) + "%"; + //if not remark + if(coverageVo.remarkLines==null || "".equals(coverageVo.remarkLines)) { + coverageVo.remarkLines=toRunLines.stream().map(String::valueOf).collect(Collectors.joining(",")); + coverageVo.remarkLinesArr=coverageVo.getRemarkList(); + }else { + coverageVo.remarkLinesArr = coverageVo.getRemarkList().stream().map(item -> Integer.parseInt(item) + 1).sorted().map(item-> String.valueOf(item)).collect(Collectors.toList()); + } + coverageVo.remarkLineNum=coverageVo.remarkLinesArr.size(); + coverageVo.remarkCoverageLinesArr=coverageVo.coverageLinesArr.stream().map(item-> Integer.parseInt(item)+1+"").filter(ite -> coverageVo.remarkLinesArr.contains(ite)).collect(Collectors.toList()); + coverageVo.remarkCoverageLineNum=coverageVo.remarkCoverageLinesArr.size(); + coverageVo.remarkPercent=Double.parseDouble(String.format("%.2f", ((double)coverageVo.remarkCoverageLineNum* 100 / (double)coverageVo.remarkLineNum))) + "%"; + }); + return res.stream().sorted(Comparator.comparing(CoverageVo::getEndTime).reversed()).collect(Collectors.toList()); + } catch (SQLException e) { + return new ArrayList(); + } + } + + 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) { + e.printStackTrace(); + } + + List historyList=DebuggerStartConstants.getHistoryList(oid); + historyList=historyList.stream().filter(a->!a.cid.equals(cid)).collect(Collectors.toList()); + DebuggerStartConstants.setHistoryList(oid, historyList); + } + + /*public List getCoverageInfoByOid(long oid) throws SQLException { + String sql = String.format(Locale.ENGLISH, "SELECT * FROM DBE_PLDEBUGGER.coverage_info_get(oid);", oid); + //List vos = queryList(sql, CoverageVo.class); + // --------------------- todo xjp + List vos = new ArrayList(); + String query ="CREATE OR REPLACE PROCEDURE gaussdb.insert_data_linux(param1 INT = 0, param2 CHAR(20),param3 CHAR(20),param4 INT = 0 )\r\n" + + "AS DECLARE \r\n" + + "BEGIN \r\n" + + " INSERT INTO graderecord VALUES(param1,param2,param3,param4);\r\n" + + " param1=1;\r\n" + + " param4=1;\r\n" + + " INSERT INTO graderecord VALUES(param1,param2,param3,param4);\r\n" + + "END;\r\n" + + "/\r\n" + + "/"; + CoverageVo vo1 = new CoverageVo(2,22,40,20,"3,4,5" , "10%", 5, "3,4,5,6" , 5, "3,4,5", "100%", System.currentTimeMillis(),query); + CoverageVo vo2 = new CoverageVo(2,22,40,20,"3,4,5" , "20%", 5, "3,4,5,6" , 5, "3,4,5", "100%", System.currentTimeMillis(),query); + vos.add(vo1); + vos.add(vo2); + // --------------------- + vos.forEach(item -> { + item.coverageLinesArr = Arrays.asList(item.coverageLines.split(",")); + item.remarkLinesArr = Arrays.asList(item.remarkLines.split(",")); + item.coverageLineNum = item.coverageLinesArr.size(); + List codes = SourceCodeService.CodeDescription.getLines(item.sourceCode); + item.totalLineNum = codes.size(); + item.totalPercent = Double.parseDouble(String.format("%.2f", ((double)item.coverageLineNum / (double)item.totalLineNum))) * 100 + "%"; + item.remarkLineNum = item.remarkLinesArr.size(); + item.remarkCoverageLinesArr = item.coverageLinesArr.stream().filter(ite -> item.remarkLinesArr.contains(ite)).collect(Collectors.toList()); + item.remarkCoverageLineNum = item.remarkCoverageLinesArr.size(); + item.remarkPercent = Double.parseDouble(String.format("%.2f", ((double)item.remarkCoverageLineNum / (double)item.remarkLineNum))) * 100 + "%"; + }); + return vos; + }*/ + + /*public void delCoverageInfoByOid(long oid, long cid) throws SQLException { + String sql = String.format(Locale.ENGLISH, "SELECT * FROM DBE_PLDEBUGGER.coverage_info_del(%s,%s);", oid, cid); + //executeSql(sql); + }*/ + + private Boolean executeSql(String sql) throws SQLException { + Boolean flag = false; + try (PreparedStatement ps = conn.getStatement(sql)) { + flag = ps.execute(sql); + } catch (SQLException e) { + throw new SQLException("sql execute exception!"); + } + return flag; + } + + 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/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..36e20b697b9cf7db31f4ae3b28d86ba98d729600 --- /dev/null +++ b/code/datastudio/src/org.opengauss.mppdbide.view/src/org/opengauss/mppdbide/view/vo/CoverageVo.java @@ -0,0 +1,154 @@ +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; + +public class CoverageVo { + + private final SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + + /** + * 存储过程key + */ + @DumpFiled + public long oid; + + /** + * 覆盖率报告key + */ + @DumpFiled + public long cid; + + /** + * 存储过程总行数 + */ + public int totalLineNum; + + /** + * 执行到的语句的数量 + */ + public int coverageLineNum; + + /** + * 执行到的语句行号 + */ + @DumpFiled + public String coverageLines; + + /** + * 执行到的语句行号集合 + */ + public List coverageLinesArr; + + /** + * 总覆盖率 + */ + public String totalPercent; + + /** + * 标记的行数量 + */ + public int remarkLineNum; + + /** + * 标记的行号 + */ + @DumpFiled + public String remarkLines; + + /** + * 标记的行号集合 + */ + public List remarkLinesArr; + + /** + * 标记执行到的行数量 + */ + public int remarkCoverageLineNum; + + /** + * 标志执行到的行号集合 + */ + public List remarkCoverageLinesArr; + + /** + * 标记覆盖率 + */ + public String remarkPercent; + + /** + * 结束时间 + */ + @DumpFiled + public long endTime; + + /** + * 执行语句 + */ + @DumpFiled + public String sourceCode; + + public CoverageVo() { + + } + + public List getRemarkList() { + if (remarkLines==null || "".equals(remarkLines)){ + return new ArrayList(); + }else { + remarkLinesArr =new ArrayList<>(Arrays.asList(remarkLines.split(","))); + } + return remarkLinesArr; + } + + public List getRunList() { + if (coverageLines==null || "".equals(coverageLines)){ + return new ArrayList(); + }else { + coverageLinesArr =new ArrayList<>(Arrays.asList(coverageLines.split(","))); + } + return coverageLinesArr; + } + + public CoverageVo(long cid, + long oid, + int totalLineNum, + int coverageLineNum, + String coverageLines, + String totalPercent, + int remarkLineNum, + String remarkLines, + int remarkCoverageLineNum, + String remarkCoverageLineNo, + String remarkPercent, + long endTime, + String sourceCode) { + this.cid = cid; + this.oid = oid; + this.totalLineNum = totalLineNum; + this.coverageLineNum = coverageLineNum; + this.coverageLines = coverageLines; + this.totalPercent = totalPercent; + this.remarkLineNum = remarkLineNum; + this.remarkLines = remarkLines; + this.remarkCoverageLineNum = remarkCoverageLineNum; + this.remarkPercent = remarkPercent; + this.endTime = endTime; + this.sourceCode = sourceCode; + } + + public String parseDate() { + Date date = new Date(this.endTime); + return df.format(date); + } + + 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..a46a8bd045d9c51e242827d8ab81e8fb1562fe89 --- /dev/null +++ b/code/datastudio/src/org.opengauss.mppdbide.view/src/resources/exportTemplate.html @@ -0,0 +1,69 @@ + + + + + + + + + + + +
ִ
+ + + + + + + + + + + + + + + +
ִִܸǸʱ
+ + + \ No newline at end of file diff --git a/code/datastudio/src/pom.xml b/code/datastudio/src/pom.xml index 86e919eca448f6d80f72188bca70cd0f0c9626a9..09512ab613c9e35e0508f004fcf917045c8b298e 100644 --- a/code/datastudio/src/pom.xml +++ b/code/datastudio/src/pom.xml @@ -27,7 +27,9 @@ 2.6.0 11 - ${env.javafx_home} + D:\project\openGauss\javafx-sdk-17.0.2 + +file:\\\D:\project\openGauss\openjfx.p2-17.0.2 11 @@ -38,7 +40,7 @@ http://${url.ip}${url.port}/eclipse/tools/gef/updates/releases/5.1.0_gef-master_5509/ http://${url.ip}${url.port}/eclipse/efxclipse/updates-released/3.5.0/site/ http://${url.ip}${url.port}/eclipse/releases/2021-12/202112081000/ - https://downloads.efxclipse.bestsolution.at/p2-repos/openjfx-17.0.2/ + diff --git a/code/datastudio/testcode/LLT/org.opengauss.mppdbide.bl.debug.test.fragment/.classpath b/code/datastudio/testcode/LLT/org.opengauss.mppdbide.bl.debug.test.fragment/.classpath index dd5ef3c3c38ee8639fb0e6c5b4d2298f1cb0dd9f..91a0c0be3dde50e0c4cad092ebd16f3247603d60 100644 --- a/code/datastudio/testcode/LLT/org.opengauss.mppdbide.bl.debug.test.fragment/.classpath +++ b/code/datastudio/testcode/LLT/org.opengauss.mppdbide.bl.debug.test.fragment/.classpath @@ -1,6 +1,10 @@ - + + + + + @@ -15,5 +19,5 @@ - + 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..ffeb8fe38d539103011fd7e9042342efc9ea07d0 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 @@ -290,14 +290,14 @@ public class CommonLLTUtils e.printStackTrace(); } - props.setProperty("user", "test"); - props.setProperty("password", "test"); + props.setProperty("user", "gaussdb"); + props.setProperty("password", "Secretpassword@123"); props.setProperty("allowEncodingChanges", "true"); String encoding = System.getProperty("file.encoding"); props.setProperty("characterEncoding", encoding); - props.setProperty("ApplicationName", "MPP IDE"); + props.setProperty("ApplicationName", "Data Studio"); - url = "jdbc:postgresql://127.0.0.1:1234/testDB"; + url = "jdbc:postgresql://192.168.31.120:5432/Gauss"; connection1.setDriver(new IConnectionDriver() { @@ -378,7 +378,7 @@ public class CommonLLTUtils } public static void prepareProxyInfo( - PreparedStatementResultSetHandler preparedstatementHandler) + PreparedStatementResultSetHandler preparedstatementHandler,String...version) { mockCheckDebugSupport(preparedstatementHandler); mockCheckExplainPlanSupport(preparedstatementHandler); @@ -1526,6 +1526,33 @@ public class CommonLLTUtils 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..a465ffd15e2a12b83a5947ba996bb391098cbc74 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..bddd9e35a325364d51016ba13b5e9fdcba94962c 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 @@ -1,4 +1,4 @@ -/* +/* * Copyright (c) 2022 Huawei Technologies Co.,Ltd. * * openGauss is licensed under Mulan PSL v2. @@ -6,7 +6,7 @@ * You may obtain a copy of Mulan PSL v2 at: * * http://license.coscl.org.cn/MulanPSL2 - * + * * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. @@ -19,6 +19,7 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; +import org.opengauss.mppdbide.debuger.service.DebugService; import org.opengauss.mppdbide.debuger.vo.FunctionVo; import com.mockrunner.jdbc.PreparedStatementResultSetHandler; import com.mockrunner.mock.jdbc.MockResultSet; @@ -32,40 +33,79 @@ public class MockDebugServiceHelper { private PreparedStatementResultSetHandler handler; private FunctionVo funcVo; public MockDebugServiceHelper(PreparedStatementResultSetHandler handler, - FunctionVo funcVo) { + FunctionVo funcVo) { this.handler = handler; this.funcVo = funcVo; } - + public void mockVariable(String sql) { String[] variables = new String[] {"name", "varclass", "linenumber", - "isunique", "isconst", "isnotnull", "dtype", - "value"}; + "isunique", "isconst", "isnotnull", "dtype", + "value"}; Object[] oneRow = new Object[] {"v1", "int", new Integer(1), true, false, - true, 22L, 1}; + true, 22L, 1}; + mockOneRow(sql, variables, oneRow); + } + + public void mockDbeVariable(String sql) { + DebugService.map.put(funcVo.oid, Arrays.asList("param1")); + String[] variables = new String[] {"varname", "vartype", "value", "package_name", "isconst"}; + Object[] oneRow = new Object[] {"param1", "int4", "210101", "", false}; mockOneRow(sql, variables, oneRow); } + public void mockDbeInfoCode(String sql) { + String[] breakPointTitle = new String[] {"lineno", "query", "canbreak"}; + Object[] oneRow = new Object[] {1, "AS DECLARE", false}; + Object[] oneRow1 = new Object[] {2, "BEGIN", false}; + Object[] oneRow2 = new Object[] {3, " IF param1 > 100 THEN", false}; + Object[] oneRow3 = new Object[] {4, "END;", false}; + ResultColumnHelper helper = new ResultColumnHelper(breakPointTitle); + helper.addRow(oneRow); + helper.addRow(oneRow1); + helper.addRow(oneRow2); + helper.addRow(oneRow3); + mockHelper(sql, helper); + } + public void mockStack(String sql) { String[] stackColumn = new String[] {"level", "targetname", "func", - "linenumber", "args"}; + "linenumber", "args"}; Object[] oneRowValues = new Object[] {1, funcVo.proname, funcVo.oid, - 1, null}; + 1, null}; + mockOneRow(sql, stackColumn, oneRowValues); + } + + public void mockDbeStack(String sql) { + String[] stackColumn = new String[] {"frameno", "funcname", "lineno", "query", "funcoid"}; + Object[] oneRowValues = new Object[] {0, funcVo.proname, 3, "add_test", funcVo.oid}; mockOneRow(sql, stackColumn, oneRowValues); } public void mockBreakPoint(String sql) { mockPositionOneLine(sql); } - + + public void mockDbeBreakPoint(String sql) { + String[] breakPointTitle = new String[] {"breakpointno", "funcoid", "lineno", "query", "enable"}; + Object[] oneRow = new Object[] {5, funcVo.oid, -1, funcVo.proname, false}; + mockOneRow(sql, breakPointTitle, oneRow); + } + public void mockPositionOneLine(String sql) { String[] breakPointTitle = new String[] {"func", "linenumber", "targetname"}; Object[] oneRow = new Object[] {new Long(funcVo.oid), - new Integer(-1), - funcVo.proname}; - mockOneRow(sql, breakPointTitle, oneRow); + new Integer(-1), + funcVo.proname}; + mockOneRow(sql, breakPointTitle, oneRow); } - + + public void mockDbePositionOneLine(String sql) { + String[] breakPointTitle = new String[] {"funcoid", "funcname", "lineno","query"}; + Object[] oneRow = new Object[] {funcVo.oid, funcVo.proname, 4, "funcVo.proname"}; + mockOneRow(sql, breakPointTitle, oneRow); + } + public void mockAbortDebug(String sql) { mockOneRow(sql, new String[] {"result"}, new Object[] {new Boolean(true)}); } @@ -84,12 +124,18 @@ public class MockDebugServiceHelper { public void mockDebugVersion(String sql) { String[] columns = new String[] {"serverversionstr", "serverversionnum", - "proxyapiver", "serverprocessid"}; + "proxyapiver", "serverprocessid"}; Object[] oneRow = new Object[] {"server_version", new Integer(1), - new Integer(1), new Long(1)}; + new Integer(1), new Long(1)}; mockOneRow(sql, columns, oneRow); } - + + public void mockDbeDebugVersion(String sql) { + String[] columns = new String[] {"version"}; + Object[] oneRow = new Object[] {"(openGauss 3.0.0 build 02c14696) compiled at 2022-04-01 18:29:12 commit 0 last mr release"}; + mockOneRow(sql, columns, oneRow); + } + public void mockFunctionVo(String sql, Object[] args) { String[] columns = new String[] {"oid", "proname", "proretset", "prorettype", "pronargs", "pronargdefaults", @@ -98,17 +144,17 @@ public class MockDebugServiceHelper { "prosrc"}; mockOneRow(sql, columns, args); } - + public void mockSourceCode(String sql, String sourceCode) { mockOneRow(sql, new String[] {"pldbg_get_source"}, new Object[] {sourceCode}); } - + public void mockTotalSourceCode(String sql, int headline, String totlaSourceCode) { mockOneRow(sql, new String[] {"headerlines", "definition"}, new Object[] {new Integer(headline), totlaSourceCode}); } - + private void mockOneRow(String sql, String[] columns, Object[] oneRow) { ResultColumnHelper helper = new ResultColumnHelper(columns); helper.addRow(oneRow); @@ -135,7 +181,7 @@ public class MockDebugServiceHelper { public ResultColumnHelper(List columns) { this.columns = columns; } - + public void addRow(Object[] objRowCol) { addRow(Arrays.asList(objRowCol)); } @@ -144,13 +190,13 @@ public class MockDebugServiceHelper { List newRow = new ArrayList(rowCol); if (rowCol.size() < columns.size()) { for (int i = 0, size = columns.size() - rowCol.size(); - i < size ; i ++) { + i < size ; i ++) { newRow.add(null); } } rows.add(newRow); } - + public void setResultSet(MockResultSet rs) { if (columns == null || columns.size() == 0) { return; @@ -163,7 +209,7 @@ public class MockDebugServiceHelper { } } } - + public static class FunctionDesc { public String proname; public List params; 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..21fddae56b3057a735929be0b3857e07253bfd86 --- /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,241 @@ +/* + * 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.assertFalse; +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.ArrayList; +import java.util.Arrays; +import java.util.List; +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.common.QueryResVoConvertHelper; +import org.opengauss.mppdbide.debuger.debug.DebugState; +import org.opengauss.mppdbide.debuger.debug.DebugConstants.DebugOpt; +import org.opengauss.mppdbide.debuger.debug.DebugState.State; +import org.opengauss.mppdbide.debuger.event.Event; +import org.opengauss.mppdbide.debuger.event.EventHander; +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.WrappedDebugService; +import org.opengauss.mppdbide.debuger.service.chain.PrepareMsgChian; +import org.opengauss.mppdbide.debuger.service.chain.ServerPortMsgChain; +import org.opengauss.mppdbide.debuger.vo.BreakPointListVo; +import org.opengauss.mppdbide.debuger.vo.BreakpointList; +import org.opengauss.mppdbide.debuger.vo.BreakpointVo; +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.debuger.vo.dbe.AttachVo; +import org.opengauss.mppdbide.debuger.vo.dbe.BacktraceVo; +import org.opengauss.mppdbide.debuger.vo.dbe.InfoBreakpointsVo; +import org.opengauss.mppdbide.debuger.vo.dbe.InfoCodeVo; +import org.opengauss.mppdbide.debuger.vo.dbe.ServerInfoVo; +import org.opengauss.mppdbide.debuger.vo.dbe.TurnOnVo; +import org.opengauss.mppdbide.debuger.vo.dbe.VariablesVo; +import org.opengauss.mppdbide.view.handler.debug.DBConnectionProvider; + +/** + * Title: DebugerFunctionTest for use + * + * @since 3.0.0 + */ +public class DbeDebugerTest extends DebugerJdbcTestCaseBase { + + 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 e) { + e.printStackTrace(); + } catch (IllegalArgumentException e) { + e.printStackTrace(); + } catch (IllegalAccessException e) { + e.printStackTrace(); + } + } + + @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() { + CodeDescription baseCode = new CodeDescription("AS DECLARE\\r\\rBEGIN\\r IF param1 > 100 THEN\\r param4=1;\\r \\rEND IF;\\r IF param4 > 100 THEN\\r param4=1;\\r \\rEND IF;\\r IF param2 > 100 THEN\\r param4=2;\\r \\rEND IF;\\r\\rEND;/"); + CodeDescription totalCode = new CodeDescription("CREATE OR REPLACE PROCEDURE gaussdb.insert_777(param1 INT = 0, param2 CHAR(20), param3 CHAR(20), param4 INT = 0)\\nAS DECLARE\\r\\nBEGIN\\r\\n IF param1 > 100 THEN\\r\\n param4=1;\\r\\n END IF;\\r\\n IF param4 > 100 THEN\\r\\n param4=1;\\r\\n END IF;\\r\\n IF param2 > 100 THEN\\r\\n param4=2;\\r\\n END IF;\\r\\nEND;\\n/\\n/"); + debuggerReportService.setBaseCode(baseCode); + 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); + 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(); + assertEquals(versionVo.version, "(openGauss 3.0.0 build 02c14696) compiled at 2022-04-01 18:29:12 commit 0 last mr release"); + } 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..14174a0fdcae9b98ee1acf648e634eb0e0617093 --- /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,9 @@ +package org.opengauss.mppdbide.bl.test.debug.vo; + +import org.opengauss.mppdbide.debuger.annotation.DumpFiled; + +public class BreakPointNoVo { + + @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..ee3a5719c7d58b08e7dfae74be8b476e99c0d35b --- /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,15 @@ +package org.opengauss.mppdbide.bl.test.debug.vo; + +import org.opengauss.mppdbide.debuger.annotation.DumpFiled; + +public class ContinueDebugVo { + + @DumpFiled + public Long funcoid; + @DumpFiled + public String funcname; + @DumpFiled + public int lineno; + @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..559ddbb062496fe08bc7797f65dbf123b2ead0b6 --- /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,9 @@ +package org.opengauss.mppdbide.bl.test.debug.vo; + +import org.opengauss.mppdbide.debuger.annotation.DumpFiled; + +public class DelPointVo { + + @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..bde96876f97522eb25c3d491c3209f10ded7a3d2 --- /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,9 @@ +package org.opengauss.mppdbide.bl.test.debug.vo; + +import org.opengauss.mppdbide.debuger.annotation.DumpFiled; + +public class OidVo { + + @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..b8de19340877ca838c59f3b6e62c7cd52ab23544 --- /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,9 @@ +package org.opengauss.mppdbide.bl.test.debug.vo; + +import org.opengauss.mppdbide.debuger.annotation.DumpFiled; + +public class TurnOffVo { + + @DumpFiled + public Boolean turn_off; +} 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