code: func adjustColumnInfoInAddColumn(tblInfo *model.TableInfo, offset int) {
  	oldCols := tblInfo.Columns
  	newCols := make([]*model.ColumnInfo, 0, len(oldCols))
  	newCols = append(newCols, oldCols[:offset]...)
  	newCols = append(newCols, oldCols[len(oldCols)-1])
  	newCols = append(newCols, oldCols[offset:len(oldCols)-1]...)
  	// Adjust column offset.
  	offsetChanged := make(map[int]int)
  	for i := offset + 1; i < len(newCols); i++ {
  		offsetChanged[newCols[i].Offset] = i
  		newCols[i].Offset = i
  	}
  	newCols[offset].Offset = offset
  	// Update index column offset info.
  	// TODO: There may be some corner cases for index column offsets, we may check this later.
  	for _, idx := range tblInfo.Indices {
  		for _, col := range idx.Columns {
  			newOffset, ok := offsetChanged[col.Offset]
  			if ok {
  				col.Offset = newOffset
  			}
  		}
  	}
  	tblInfo.Columns = newCols
  }
docs: // adjustColumnInfoInAddColumn is used to set the correct position of column info when adding column.
  // 1. The added column was append at the end of tblInfo.Columns, due to ddl state was not public then.
  //    It should be moved to the correct position when the ddl state to be changed to public.
  // 2. The offset of column should also to be set to the right value.