Skip to content

Commit

Permalink
Support check constraint (pingcap#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
CbcWestwolf authored Feb 24, 2023
1 parent e337eed commit 3fd392a
Show file tree
Hide file tree
Showing 24 changed files with 1,345 additions and 74 deletions.
2 changes: 2 additions & 0 deletions ddl/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ go_library(
"cluster.go",
"column.go",
"constant.go",
"constraint.go",
"ddl.go",
"ddl_algorithm.go",
"ddl_api.go",
Expand Down Expand Up @@ -152,6 +153,7 @@ go_test(
"column_modify_test.go",
"column_test.go",
"column_type_change_test.go",
"constraint_test.go",
"db_cache_test.go",
"db_change_failpoints_test.go",
"db_change_test.go",
Expand Down
11 changes: 0 additions & 11 deletions ddl/column_modify_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -704,17 +704,6 @@ func TestTransactionWithWriteOnlyColumn(t *testing.T) {
tk.MustQuery("select a from t1").Check(testkit.Rows("2"))
}

func TestColumnCheck(t *testing.T) {
store := testkit.CreateMockStoreWithSchemaLease(t, columnModifyLease)
tk := testkit.NewTestKit(t, store)
tk.MustExec("use test")
tk.MustExec("drop table if exists column_check")
tk.MustExec("create table column_check (pk int primary key, a int check (a > 1))")
defer tk.MustExec("drop table if exists column_check")
require.Equal(t, uint16(1), tk.Session().GetSessionVars().StmtCtx.WarningCount())
tk.MustQuery("show warnings").Check(testkit.RowsWithSep("|", "Warning|8231|CONSTRAINT CHECK is not supported"))
}

func TestModifyGeneratedColumn(t *testing.T) {
store := testkit.CreateMockStoreWithSchemaLease(t, columnModifyLease)
tk := testkit.NewTestKit(t, store)
Expand Down
Loading

0 comments on commit 3fd392a

Please sign in to comment.