Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitbfca726

Browse files
authored
Print a warning when the number of rows dumped does not match the expected count (#85)
1 parent979d73c commitbfca726

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

‎src/Webfactory/Slimdump/Database/Dumper.php‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,7 @@ public function dumpData($table, Table $tableConfig, Connection $db, bool $noPro
183183
/** @var PDOConnection $wrappedConnection */
184184
$wrappedConnection =$db->getWrappedConnection();
185185
$wrappedConnection->setAttribute(PDO::MYSQL_ATTR_USE_BUFFERED_QUERY,false);
186+
$actualRows =0;
186187

187188
foreach ($db->query($s)as$row) {
188189
$b =$this->rowLengthEstimate($row);
@@ -222,6 +223,8 @@ public function dumpData($table, Table $tableConfig, Connection $db, bool $noPro
222223
if (null !==$progress) {
223224
$progress->advance();
224225
}
226+
227+
++$actualRows;
225228
}
226229

227230
if (null !==$progress) {
@@ -232,6 +235,10 @@ public function dumpData($table, Table $tableConfig, Connection $db, bool $noPro
232235
}
233236
}
234237

238+
if ($actualRows !==$numRows) {
239+
$this->output->getErrorOutput()->writeln(sprintf('<error>Expected %d rows, actually processed %d – verify results!</error>',$numRows,$actualRows));
240+
}
241+
235242
$wrappedConnection->setAttribute(PDO::MYSQL_ATTR_USE_BUFFERED_QUERY,true);
236243

237244
if ($bufferSize) {

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp