Skip to content

Commit

Permalink
sync-diff-inspector: fix rows unclosed (#681)
Browse files Browse the repository at this point in the history
ref #678
  • Loading branch information
Leavrth authored Sep 29, 2022
1 parent 4572996 commit 422258e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pkg/dbutil/table.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,13 @@ func addClusteredAnnotationForPrimaryKey(raw string, replace string) (string, er

func isPKISHandle(ctx context.Context, db QueryExecutor, schemaName string, tableName string) bool {
query := fmt.Sprintf("SELECT _tidb_rowid FROM %s LIMIT 0;", TableName(schemaName, tableName))
_, err := db.QueryContext(ctx, query)
rows, err := db.QueryContext(ctx, query)
if err != nil && strings.Contains(err.Error(), "Unknown column") {
return true
}
if rows != nil {
rows.Close()
}
return false
}

Expand Down

0 comments on commit 422258e

Please sign in to comment.