MCPcopy Create free account
hub / github.com/apecloud/myduckserver / assertWarning

Function assertWarning

binlogreplication/binlog_replication_test.go:613–621  ·  view source on GitHub ↗

assertWarning asserts that the specified |database| has a warning with |code| and |message|, otherwise it will fail the current test.

(t *testing.T, database *sqlx.DB, code int, message string)

Source from the content-addressed store, hash-verified

611// assertWarning asserts that the specified |database| has a warning with |code| and |message|,
612// otherwise it will fail the current test.
613func assertWarning(t *testing.T, database *sqlx.DB, code int, message string) {
614 rows, err := database.Queryx("SHOW WARNINGS;")
615 require.NoError(t, err)
616 warning := convertMapScanResultToStrings(readNextRow(t, rows))
617 require.Equal(t, strconv.Itoa(code), warning["Code"])
618 require.Equal(t, message, warning["Message"])
619 require.False(t, rows.Next())
620 require.NoError(t, rows.Close())
621}
622
623func queryGtid(t *testing.T, database *sqlx.DB) string {
624 gtidEnabled := getGtidEnabled()

Callers 2

TestStartReplicaErrorsFunction · 0.85
TestStopReplicaFunction · 0.85

Calls 4

readNextRowFunction · 0.85
CloseMethod · 0.65
NextMethod · 0.45

Tested by

no test coverage detected