Skip to content

Commit daf39c2

Browse files
committed
sql: revert multiple partial stats requests error to a pgerror
This commit reverts a change in #127836 that changed the error returned when multiple stats are requested at once from a pgerror to a failed assertion. This change caused `GenerateAndCheckRedactedExplainsForPII()` to fail when generating SQL commands for certain explains on partial stats collections with multiple columns, which is unsupported and should be ignored like other pgerrors. Closes: #128848 Release note: None
1 parent 6bae06f commit daf39c2

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

pkg/sql/distsql_plan_stats.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ import (
3535
"github.com/cockroachdb/cockroach/pkg/sql/stats"
3636
"github.com/cockroachdb/cockroach/pkg/sql/stats/bounds"
3737
"github.com/cockroachdb/cockroach/pkg/sql/types"
38+
"github.com/cockroachdb/cockroach/pkg/util/errorutil/unimplemented"
3839
"github.com/cockroachdb/cockroach/pkg/util/log"
3940
"github.com/cockroachdb/errors"
4041
"github.com/cockroachdb/logtags"
@@ -291,7 +292,10 @@ func (dsp *DistSQLPlanner) createPartialStatsPlan(
291292
// Partial stats collections on multiple columns create different plans,
292293
// so we only support one requested stat at a time here.
293294
if len(reqStats) > 1 {
294-
return nil, errors.AssertionFailedf("only one partial statistic can be requested at a time")
295+
return nil, unimplemented.NewWithIssue(
296+
128904,
297+
"cannot process multiple partial statistics requests at once",
298+
)
295299
}
296300

297301
reqStat := reqStats[0]

0 commit comments

Comments
 (0)