Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import org.apache.doris.datasource.InternalCatalog;
import org.apache.doris.qe.ShowResultSetMetaData;

import com.google.common.base.Strings;
import com.google.common.collect.Lists;

// Show database statement.
Expand Down Expand Up @@ -95,7 +96,7 @@ public String toSql() {
if (pattern != null) {
sb.append(" LIKE '").append(pattern).append("'");
}
if (!InternalCatalog.INTERNAL_CATALOG_NAME.equals(catalogName)) {
if (!Strings.isNullOrEmpty(catalogName) && !InternalCatalog.INTERNAL_CATALOG_NAME.equals(catalogName)) {
sb.append(" FROM ").append(catalogName);
}
return sb.toString();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,8 @@ public ShowResultSetMetaData getMetaData() {
public void run(ConnectContext ctx, StmtExecutor executor) throws Exception {
List<List<String>> results = new ArrayList<>();
ctx.getPlSqlOperation().getExec().functions.showCreateProcedure(this.procedureName, results);
if (!results.isEmpty()) {
ShowResultSet commonResultSet = new ShowResultSet(getMetaData(), results);
executor.sendResultSet(commonResultSet);
}
ShowResultSet commonResultSet = new ShowResultSet(getMetaData(), results);
executor.sendResultSet(commonResultSet);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,8 @@ public ShowResultSetMetaData getMetaData() {
public void run(ConnectContext ctx, StmtExecutor executor) throws Exception {
List<List<String>> results = new ArrayList<>();
ctx.getPlSqlOperation().getExec().functions.showProcedure(results);
if (!results.isEmpty()) {
ShowResultSet commonResultSet = new ShowResultSet(getMetaData(), results);
executor.sendResultSet(commonResultSet);
}
ShowResultSet commonResultSet = new ShowResultSet(getMetaData(), results);
executor.sendResultSet(commonResultSet);
}

@Override
Expand Down