[fix](Nereids) fix ShowProcedureStatusCommand sendResultSet (#35355)

This commit is contained in:
zy-kkk
2024-05-24 17:22:07 +08:00
committed by GitHub
parent 639c7ee7fb
commit 88e2753e40
3 changed files with 6 additions and 9 deletions

View File

@ -25,6 +25,7 @@ import org.apache.doris.common.UserException;
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.
@ -95,7 +96,7 @@ public class ShowDbStmt extends ShowStmt {
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();

View File

@ -65,10 +65,8 @@ public class ShowCreateProcedureCommand extends Command implements NoForward {
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

View File

@ -63,10 +63,8 @@ public class ShowProcedureStatusCommand extends Command implements NoForward {
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