<div dir="ltr"><div><div>Ungetestet, aber kannst Du mal bitte in BackupCommand->copyTable() die Reihenfolge am Anfang der Funktion so umdrehen:<br><br> protected function copyTable($table, $keyColumn = false) {<br> $columns = join(array_map(function($column) {<br> return $this->sc->quoteIdentifier($column->getName());<br> }, $table->getColumns()), ',');<br><br> $sqlParameters = array();<br> $maxKey = null;<br><br> // set selection range<br> if ($keyColumn) {<br> $sqlMax = 'SELECT MAX(' . $this->tc->quoteIdentifier($keyColumn) . ') ' .<br> 'FROM ' . $this->tc->quoteIdentifier($table->getName());<br> $maxKey = $this->tc->fetchColumn($sqlMax);<br><br> if (isset($maxKey))<br> $sqlParameters[] = $maxKey;<br> }<br> else {<br> // clear target table<br> $this->truncateTable($this->tc, $table);<br> }<br><br> echo($table->getName() . ": copying ");<br> // count selection range<br> $sqlCount = 'SELECT COUNT(1) FROM (' . $this->sc->quoteIdentifier($table->getName()) . ')';<br> if ($keyColumn && isset($maxKey)) {<br> $sqlCount .= ' WHERE ' . $this->sc->quoteIdentifier($keyColumn) . ' > ?';<br> }<br> $totalRows = $this->sc->fetchColumn($sqlCount, $sqlParameters);<br> echo($totalRows . " rows (" . (($keyColumn) ? 'partial copy' : 'overwrite') . ")\n");<br><br></div>Viele Grüße,<br></div>Andreas<br><br></div><div class="gmail_extra"><br><div class="gmail_quote">2016-08-19 9:21 GMT+02:00 Sirko <span dir="ltr"><<a href="mailto:mail_ist@nurfuerspam.de" target="_blank">mail_ist@nurfuerspam.de</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000">
Hi Andreas,<br>
<br>
ich hab gestern mal den Volkszähler und Composer usw. aktualisiert,
incl. DBCopy. (Laut git pull alles up-to-date)<br>
Seit dem geht die Fortschrittsanzeige nicht mehr richtig, obwohl die
Datensätze offenbar korrekt übertragen werden.<br>
<br>
<b>Vorher:</b><br>
Start DBCopy...<br>
entities: copying 24 rows (overwrite)<br>
[>---------------------------<wbr>] 0% 1 sec/1 sec 0 rows<br>
[============================<wbr>] 100% 1 sec/1 sec 24 rows<br>
<br>
properties: copying 185 rows (overwrite)<br>
[>---------------------------<wbr>] 0% 1 sec/1 sec 0 rows<br>
[============================<wbr>] 100% 1 sec/1 sec 185 rows<br>
<br>
entities_in_aggregator: copying 4 rows (overwrite)<br>
[>---------------------------<wbr>] 0% 1 sec/1 sec 0 rowsPHP
Warning: Division by zero in
/var/www/<a href="http://volkszaehler.org/vendor/symfony/console/Symfony/Component/Console/Helper/ProgressBar.php" target="_blank">volkszaehler.org/<wbr>vendor/symfony/console/<wbr>Symfony/Component/Console/<wbr>Helper/ProgressBar.php</a>
on line 400<br>
PHP Warning: Division by zero in
/var/www/<a href="http://volkszaehler.org/vendor/symfony/console/Symfony/Component/Console/Helper/ProgressBar.php" target="_blank">volkszaehler.org/<wbr>vendor/symfony/console/<wbr>Symfony/Component/Console/<wbr>Helper/ProgressBar.php</a>
on line 401<br>
<br>
[============================<wbr>] 100% 1 sec/1 sec 4 rows<br>
<br>
data: <b>copying 14006 rows </b>(partial copy)<br>
[>---------------------------<wbr>] 0% 1 sec/1 sec 0 rows<br>
[=>--------------------------<wbr>] 4% 2 secs/40 secs 700 rows<br>
[==>-------------------------<wbr>] 9% 5 secs/50 secs 1400 rows<br>
[====>-----------------------<wbr>] 14% 7 secs/47 secs 2100 rows<br>
[=====>----------------------<wbr>] 19% 9 secs/45 secs 2800 rows<br>
[======>---------------------<wbr>] 24% 11 secs/44 secs 3500 rows<br>
[========>-------------------<wbr>] 29% 13 secs/43 secs 4200 rows<br>
[=========>------------------<wbr>] 34% 15 secs/43 secs 4900 rows<br>
[===========>----------------<wbr>] 39% 17 secs/43 secs 5600 rows<br>
[============>---------------<wbr>] 44% 19 secs/42 secs 6300 rows<br>
[=============>--------------<wbr>] 49% 21 secs/42 secs 7000 rows<br>
[===============>------------<wbr>] 54% 23 secs/42 secs 7700 rows<br>
[================>-----------<wbr>] 59% 25 secs/42 secs 8400 rows<br>
[==================>---------<wbr>] 64% 27 secs/42 secs 9100 rows<br>
[===================>--------<wbr>] 69% 29 secs/41 secs 9800 rows<br>
[====================>-------<wbr>] 74% 31 secs/41 secs 10500 rows<br>
[======================>-----<wbr>] 79% 34 secs/43 secs 11200 rows<br>
[=======================>----<wbr>] 84% 36 secs/42 secs 11900 rows<br>
[=========================>--<wbr>] 89% 38 secs/42 secs 12600 rows<br>
[==========================>-<wbr>] 94% 40 secs/42 secs 13300 rows<br>
[===========================><wbr>] 99% 42 secs/42 secs 14000 rows<br>
[============================<wbr>] 100% 42 secs/42 secs 14006 rows<br>
[============================<wbr>] 100% 42 secs/42 secs 14007 rows<br>
[============================<wbr>] 100% 42 secs/42 secs 14008 rows<br>
[============================<wbr>] 100% 42 secs/42 secs 14009 rows<br>
[============================<wbr>] 100% 42 secs/42 secs 14010 rows<br>
[============================<wbr>] 100% 42 secs/42 secs 14011 rows<br>
[============================<wbr>] 100% 42 secs/42 secs 14012 rows<br>
[============================<wbr>] 100% 42 secs/42 secs 14013 rows<br>
<br>
aggregate: skipping<br>
...<br>
<br>
<b>Jetzt:</b><br>
Start DBCopy...<br>
entities: copying 24 rows (overwrite)<br>
[>---------------------------<wbr>] 0% < 1 sec/< 1 sec 0
rows<br>
[============================<wbr>] 100% < 1 sec/< 1 sec 24 rows<br>
<br>
properties: copying 185 rows (overwrite)<br>
[>---------------------------<wbr>] 0% < 1 sec/< 1 sec 0
rows<br>
[============================<wbr>] 100% < 1 sec/< 1 sec 185
rows<br>
<br>
entities_in_aggregator: copying 4 rows (overwrite)<br>
[>---------------------------<wbr>] 0% < 1 sec/< 1 sec 0
rows<br>
[============================<wbr>] 100% < 1 sec/< 1 sec 4 rows<br>
<br>
data: <b>copying 16153996 rows</b> (partial copy)<br>
[>---------------------------<wbr>] 0% < 1 sec/< 1
sec 0 rows<br>
[============================<wbr>] <b>100% < 1 sec/< 1 sec
16153996 rows</b><br>
<br>
aggregate: skipping<br>
<br>
Das DBCopy tut so, als wöllte es 16 Mio Zeilen kopieren, kopiert
aber wirklich nur die fehlenden Zeilen in wie üblich ein paar
Sekunden.<br>
Am Ende scheint es zu funktionieren, hat mich nur erschreckt ;-)<br>
<br>
Grüße<span class="HOEnZb"><font color="#888888"><br>
Sirko<br>
</font></span></div>
</blockquote></div><br></div>