(t *testing.T)
| 39 | } |
| 40 | |
| 41 | func TestParseAlterStatementWithAutoIncrement(t *testing.T) { |
| 42 | statements := []string{ |
| 43 | "auto_increment=7", |
| 44 | "auto_increment = 7", |
| 45 | "AUTO_INCREMENT = 71", |
| 46 | "add column t int, change ts ts timestamp, auto_increment=7 engine=innodb", |
| 47 | "add column t int, change ts ts timestamp, auto_increment =7 engine=innodb", |
| 48 | "add column t int, change ts ts timestamp, AUTO_INCREMENT = 7 engine=innodb", |
| 49 | "add column t int, change ts ts timestamp, engine=innodb auto_increment=73425", |
| 50 | } |
| 51 | for _, statement := range statements { |
| 52 | parser := NewAlterTableParser() |
| 53 | err := parser.ParseAlterStatement(statement) |
| 54 | require.NoError(t, err) |
| 55 | require.Equal(t, statement, parser.alterStatementOptions) |
| 56 | require.True(t, parser.IsAutoIncrementDefined()) |
| 57 | } |
| 58 | } |
| 59 | |
| 60 | func TestParseAlterStatementrivialRenames(t *testing.T) { |
| 61 | statement := "add column t int, change ts ts timestamp, CHANGE f `f` float, engine=innodb" |
nothing calls this directly
no test coverage detected
searching dependent graphs…