Skip to content

Commit

Permalink
fix case
Browse files Browse the repository at this point in the history
  • Loading branch information
starocean999 committed Nov 5, 2024
1 parent 59a206f commit c3ab6a0
Showing 1 changed file with 18 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4014,22 +4014,26 @@ public LogicalPlan visitShowVariables(ShowVariablesContext ctx) {
} else if (ctx.LOCAL() != null || ctx.SESSION() != null) {
type = SetType.SESSION;
}
if (ctx.wildWhere().LIKE() != null) {
return new ShowVariablesCommand(type, stripQuotes(ctx.wildWhere().STRING_LITERAL().getText()));
} else {
StringBuilder sb = new StringBuilder();
sb.append("select VARIABLE_NAME as Variable_name, VARIABLE_VALUE as Value from ");
sb.append(InternalCatalog.INTERNAL_CATALOG_NAME);
sb.append(".");
sb.append(InfoSchemaDb.DATABASE_NAME);
sb.append(".");
if (type == SetType.GLOBAL) {
sb.append("GLOBAL_VARIABLES ");
if (ctx.wildWhere() != null) {
if (ctx.wildWhere().LIKE() != null) {
return new ShowVariablesCommand(type, stripQuotes(ctx.wildWhere().STRING_LITERAL().getText()));
} else {
sb.append("SESSION_VARIABLES ");
StringBuilder sb = new StringBuilder();
sb.append("select VARIABLE_NAME as Variable_name, VARIABLE_VALUE as Value from ");
sb.append(InternalCatalog.INTERNAL_CATALOG_NAME);
sb.append(".");
sb.append(InfoSchemaDb.DATABASE_NAME);
sb.append(".");
if (type == SetType.GLOBAL) {
sb.append("GLOBAL_VARIABLES ");
} else {
sb.append("SESSION_VARIABLES ");
}
sb.append(getOriginSql(ctx.wildWhere()));
return new NereidsParser().parseSingle(sb.toString());
}
sb.append(getOriginSql(ctx.wildWhere()));
return new NereidsParser().parseSingle(sb.toString());
} else {
return new ShowVariablesCommand(type, null);
}
}

Expand Down

0 comments on commit c3ab6a0

Please sign in to comment.