@@ -21,6 +21,7 @@ import (
21
21
"fmt"
22
22
"math"
23
23
"net"
24
+ "strings"
24
25
"testing"
25
26
"time"
26
27
@@ -287,6 +288,7 @@ func TestPrimaryStatus(t *testing.T) {
287
288
288
289
db .AddQuery ("SELECT 1" , & sqltypes.Result {})
289
290
db .AddQuery ("SHOW MASTER STATUS" , sqltypes .MakeTestResult (sqltypes .MakeTestFields ("test_field" , "varchar" ), "test_status" ))
291
+ db .AddQuery ("SHOW BINARY LOG STATUS" , sqltypes .MakeTestResult (sqltypes .MakeTestFields ("test_field" , "varchar" ), "test_status" ))
290
292
db .AddQuery ("SELECT @@global.server_uuid" , sqltypes .MakeTestResult (sqltypes .MakeTestFields ("test_field" , "varchar" ), "test_uuid" ))
291
293
292
294
testMysqld := NewMysqld (dbc )
@@ -299,6 +301,7 @@ func TestPrimaryStatus(t *testing.T) {
299
301
assert .EqualValues (t , "test_uuid" , res .ServerUUID )
300
302
301
303
db .AddQuery ("SHOW MASTER STATUS" , & sqltypes.Result {})
304
+ db .AddQuery ("SHOW BINARY LOG STATUS" , & sqltypes.Result {})
302
305
_ , err = testMysqld .PrimaryStatus (ctx )
303
306
assert .ErrorContains (t , err , "no master status" )
304
307
}
@@ -379,6 +382,7 @@ func TestSetReplicationPosition(t *testing.T) {
379
382
380
383
db .AddQuery ("SELECT 1" , & sqltypes.Result {})
381
384
db .AddQuery ("RESET MASTER" , & sqltypes.Result {})
385
+ db .AddQuery ("RESET BINARY LOGS AND GTIDS" , & sqltypes.Result {})
382
386
383
387
testMysqld := NewMysqld (dbc )
384
388
defer testMysqld .Close ()
@@ -409,6 +413,7 @@ func TestSetReplicationSource(t *testing.T) {
409
413
410
414
db .AddQuery ("SELECT 1" , & sqltypes.Result {})
411
415
db .AddQuery ("RESET MASTER" , & sqltypes.Result {})
416
+ db .AddQuery ("RESET BINARY LOGS AND GTIDS" , & sqltypes.Result {})
412
417
db .AddQuery ("STOP REPLICA" , & sqltypes.Result {})
413
418
414
419
testMysqld := NewMysqld (dbc )
@@ -445,10 +450,12 @@ func TestResetReplication(t *testing.T) {
445
450
// We expect this query to be executed
446
451
db .AddQuery ("RESET REPLICA ALL" , & sqltypes.Result {})
447
452
err = testMysqld .ResetReplication (ctx )
448
- assert .ErrorContains (t , err , "RESET MASTER" )
453
+ require .Error (t , err )
454
+ require .True (t , strings .Contains (err .Error (), "RESET MASTER" ) || strings .Contains (err .Error (), "RESET BINARY LOGS AND GTIDS" ))
449
455
450
456
// We expect this query to be executed
451
457
db .AddQuery ("RESET MASTER" , & sqltypes.Result {})
458
+ db .AddQuery ("RESET BINARY LOGS AND GTIDS" , & sqltypes.Result {})
452
459
err = testMysqld .ResetReplication (ctx )
453
460
assert .NoError (t , err )
454
461
}
0 commit comments