Skip to content

Commit 2f77051

Browse files
authored
[bugfix](workloadgroup) add strip quotes for workload group name in related command (apache#56084)
### What problem does this PR solve? mysql> CREATE WORKLOAD GROUP 'test_follower_consistent_wg' -> PROPERTIES ( -> "min_cpu_percent"="10" -> ); Query OK, 0 rows affected (0.00 sec) drop WORKLOAD GROUP if exists 'test_follower_consistent_wg' ; Could not find workload group, because not stip quotes. ### Release note None ### Check List (For Author) - Test <!-- At least one of them must be included. --> - [ ] Regression test - [ ] Unit Test - [ ] Manual test (add detailed scripts or steps below) - [ ] No need to test or manual test. Explain why: - [ ] This is a refactor/code format and no logic has been changed. - [ ] Previous test can cover this change. - [ ] No code files have been changed. - [ ] Other reason <!-- Add your reason? --> - Behavior changed: - [ ] No. - [ ] Yes. <!-- Explain the behavior change --> - Does this need documentation? - [ ] No. - [ ] Yes. <!-- Add document PR link here. eg: apache/doris-website#1214 --> ### Check List (For Reviewer who merge this PR) - [ ] Confirm the release note - [ ] Confirm test cases - [ ] Confirm document - [ ] Add branch pick label <!-- Add branch pick label that this PR should merge into -->
1 parent ce71c34 commit 2f77051

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

fe/fe-core/src/main/java/org/apache/doris/nereids/parser/LogicalPlanBuilder.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6233,14 +6233,14 @@ public LogicalPlan visitAlterWorkloadGroup(AlterWorkloadGroupContext ctx) {
62336233
String cgName = ctx.computeGroup == null ? "" : stripQuotes(ctx.computeGroup.getText());
62346234
Map<String, String> properties = ctx.propertyClause() != null
62356235
? Maps.newHashMap(visitPropertyClause(ctx.propertyClause())) : Maps.newHashMap();
6236-
return new AlterWorkloadGroupCommand(cgName, ctx.name.getText(), properties);
6236+
return new AlterWorkloadGroupCommand(cgName, stripQuotes(ctx.name.getText()), properties);
62376237
}
62386238

62396239
@Override
62406240
public LogicalPlan visitAlterWorkloadPolicy(AlterWorkloadPolicyContext ctx) {
62416241
Map<String, String> properties = ctx.propertyClause() != null
62426242
? Maps.newHashMap(visitPropertyClause(ctx.propertyClause())) : Maps.newHashMap();
6243-
return new AlterWorkloadPolicyCommand(ctx.name.getText(), properties);
6243+
return new AlterWorkloadPolicyCommand(stripQuotes(ctx.name.getText()), properties);
62446244
}
62456245

62466246
@Override
@@ -6713,12 +6713,12 @@ public LogicalPlan visitDropUser(DropUserContext ctx) {
67136713
@Override
67146714
public LogicalPlan visitDropWorkloadGroup(DropWorkloadGroupContext ctx) {
67156715
String cgName = ctx.computeGroup == null ? "" : stripQuotes(ctx.computeGroup.getText());
6716-
return new DropWorkloadGroupCommand(cgName, ctx.name.getText(), ctx.EXISTS() != null);
6716+
return new DropWorkloadGroupCommand(cgName, stripQuotes(ctx.name.getText()), ctx.EXISTS() != null);
67176717
}
67186718

67196719
@Override
67206720
public LogicalPlan visitDropWorkloadPolicy(DropWorkloadPolicyContext ctx) {
6721-
return new DropWorkloadPolicyCommand(ctx.name.getText(), ctx.EXISTS() != null);
6721+
return new DropWorkloadPolicyCommand(stripQuotes(ctx.name.getText()), ctx.EXISTS() != null);
67226722
}
67236723

67246724
@Override
@@ -7428,7 +7428,7 @@ public Plan visitUnlockTables(UnlockTablesContext ctx) {
74287428

74297429
@Override
74307430
public LogicalPlan visitCreateWorkloadPolicy(CreateWorkloadPolicyContext ctx) {
7431-
String policyName = ctx.name.getText();
7431+
String policyName = stripQuotes(ctx.name.getText());
74327432
boolean ifNotExists = ctx.IF() != null;
74337433

74347434
List<WorkloadConditionMeta> conditions = new ArrayList<>();

0 commit comments

Comments
 (0)