@@ -255,7 +255,7 @@ func TestVStreamCopyCompleteFlow(t *testing.T) {
255
255
256
256
numCopyEvents := 3 /*t1,t2,t3*/ * (numInitialRows + 1 /*FieldEvent*/ + 1 /*LastPKEvent*/ + 1 /*TestEvent: Copy Start*/ + 2 /*begin,commit*/ + 3 /* LastPK Completed*/ )
257
257
numCopyEvents += 2 /* GTID + Event after all copy is done */
258
- numCatchupEvents := 3 * 5 /* 2 t1, 1 t2 : BEGIN+FIELD+ROW+GTID+COMMIT */
258
+ numCatchupEvents := 4 * 5 /* 3 t1, 1 t2 : BEGIN+FIELD+ROW+GTID+COMMIT */
259
259
numFastForwardEvents := 5 /*t1:FIELD+ROW*/
260
260
numMisc := 1 /* t2 insert during t1 catchup that comes in t2 copy */
261
261
numReplicateEvents := 2 * 5 /* insert into t1/t2 */ + 6 /* begin/field/2 inserts/gtid/commit */
@@ -398,6 +398,21 @@ func initTables(t *testing.T, tables []string) {
398
398
}
399
399
}
400
400
}
401
+ callbacks ["LASTPK.*t2.*complete" ] = func () {
402
+ ctx := context .Background ()
403
+ idx := 1
404
+ id := numInitialRows + 100
405
+ table := "t1"
406
+ query1 := fmt .Sprintf (insertQuery , table , idx , idx , id , id * idx * 10 )
407
+ queries := []string {
408
+ "begin" ,
409
+ query1 ,
410
+ "commit" ,
411
+ }
412
+ env .Mysqld .ExecuteSuperQueryList (ctx , queries )
413
+ log .Infof ("Position after insert into t1 and t2 after t2 complete: %s" , primaryPosition (t ))
414
+
415
+ }
401
416
positions ["afterInitialInsert" ] = primaryPosition (t )
402
417
}
403
418
@@ -528,6 +543,11 @@ var expectedEvents = []string{
528
543
"type:BEGIN" ,
529
544
"type:LASTPK last_p_k_event:{table_last_p_k:{table_name:\" t2\" } completed:true}" ,
530
545
"type:COMMIT" ,
546
+ "type:BEGIN" ,
547
+ "type:FIELD field_event:{table_name:\" t1\" fields:{name:\" id11\" type:INT32 table:\" t1\" org_table:\" t1\" database:\" vttest\" org_name:\" id11\" column_length:11 charset:63 column_type:\" int(11)\" } fields:{name:\" id12\" type:INT32 table:\" t1\" org_table:\" t1\" database:\" vttest\" org_name:\" id12\" column_length:11 charset:63 column_type:\" int(11)\" } enum_set_string_values:true}" ,
548
+ "type:ROW row_event:{table_name:\" t1\" row_changes:{after:{lengths:3 lengths:4 values:\" 1101100\" }}}" ,
549
+ "type:GTID" ,
550
+ "type:COMMIT" ,
531
551
fmt .Sprintf ("type:OTHER gtid:\" %s t3\" " , copyPhaseStart ),
532
552
"type:BEGIN" ,
533
553
"type:FIELD field_event:{table_name:\" t1\" fields:{name:\" id11\" type:INT32 table:\" t1\" org_table:\" t1\" database:\" vttest\" org_name:\" id11\" column_length:11 charset:63 column_type:\" int(11)\" } fields:{name:\" id12\" type:INT32 table:\" t1\" org_table:\" t1\" database:\" vttest\" org_name:\" id12\" column_length:11 charset:63 column_type:\" int(11)\" } enum_set_string_values:true}" ,
0 commit comments