Skip to content

Commit fd3890e

Browse files
authored
Merge pull request #68 from databendcloud/fix/extract-row
fix: extract row number
2 parents 49a7015 + 23ade80 commit fd3890e

File tree

4 files changed

+3
-5
lines changed

4 files changed

+3
-5
lines changed

source/mysql.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ func (s *MysqlSource) QueryTableData(threadNum int, conditionSql string) ([][]in
264264
}
265265
s.statsRecorder.RecordMetric(len(result))
266266
stats := s.statsRecorder.Stats(time.Since(startTime))
267-
log.Printf("thread-%d: extract %d rows (%f rows/s)", threadNum, len(result), stats.RowsPerSecondd)
267+
log.Printf("thread-%d: extract %d rows (%f rows/s)", threadNum, len(result)+1, stats.RowsPerSecondd)
268268

269269
return result, columns, nil
270270
}
@@ -283,7 +283,6 @@ func (s *MysqlSource) GetDatabasesAccordingToSourceDbRegex(sourceDatabasePattern
283283
if err != nil {
284284
return nil, err
285285
}
286-
fmt.Println("sourcedatabase pattern", sourceDatabasePattern)
287286
match, err := regexp.MatchString(sourceDatabasePattern, database)
288287
if err != nil {
289288
return nil, err

source/oracle.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ func (p *OracleSource) QueryTableData(threadNum int, conditionSql string) ([][]i
288288
}
289289
p.statsRecorder.RecordMetric(len(result))
290290
stats := p.statsRecorder.Stats(time.Since(startTime))
291-
log.Printf("thread-%d: extract %d rows (%f rows/s)", threadNum, len(result), stats.RowsPerSecondd)
291+
log.Printf("thread-%d: extract %d rows (%f rows/s)", threadNum, len(result)+1, stats.RowsPerSecondd)
292292

293293
return result, columns, nil
294294
}

source/postgres.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ func (p *PostgresSource) QueryTableData(threadNum int, conditionSql string) ([][
285285
}
286286
p.statsRecorder.RecordMetric(len(result))
287287
stats := p.statsRecorder.Stats(time.Since(startTime))
288-
log.Printf("thread-%d: extract %d rows (%f rows/s)", threadNum, len(result), stats.RowsPerSecondd)
288+
log.Printf("thread-%d: extract %d rows (%f rows/s)", threadNum, len(result)+1, stats.RowsPerSecondd)
289289

290290
return result, columns, nil
291291
}

source/sql_server.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,6 @@ func (s *SQLServerSource) GetDatabasesAccordingToSourceDbRegex(sourceDatabasePat
409409
return nil, fmt.Errorf("scanning database name: %w", err)
410410
}
411411

412-
fmt.Println("sourcedatabase pattern:", sourceDatabasePattern)
413412
match, err := regexp.MatchString(sourceDatabasePattern, database)
414413
if err != nil {
415414
return nil, fmt.Errorf("matching pattern: %w", err)

0 commit comments

Comments
 (0)