Unverified Commit 2d4401bf authored by wmtbnbo's avatar wmtbnbo Committed by GitHub

[Fix][metadata] Fix Exception in obtaining SQLDDL of view (#1054)

* [Feature] Update flink1.14 to flink1.14.5

* [Bug] [dlink-flink] Fix the local operation exception caused by the conflict between the CDC package and the Flink clients package

* [Future] [dlink-flink] Update flink1.15 to flink1.15.1

* [Fix][web] Fix StarRocks databases display

* [Fix][web] Fix query exceptions caused by the system's failure to automatically clean up the selected table information when switching data sources
Signed-off-by: 's avatar王沐 <wangmu@haiermoney.com>

* [Fix][metadata] Fix Exception in obtaining SQLDDL of view
Signed-off-by: 's avatar王沐 <wangmu@haiermoney.com>
Signed-off-by: 's avatar王沐 <wangmu@haiermoney.com>
Co-authored-by: 's avatar王沐 <wangmu@haiermoney.com>
parent a387db97
......@@ -387,7 +387,18 @@ public abstract class AbstractJdbcDriver extends AbstractDriver {
preparedStatement = conn.get().prepareStatement(createTableSql);
results = preparedStatement.executeQuery();
if (results.next()) {
createTable = results.getString(getDBQuery().createTableName());
ResultSetMetaData rsmd = results.getMetaData();
int columns = rsmd.getColumnCount();
for (int x = 1; x <= columns; x++) {
if (getDBQuery().createTableName().equals(rsmd.getColumnName(x))) {
createTable = results.getString(getDBQuery().createTableName());
break;
}
if (getDBQuery().createViewName().equals(rsmd.getColumnName(x))) {
createTable = results.getString(getDBQuery().createViewName());
break;
}
}
}
} catch (Exception e) {
e.printStackTrace();
......
......@@ -37,6 +37,11 @@ public abstract class AbstractDBQuery implements IDBQuery {
return "Create Table";
}
@Override
public String createViewName() {
return "Create View";
}
@Override
public String[] columnCustom() {
return null;
......
......@@ -51,6 +51,11 @@ public interface IDBQuery {
*/
String createTableName();
/**
* 建视图语句列名
*/
String createViewName();
/**
* 数据库、模式、组织名称
*/
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment