Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ddl: make TestDropLastVisibleColumns stable #24790

Merged
merged 6 commits into from
May 20, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 8 additions & 9 deletions ddl/db_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2614,24 +2614,23 @@ func (s *testIntegrationSuite5) TestDropColumnsWithMultiIndex(c *C) {
tk.MustQuery(query).Check(testkit.Rows())
}

func (s *testIntegrationSuite5) TestDropLastVisibleColumn(c *C) {
func (s *testIntegrationSuite5) TestDropLastVisibleColumnOrColumns(c *C) {
config.UpdateGlobal(func(conf *config.Config) {
conf.Experimental.AllowsExpressionIndex = true
zimulala marked this conversation as resolved.
Show resolved Hide resolved
})
tk := testkit.NewTestKit(c, s.store)
tk.MustExec("use test_db")
tk.MustExec("create table t_drop_last_column(x int, key((1+1)))")
defer tk.MustExec("drop table if exists t_drop_last_column")
_, err := tk.Exec("alter table t_drop_last_column drop column x")
c.Assert(err, NotNil)
c.Assert(err.Error(), Equals, "[ddl:1113]A table must have at least 1 column")
}

func (s *testIntegrationSuite5) TestDropLastVisibleColumns(c *C) {
tk := testkit.NewTestKit(c, s.store)
tk.MustExec("use test_db")
// for visible columns
tk.MustExec("create table t_drop_last_columns(x int, y int, key((1+1)))")
defer tk.MustExec("drop table if exists t_drop_last_columns")
_, err := tk.Exec("alter table t_drop_last_columns drop column x, drop column y")
_, err = tk.Exec("alter table t_drop_last_columns drop column x, drop column y")
c.Assert(err, NotNil)
c.Assert(err.Error(), Equals, "[ddl:1113]A table must have at least 1 column")

tk.MustExec("drop table if exists t_drop_last_column, t_drop_last_columns")
}

func (s *testIntegrationSuite7) TestAutoIncrementTableOption(c *C) {
Expand Down