Skip to content
This repository has been archived by the owner on Aug 21, 2023. It is now read-only.

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
glorv committed Nov 5, 2021
1 parent 68f3bca commit 47a8ae6
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion v4/export/dump.go
Original file line number Diff line number Diff line change
Expand Up @@ -1045,7 +1045,7 @@ func openSQLDB(d *Dumper) error {
// detectServerInfo is an initialization step of Dumper.
func detectServerInfo(d *Dumper) error {
db, conf := d.dbHandle, d.conf
versionStr, err := SelectVersion(db)
versionStr, err := SelectVersion(d.tctx, db)
if err != nil {
conf.ServerInfo = ServerInfoUnknown
return err
Expand Down
2 changes: 1 addition & 1 deletion v4/export/sql.go
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ func ListAllDatabasesTables(tctx *tcontext.Context, db *sql.Conn, databaseNames
}

// SelectVersion gets the version information from the database server
func SelectVersion(ctx tcontext.Context, db *sql.DB) (string, error) {
func SelectVersion(ctx *tcontext.Context, db *sql.DB) (string, error) {
var versionInfo string
const queryTiDB = "SELECT tidb_version();"
tidbRow := db.QueryRowContext(ctx, queryTiDB)
Expand Down
2 changes: 1 addition & 1 deletion v4/export/sql_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ func TestDetectServerInfo(t *testing.T) {
mock.ExpectQuery("SELECT version\\(\\);").WillReturnRows(rows)
}

verStr, err := SelectVersion(*tcontext.Background(), db)
verStr, err := SelectVersion(tcontext.Background(), db)
require.NoError(t, err, comment)

info := ParseServerInfo(tcontext.Background(), verStr)
Expand Down

0 comments on commit 47a8ae6

Please sign in to comment.