(cmd *ast.AlterTableCmd)
| 29 | } |
| 30 | |
| 31 | func (table *Table) isExistColumn(cmd *ast.AlterTableCmd) (int, error) { |
| 32 | for i, c := range table.Columns { |
| 33 | if c.Name == *cmd.Name { |
| 34 | return i, nil |
| 35 | } |
| 36 | } |
| 37 | if !cmd.MissingOk { |
| 38 | return -1, sqlerr.ColumnNotFound(table.Rel.Name, *cmd.Name) |
| 39 | } |
| 40 | // Missing column is allowed |
| 41 | return -1, nil |
| 42 | } |
| 43 | |
| 44 | func (c *Catalog) addColumn(table *Table, cmd *ast.AlterTableCmd) error { |
| 45 | for _, c := range table.Columns { |
no test coverage detected