Skip to content

Commit

Permalink
fix options only effect with global syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
justfortaste committed Dec 3, 2024
1 parent 843652b commit a1b6b8c
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 12 deletions.
18 changes: 12 additions & 6 deletions fe/fe-core/src/main/java/org/apache/doris/analysis/BackupStmt.java
Original file line number Diff line number Diff line change
Expand Up @@ -167,12 +167,18 @@ protected void analyzeProperties() throws AnalysisException {
copiedProperties.remove(PROP_BACKUP_WORKLOAD_GROUP);
}

if (properties.get(PROP_BACKUP_PRIV) == null
&& properties.get(PROP_BACKUP_CATALOG) == null
&& properties.get(PROP_BACKUP_WORKLOAD_GROUP) == null) {
backupPriv = true;
backupCatalog = true;
backupWorkloadGroup = true;
if (isBackupGlobal()) {
if (properties.get(PROP_BACKUP_PRIV) == null
&& properties.get(PROP_BACKUP_CATALOG) == null
&& properties.get(PROP_BACKUP_WORKLOAD_GROUP) == null) {
backupPriv = true;
backupCatalog = true;
backupWorkloadGroup = true;
}
} else {
backupPriv = false;
backupCatalog = false;
backupWorkloadGroup = false;
}

if (!copiedProperties.isEmpty()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -274,12 +274,18 @@ public void analyzeProperties() throws AnalysisException {
copiedProperties.remove(PROP_RESERVE_WORKLOAD_GROUP);
}

if (!properties.containsKey(PROP_RESERVE_PRIVILEGE)
&& !properties.containsKey(PROP_RESERVE_CATALOG)
&& !properties.containsKey(PROP_RESERVE_WORKLOAD_GROUP)) {
reservePrivilege = true;
reserveCatalog = true;
reserveWorkloadGroup = true;
if (isBackupGlobal()) {
if (!properties.containsKey(PROP_RESERVE_PRIVILEGE)
&& !properties.containsKey(PROP_RESERVE_CATALOG)
&& !properties.containsKey(PROP_RESERVE_WORKLOAD_GROUP)) {
reservePrivilege = true;
reserveCatalog = true;
reserveWorkloadGroup = true;
}
} else {
reservePrivilege = false;
reserveCatalog = false;
reserveWorkloadGroup = false;
}

if (!copiedProperties.isEmpty()) {
Expand Down

0 comments on commit a1b6b8c

Please sign in to comment.