| 2712 | } |
| 2713 | |
| 2714 | func buildHandleColsForSplit(tbInfo *model.TableInfo) plannerutil.HandleCols { |
| 2715 | if tbInfo.IsCommonHandle { |
| 2716 | primaryIdx := tables.FindPrimaryIndex(tbInfo) |
| 2717 | tableCols := make([]*expression.Column, len(tbInfo.Columns)) |
| 2718 | for i, col := range tbInfo.Columns { |
| 2719 | tableCols[i] = &expression.Column{ |
| 2720 | ID: col.ID, |
| 2721 | RetType: &col.FieldType, |
| 2722 | } |
| 2723 | } |
| 2724 | for i, pkCol := range primaryIdx.Columns { |
| 2725 | tableCols[pkCol.Offset].Index = i |
| 2726 | } |
| 2727 | return plannerutil.NewCommonHandleCols(tbInfo, primaryIdx, tableCols) |
| 2728 | } |
| 2729 | intCol := &expression.Column{ |
| 2730 | RetType: types.NewFieldType(mysql.TypeLonglong), |
| 2731 | } |
| 2732 | return plannerutil.NewIntHandleCols(intCol) |
| 2733 | } |
| 2734 | |
| 2735 | func (b *executorBuilder) buildDistributeTable(v *plannercore.DistributeTable) exec.Executor { |
| 2736 | base := exec.NewBaseExecutor(b.ctx, v.Schema(), v.ID()) |