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
4 changes: 0 additions & 4 deletions fe/src/main/cup/sql_parser.cup
Original file line number Diff line number Diff line change
Expand Up @@ -2712,10 +2712,6 @@ set_expr_or_default ::=
{:
RESULT = new StringLiteral("ALL");
:}
| ident:name
{:
RESULT = new StringLiteral(name);
:}
| expr:expr
{:
RESULT = expr;
Expand Down
5 changes: 5 additions & 0 deletions fe/src/main/java/org/apache/doris/analysis/SetVar.java
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,11 @@ public void analyze(Analyzer analyzer) throws AnalysisException, UserException {
return;
}

// For the case like "set character_set_client = utf8", we change SlotRef to StringLiteral.
if (value instanceof SlotRef) {
value = new StringLiteral(((SlotRef) value).getColumnName());
}

value.analyze(analyzer);
if (!value.isConstant()) {
throw new AnalysisException("Set statement does't support non-constant expr.");
Expand Down