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 @@ -62,6 +62,7 @@
import org.apache.doris.analysis.SetVar;
import org.apache.doris.analysis.SetVar.SetVarType;
import org.apache.doris.analysis.ShowStmt;
import org.apache.doris.analysis.ShowVariablesStmt;
import org.apache.doris.analysis.SqlParser;
import org.apache.doris.analysis.SqlScanner;
import org.apache.doris.analysis.StatementBase;
Expand Down Expand Up @@ -900,7 +901,8 @@ public void executeByLegacy(TUniqueId queryId) throws Exception {
throw new TException("This is in a transaction, only insert, commit, rollback is acceptable.");
}
SessionVariable sessionVariable = context.getSessionVariable();
if (!(parsedStmt instanceof SetStmt) && !(parsedStmt instanceof UnsetVariableStmt)) {
if (!(parsedStmt instanceof SetStmt) && !(parsedStmt instanceof UnsetVariableStmt)
&& !(parsedStmt instanceof ShowVariablesStmt)) {
sessionVariable.disableNereidsPlannerOnce();
}

Expand Down
9 changes: 8 additions & 1 deletion regression-test/suites/show_p0/test_show_variables.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,12 @@ suite("test_show_variables", "p0") {
result = sql """show variables like "enable_cooldown_replica_affinity%";"""
assertTrue(result[0][1]=="false")
result = sql """set GLOBAL enable_cooldown_replica_affinity=true;"""


sql "set enable_nereids_planner=true"
result = sql "show variables like '%enable_nereids_planner%'"
assertTrue(result[0][1]=="true")

sql "set enable_nereids_planner=false"
result = sql "show variables like '%enable_nereids_planner%'"
assertTrue(result[0][1]=="false")
}