(tblInfo *model.TableInfo, allColInfo []*model.ColumnInfo)
| 631 | } |
| 632 | |
| 633 | func buildHandleColsForExec(tblInfo *model.TableInfo, allColInfo []*model.ColumnInfo) plannerutil.HandleCols { |
| 634 | if !tblInfo.IsCommonHandle { |
| 635 | extraColPos := len(allColInfo) - 1 |
| 636 | intCol := &expression.Column{ |
| 637 | Index: extraColPos, |
| 638 | RetType: types.NewFieldType(mysql.TypeLonglong), |
| 639 | } |
| 640 | return plannerutil.NewIntHandleCols(intCol) |
| 641 | } |
| 642 | tblCols := make([]*expression.Column, len(tblInfo.Columns)) |
| 643 | for i := 0; i < len(tblInfo.Columns); i++ { |
| 644 | c := tblInfo.Columns[i] |
| 645 | tblCols[i] = &expression.Column{ |
| 646 | RetType: &c.FieldType, |
| 647 | ID: c.ID, |
| 648 | } |
| 649 | } |
| 650 | pkIdx := tables.FindPrimaryIndex(tblInfo) |
| 651 | for _, c := range pkIdx.Columns { |
| 652 | for j, colInfo := range allColInfo { |
| 653 | if colInfo.Name.L == c.Name.L { |
| 654 | tblCols[c.Offset].Index = j |
| 655 | } |
| 656 | } |
| 657 | } |
| 658 | return plannerutil.NewCommonHandleCols(tblInfo, pkIdx, tblCols) |
| 659 | } |
| 660 | |
| 661 | func (b *executorBuilder) buildCleanupIndex(v *plannercore.CleanupIndex) exec.Executor { |
| 662 | tblInfo := v.Table.TableInfo |
no test coverage detected