Skip to content

Commit

Permalink
test: add a test case to ensure the fix won't break data-index consis…
Browse files Browse the repository at this point in the history
…tency

Signed-off-by: ekexium <[email protected]>
  • Loading branch information
ekexium committed Apr 24, 2024
1 parent 882a912 commit ce71241
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions tests/realtikvtest/pipelineddmltest/pipelineddml_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -735,3 +735,25 @@ func TestRejectUnsupportedTables(t *testing.T) {
tk.MustExec("insert into cached values(1)")
tk.MustQuery("show warnings").CheckContain("Pipelined DML can not be used on cached tables. Fallback to standard mode")
}

func TestOnDupInconsistency(t *testing.T) {
store := realtikvtest.CreateMockStoreAndSetup(t)
tk := testkit.NewTestKit(t, store)
tk.MustExec("use test")
tk.MustExec("set @@tidb_dml_type=bulk")
tk.MustExec("set @@tidb_txn_assertion_level=strict")
tk.MustExec(
"create table tbl_1 ( " +
"col_1 set ( 'Alice','Charlie' )," +
"col_2 set ( 'Alice','Charlie' )," +
"unique key idx_1 ( col_1 ) " +
");",
)
tk.MustExec("insert into tbl_1 values ( 'Alice','Charlie' );")
tk.MustExec("insert into tbl_1 values ( 'Charlie','Alice' );")
tk.MustExec(
"insert ignore into tbl_1 values ( 'Alice', 'Charlie' ) on duplicate key update " +
"col_2 = 'Charlie', col_1 = 'Charlie';",
)
tk.MustExec("admin check table tbl_1;")
}

0 comments on commit ce71241

Please sign in to comment.