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

*: support check constraint in tidb | tidb-test=pr/2146 #44104

Merged
merged 18 commits into from
Jun 7, 2023
2 changes: 2 additions & 0 deletions ddl/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ go_library(
"cluster.go",
"column.go",
"constant.go",
"constraint.go",
"ddl.go",
"ddl_algorithm.go",
"ddl_api.go",
Expand Down Expand Up @@ -168,6 +169,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 @@ -705,17 +705,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