Skip to content

Commit b81f3de

Browse files
committed
sql: Fix crash inside crdb_internal.tenant_span_stats
Previously, crdb_internal.tenant_span_stats would crash if the number of arguments were incorrect. This patch, adds a check for the parameter count. Fixes: cockroachdb#99182 Release note: None
1 parent 657455e commit b81f3de

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pkg/sql/sem/builtins/generator_builtins.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3314,7 +3314,7 @@ func makeSpanStatsGenerator(
33143314
spans := make([]roachpb.Span, 0, argSpans.Len())
33153315
for _, span := range argSpans.Array {
33163316
s := tree.MustBeDTuple(span)
3317-
if s.D[0] == tree.DNull || s.D[1] == tree.DNull {
3317+
if len(s.D) != 2 || s.D[0] == tree.DNull || s.D[1] == tree.DNull {
33183318
continue
33193319
}
33203320
startKey := roachpb.Key(tree.MustBeDBytes(s.D[0]))

0 commit comments

Comments
 (0)