Skip to content

Commit

Permalink
feat: make odc adapt to OceanBase 4.2 (#541)
Browse files Browse the repository at this point in the history
* feat: make odc apapt to OceanBase 4.2.1

* update submodule

* response to comments
  • Loading branch information
yhilmare authored Oct 18, 2023
1 parent a4df3d8 commit ddbfe24
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 12 deletions.
2 changes: 1 addition & 1 deletion client
Submodule client updated 62 files
+10 −0 config/routes.js
+16 −0 src/common/datasource/index.tsx
+16 −0 src/common/datasource/interface.ts
+16 −0 src/common/datasource/mysql/index.tsx
+16 −0 src/common/datasource/oceanbase/obmysql.ts
+16 −0 src/common/datasource/oceanbase/oboracle.ts
+1 −0 src/common/network/connection.ts
+20 −3 src/component/AddDataSourceDropdown/index.tsx
+52 −7 src/component/ProcedureParam/ExtraOptions.tsx
+1 −0 src/component/SelectDatabase/component.tsx
+83 −33 src/component/Task/AlterDdlTask/DetailContent/index.tsx
+10 −3 src/component/Task/AsyncTask/DetailContent/index.tsx
+16 −0 src/component/Task/CreateModals.tsx
+38 −39 src/component/Task/DataMockerTask/DetailContent/index.tsx
+10 −1 src/component/Task/ResultSetExportTask/DetailContent/index.tsx
+28 −23 src/component/Task/ShadowSyncTask/DetailContent/index.tsx
+45 −36 src/component/Task/component/DataTransferModal/index.tsx
+6 −3 src/component/Task/component/DatabaseSelect/index.tsx
+38 −0 src/component/WindowManager/index.less
+46 −28 src/component/WindowManager/index.tsx
+74 −1 src/locales/must/strings/zh-CN.json
+38 −7 src/page/Datasource/Datasource/NewDatasourceDrawer/Form/ExtraConfig/index.tsx
+16 −0 src/page/Datasource/Datasource/NewDatasourceDrawer/Form/InitScriptItem/index.tsx
+56 −17 src/page/Datasource/Datasource/NewDatasourceDrawer/Form/JDBCParamsItem/index.tsx
+15 −0 src/page/Datasource/Datasource/NewDatasourceDrawer/Form/helper.ts
+23 −6 src/page/Datasource/Datasource/NewDatasourceDrawer/Form/index.tsx
+62 −34 src/page/Gateway/customConnect.ts
+10 −16 src/page/Project/Sensitive/components/SensitiveColumn/components/FormSensitiveColumnDrawer.tsx
+178 −28 src/page/Project/Sensitive/components/SensitiveColumn/components/ManualForm.tsx
+64 −24 src/page/Project/Sensitive/components/SensitiveColumn/components/SacnRule.tsx
+48 −7 src/page/Project/Sensitive/components/SensitiveColumn/components/ScanForm.tsx
+138 −44 src/page/Project/Sensitive/components/SensitiveColumn/index.tsx
+121 −44 src/page/Project/Sensitive/components/SensitiveRule/index.tsx
+32 −12 src/page/Secure/MaskingAlgorithm/components/ViewMaskingAlgorithmDrawer.tsx
+6 −3 src/page/Workspace/SideBar/Manager/index.tsx
+3 −1 src/page/Workspace/SideBar/ResourceTree/Container.tsx
+47 −14 src/page/Workspace/SideBar/ResourceTree/DatabaseSearch/index.tsx
+17 −1 src/page/Workspace/SideBar/ResourceTree/DatabaseTree/Title.tsx
+16 −0 src/page/Workspace/SideBar/ResourceTree/DatabaseTree/index.tsx
+53 −14 src/page/Workspace/SideBar/ResourceTree/DatasourceFilter/index.tsx
+16 −0 src/page/Workspace/SideBar/ResourceTree/SelectPanel/Datasource/StatusIcon.tsx
+2 −4 src/page/Workspace/SideBar/ResourceTree/SelectPanel/Datasource/index.less
+3 −1 src/page/Workspace/SideBar/ResourceTree/SelectPanel/Datasource/index.tsx
+16 −0 src/page/Workspace/SideBar/ResourceTree/SelectPanel/index.tsx
+106 −47 src/page/Workspace/SideBar/ResourceTree/TreeNodeMenu/config/table.tsx
+37 −18 src/page/Workspace/SideBar/ResourceTree/TreeNodeMenu/config/type.tsx
+16 −0 src/page/Workspace/SideBar/ResourceTree/TreeStateStore.tsx
+14 −4 src/page/Workspace/SideBar/ResourceTree/index.tsx
+22 −0 src/page/Workspace/SideBar/ResourceTree/useTreeState.tsx
+35 −18 src/page/Workspace/components/CreateTable/TableIndex/columns.tsx
+16 −0 src/page/Workspace/components/SQLPage/ExecDetail/BasicInfo.tsx
+16 −0 src/page/Workspace/components/SQLPage/ExecDetail/IOStatistics.tsx
+16 −0 src/page/Workspace/components/SQLPage/ExecDetail/TimeStatistics.tsx
+8 −0 src/page/Workspace/components/SQLPage/index.tsx
+1 −0 src/page/Workspace/components/SessionContextWrap/SessionSelect/SessionDropdown/index.less
+119 −64 src/page/Workspace/components/SessionContextWrap/SessionSelect/SessionDropdown/index.tsx
+9 −12 src/page/Workspace/components/SessionContextWrap/SessionSelect/index.tsx
+6 −2 src/page/Workspace/context/WorkspaceStore.tsx
+47 −3 src/page/Workspace/index.tsx
+6 −1 src/store/utils/metaSync/index.ts
+66 −21 src/util/dataSourceParser.ts
+7 −6 src/util/route/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import java.util.ArrayList;
import java.util.List;
import java.util.Locale;
import java.util.Map;

import com.fasterxml.jackson.annotation.JsonAlias;
import com.fasterxml.jackson.annotation.JsonIgnore;
Expand All @@ -44,7 +43,7 @@ public class TraceSpan {
@JsonAlias("logs")
private String logs;
@JsonAlias("tags")
private List<Map<String, Object>> tags;
private List<Object> tags;
@JsonAlias("elapse")
private Long elapseMicroSeconds;
@JsonAlias("parent")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.Collection;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
Expand All @@ -32,6 +33,8 @@

public class FullLinkTraceUtil {

private final static String TRACE_ID_KEY = "log_trace_id";

public static SqlExecTime getFullLinkTraceDetail(Statement statement) throws SQLException {
OceanBaseConnection connection = (OceanBaseConnection) statement.getConnection();
long lastPacketResponseTimestamp =
Expand Down Expand Up @@ -67,8 +70,8 @@ private static SqlExecTime parseSpanList(List<TraceSpan> spanList) {
return v;
});
}
if (traceId == null && parseLogTraceId(span.getTags()) != null) {
traceId = parseLogTraceId(span.getTags());
if (traceId == null) {
traceId = findLogTraceId(span.getTags());
}
span.setNode(Node.from(span.getSpanName()));
if ("com_query_process".equals(span.getSpanName())) {
Expand All @@ -89,13 +92,18 @@ private static SqlExecTime parseSpanList(List<TraceSpan> spanList) {
return execDetail;
}

private static String parseLogTraceId(List<Map<String, Object>> tags) {
if (tags == null) {
private static String findLogTraceId(Object tags) {
if (tags instanceof Map) {
if (((Map<?, ?>) tags).containsKey(TRACE_ID_KEY)) {
return ((Map<?, ?>) tags).get(TRACE_ID_KEY).toString();
}
return null;
}
for (Map<String, Object> tag : tags) {
if (tag.containsKey("log_trace_id")) {
return (String) tag.get("log_trace_id");
} else if (tags instanceof Collection) {
for (Object obj : (Collection<?>) tags) {
String value = findLogTraceId(obj);
if (value != null) {
return value;
}
}
}
return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,8 @@ public String getFlashbackSql(@NonNull ConnectionSession session, List<DBRecycle
}
sqlBuilder.identifier(recycleObject.getObjName()).append(" to before drop");
if (StringUtils.isNotBlank(recycleObject.getNewName())) {
sqlBuilder.append(" rename to ").identifier(recycleObject.getNewName());
sqlBuilder.append(" rename to ").identifier(recycleObject.getSchema())
.append(".").identifier(recycleObject.getNewName());
}
sqlBuilder.append(";\r\n");
}
Expand Down

0 comments on commit ddbfe24

Please sign in to comment.