[fix](proc) fix keyword case sensitive issue for stmt show_frontends_disks (#35919)

This commit is contained in:
Yulei-Yang
2024-06-06 19:55:24 +08:00
committed by GitHub
parent a42b06a168
commit 4d5db6fee3
3 changed files with 9 additions and 3 deletions

View File

@ -52,7 +52,7 @@ public class ShowFrontendsStmt extends ShowStmt {
ErrorReport.reportAnalysisException(ErrorCode.ERR_SPECIFIC_ACCESS_DENIED_ERROR, "ADMIN/OPERATOR");
}
if (detail != null && !detail.equals("disks")) {
if (detail != null && !detail.equalsIgnoreCase("disks")) {
throw new AnalysisException("Show frontends with extra info only support show frontends disks");
}
}
@ -62,7 +62,7 @@ public class ShowFrontendsStmt extends ShowStmt {
ShowResultSetMetaData.Builder builder = ShowResultSetMetaData.builder();
ImmutableList<String> titles = FrontendsProcNode.TITLE_NAMES;
if (detail != null && detail.equals("disks")) {
if (detail != null && detail.equalsIgnoreCase("disks")) {
titles = FrontendsProcNode.DISK_TITLE_NAMES;
}
for (String title : titles) {

View File

@ -83,7 +83,7 @@ public class FrontendsProcNode implements ProcNodeInterface {
public static void getFrontendsInfo(Env env, String detailType, List<List<String>> infos) {
if (detailType == null) {
getFrontendsInfo(env, infos);
} else if (detailType.equals("disks")) {
} else if (detailType.equalsIgnoreCase("disks")) {
getFrontendsDiskInfo(env, infos);
}
}

View File

@ -39,4 +39,10 @@ suite("test_frontend") {
result = sql """SHOW FRONTENDS;"""
logger.debug("result:${result}")
}
def res = sql """SHOW FRONTENDS DISKS"""
assertTrue(res.size() != 0)
def res2 = sql """SHOW FRONTENDS Disks"""
assertTrue(res2.size() != 0)
}