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)
| 611 | // assertWarning asserts that the specified |database| has a warning with |code| and |message|, |
| 612 | // otherwise it will fail the current test. |
| 613 | func 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 | |
| 623 | func queryGtid(t *testing.T, database *sqlx.DB) string { |
| 624 | gtidEnabled := getGtidEnabled() |
no test coverage detected