Function
isStmtImplemented
(stmt *ast.AlterTableStmt)
Source from the content-addressed store, hash-verified
| 162 | } |
| 163 | |
| 164 | func isStmtImplemented(stmt *ast.AlterTableStmt) bool { |
| 165 | var implemented bool |
| 166 | for _, item := range stmt.Cmds.Items { |
| 167 | switch cmd := item.(type) { |
| 168 | case *ast.AlterTableCmd: |
| 169 | switch cmd.Subtype { |
| 170 | case ast.AT_AddColumn: |
| 171 | implemented = true |
| 172 | case ast.AT_AlterColumnType: |
| 173 | implemented = true |
| 174 | case ast.AT_DropColumn: |
| 175 | implemented = true |
| 176 | case ast.AT_DropNotNull: |
| 177 | implemented = true |
| 178 | case ast.AT_SetNotNull: |
| 179 | implemented = true |
| 180 | } |
| 181 | } |
| 182 | } |
| 183 | return implemented |
| 184 | } |
| 185 | |
| 186 | func (c *Catalog) alterTable(stmt *ast.AlterTableStmt) error { |
| 187 | if !isStmtImplemented(stmt) { |
Tested by
no test coverage detected