Skip to content

Commit 47139a4

Browse files
committed
count_rows_queries
1 parent 2b9cd53 commit 47139a4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

go/logic/inspect.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -554,7 +554,7 @@ func (this *Inspector) CountTableRows(ctx context.Context) error {
554554
return err
555555
}
556556

557-
query := fmt.Sprintf(`select /* gh-ost */ count(*) as count_rows from %s.%s`, sql.EscapeName(this.migrationContext.DatabaseName), sql.EscapeName(this.migrationContext.OriginalTableName))
557+
query := fmt.Sprintf(`select /* gh-ost */ count(*) as count_rows from information_schema.tables where table_schema="%s" and table_name="%s"`, sql.EscapeName(this.migrationContext.DatabaseName), sql.EscapeName(this.migrationContext.OriginalTableName))
558558
var rowsEstimate int64
559559
if err := conn.QueryRowContext(ctx, query).Scan(&rowsEstimate); err != nil {
560560
if errors.Is(err, context.Canceled) || errors.Is(err, context.DeadlineExceeded) {

0 commit comments

Comments
 (0)