Skip to content

Commit 7e06ab2

Browse files
committed
add test TestSnapshotWithConcurrentWrite
Signed-off-by: you06 <[email protected]>
1 parent 8b1e1ce commit 7e06ab2

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

executor/union_scan_test.go

+15
Original file line numberDiff line numberDiff line change
@@ -595,6 +595,21 @@ func TestIssue36903(t *testing.T) {
595595
tk.MustQuery("select pkey from t_vwvgdc where 0 <> 0 union select pkey from t_vwvgdc;").Sort().Check(testkit.Rows("15000", "228000"))
596596
}
597597

598+
func TestSnapshotWithConcurrentWrite(t *testing.T) {
599+
store := testkit.CreateMockStore(t)
600+
tk := testkit.NewTestKit(t, store)
601+
tk.MustExec("use test")
602+
tk.MustExec("create table t1 (id int auto_increment key, b int, index(b));")
603+
604+
tk.MustExec("begin")
605+
tk.MustExec("insert into t1 (b) values (1),(2),(3),(4),(5),(6),(7),(8);")
606+
for j := 0; j < 16; j++ {
607+
tk.MustExec("insert into t1 (b) select /*+ use_index(t1, b) */ id from t1;")
608+
}
609+
tk.MustQuery("select count(1) from t1").Check(testkit.Rows("524288")) // 8 * 2^16 rows
610+
tk.MustExec("rollback")
611+
}
612+
598613
func BenchmarkUnionScanRead(b *testing.B) {
599614
store := testkit.CreateMockStore(b)
600615

0 commit comments

Comments
 (0)