MCPcopy Index your code
hub / github.com/github/gh-ost / TestParseAlterStatementWithAutoIncrement

Function TestParseAlterStatementWithAutoIncrement

go/sql/parser_test.go:41–58  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

39}
40
41func 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
60func TestParseAlterStatementrivialRenames(t *testing.T) {
61 statement := "add column t int, change ts ts timestamp, CHANGE f `f` float, engine=innodb"

Callers

nothing calls this directly

Calls 3

ParseAlterStatementMethod · 0.95
NewAlterTableParserFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…