code: func (w *worker) addTableIndex(t table.Table, idx *model.IndexInfo, reorgInfo *reorgInfo) error {
  	var err error
  	if tbl, ok := t.(table.PartitionedTable); ok {
  		var finish bool
  		for !finish {
  			p := tbl.GetPartition(reorgInfo.PhysicalTableID)
  			if p == nil {
  				return errors.Errorf("Can not find partition id %d for table %d", reorgInfo.PhysicalTableID, t.Meta().ID)
  			}
  			err = w.addPhysicalTableIndex(p, idx, reorgInfo)
  			if err != nil {
  				break
  			}
  			finish, err = w.updateReorgInfo(tbl, reorgInfo)
  			if err != nil {
  				return errors.Trace(err)
  			}
  		}
  	} else {
  		err = w.addPhysicalTableIndex(t.(table.PhysicalTable), idx, reorgInfo)
  	}
  	return errors.Trace(err)
  }
docs: // addTableIndex handles the add index reorganization state for a table.