Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix bug about crash issure when partition created with sub-partition #38390

Closed
wants to merge 1 commit into from
Closed
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: 4 additions & 0 deletions pkg/ccl/partitionccl/partition.go
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,10 @@ func createPartitioningImpl(
cols = append(cols, col)
if string(partBy.Fields[i]) != col.Name {
n := colOffset + len(partBy.Fields)
// if n exceed the number of index column, set it to max number of index column
if n > len(indexDesc.ColumnNames) {
n = indexDesc.ColumnNames
}
return partDesc, fmt.Errorf(
"declared partition columns (%s) do not match first %d columns in index being partitioned (%s)",
partitioningString(), n, strings.Join(indexDesc.ColumnNames[:n], ", "))
Expand Down