// writeIndexMutation adds index as a mutation and writes the
// descriptor to the DB.
func (mt mutationTest) writeIndexMutation(index string, m csql.DescriptorMutation) {
	tableDesc := mt.desc.GetTable()
	_, i, err := tableDesc.FindIndexByName(index)
	if err != nil {
		mt.Fatal(err)
	}
	idx := tableDesc.Indexes[i]
	tableDesc.Indexes = append(tableDesc.Indexes[:i], tableDesc.Indexes[i+1:]...)
	m.Descriptor_ = &csql.DescriptorMutation_Index{Index: &idx}
	mt.writeMutation(m)
}
// writeColumnMutation adds column as a mutation and writes the
// descriptor to the DB.
func (mt mutationTest) writeColumnMutation(column string, m csql.DescriptorMutation) {
	tableDesc := mt.desc.GetTable()
	_, i, err := tableDesc.FindColumnByName(column)
	if err != nil {
		mt.Fatal(err)
	}
	col := tableDesc.Columns[i]
	tableDesc.Columns = append(tableDesc.Columns[:i], tableDesc.Columns[i+1:]...)
	m.Descriptor_ = &csql.DescriptorMutation_Column{Column: &col}
	mt.writeMutation(m)
}