Skip to content

Commit

Permalink
Fix DM index error
Browse files Browse the repository at this point in the history
  • Loading branch information
Chat2DB-Pro committed Nov 13, 2023
1 parent 2e31890 commit 9b6b564
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ public Table view(Connection connection, String databaseName, String schemaName,
});
}

private static String INDEX_SQL = "SELECT i.TABLE_NAME, i.INDEX_TYPE, i.INDEX_NAME, i.UNIQUENESS ,c.COLUMN_NAME, c.COLUMN_POSITION, c.DESCEND, cons.CONSTRAINT_TYPE FROM ALL_INDEXES i JOIN ALL_IND_COLUMNS c ON i.INDEX_NAME = c.INDEX_NAME AND i.TABLE_NAME = c.TABLE_NAME AND i.TABLE_OWNER = c.TABLE_OWNER LEFT JOIN ALL_CONSTRAINTS cons ON i.INDEX_NAME = cons.INDEX_NAME AND i.TABLE_NAME = cons.TABLE_NAME AND i.TABLE_OWNER = cons.OWNER WHERE i.TABLE_NAME = '%s' ORDER BY i.INDEX_NAME, c.COLUMN_POSITION;";
private static String INDEX_SQL = "SELECT i.TABLE_NAME, i.INDEX_TYPE, i.INDEX_NAME, i.UNIQUENESS ,c.COLUMN_NAME, c.COLUMN_POSITION, c.DESCEND, cons.CONSTRAINT_TYPE FROM ALL_INDEXES i JOIN ALL_IND_COLUMNS c ON i.INDEX_NAME = c.INDEX_NAME AND i.TABLE_NAME = c.TABLE_NAME AND i.TABLE_OWNER = c.TABLE_OWNER LEFT JOIN ALL_CONSTRAINTS cons ON i.INDEX_NAME = cons.INDEX_NAME AND i.TABLE_NAME = cons.TABLE_NAME AND i.TABLE_OWNER = cons.OWNER WHERE i.TABLE_OWNER = '%s' AND i.TABLE_NAME = '%s' ORDER BY i.INDEX_NAME, c.COLUMN_POSITION;";

@Override
public List<TableIndex> indexes(Connection connection, String databaseName, String schemaName, String tableName) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,7 @@ public DataResult<OperationVO> get(@PathVariable("id") Long id) {
OperationQueryParam param = new OperationQueryParam();
param.setId(id);
param.setUserId(ContextUtils.getUserId());
return operationService.queryExistent(param)
.map(operationWebConverter::dto2vo);
return operationService.queryExistent(param).map(operationWebConverter::dto2vo);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,9 @@ public static Connection getConnection(String url, Properties info, DriverConfig
if (Objects.isNull(driverEntry)) {
driverEntry = getJDBCDriver(driver);
}

try (Connection connection = driverEntry.getDriver().connect(url, info)) {
Connection connection;
try {
connection = driverEntry.getDriver().connect(url, info);
if (Objects.isNull(connection)) {
throw new SQLException(String.format("driver.connect return null , No suitable driver found for url %s", url), SQL_STATE_CODE);

Expand Down

0 comments on commit 9b6b564

Please sign in to comment.