Skip to content

Commit

Permalink
count_rows_queries
Browse files Browse the repository at this point in the history
  • Loading branch information
BarShauli555 committed Aug 18, 2024
1 parent 2b9cd53 commit 47139a4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion go/logic/inspect.go
Original file line number Diff line number Diff line change
Expand Up @@ -554,7 +554,7 @@ func (this *Inspector) CountTableRows(ctx context.Context) error {
return err
}

query := fmt.Sprintf(`select /* gh-ost */ count(*) as count_rows from %s.%s`, sql.EscapeName(this.migrationContext.DatabaseName), sql.EscapeName(this.migrationContext.OriginalTableName))
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))
var rowsEstimate int64
if err := conn.QueryRowContext(ctx, query).Scan(&rowsEstimate); err != nil {
if errors.Is(err, context.Canceled) || errors.Is(err, context.DeadlineExceeded) {
Expand Down

0 comments on commit 47139a4

Please sign in to comment.