2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-04-30 18:12:28 +00:00

configDB.pm: debug version

git-svn-id: https://svn.fhem.de/fhem/trunk@25844 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
betateilchen 2022-03-15 09:44:09 +00:00
parent ae7e33c0cb
commit 1a13b2b6b8

View File

@ -1290,23 +1290,22 @@ sub _cfgDB_deleteStatefiles {
my $sth = $fhem_dbh->prepare( "SELECT filename FROM fhemb64filesave where filename like '%.fhem.save'" ); my $sth = $fhem_dbh->prepare( "SELECT filename FROM fhemb64filesave where filename like '%.fhem.save'" );
$sth->execute(); $sth->execute();
while ($filename = $sth->fetchrow_array()) { while ($filename = $sth->fetchrow_array()) {
Log 1, "file: >$filename<"; Log 5, "configDB: statefile filename >$filename<";
if (length($filename) > 42) { # malformed filename from postgresql if (length($filename) > 42) { # malformed filename from postgresql
Log 1, "del1 >$filename<"; Log 5, "configDB: statefile del1 >$filename<";
# $fhem_dbh->do("delete from fhemb64filesave where filename = '$filename'"); $fhem_dbh->do("delete from fhemb64filesave where filename = '$filename'");
next; next;
} }
my $uuid = ""; my $uuid = "";
$uuid = substr($filename,0,32); $uuid = substr($filename,0,32);
Log 1, "uuid: >$uuid<"; Log 5, "configDB: statefile uuid: >$uuid<";
my $found = $fhem_dbh->selectrow_array("SELECT versionuuid FROM fhemversions WHERE versionuuid = '$uuid'"); my $found = $fhem_dbh->selectrow_array("SELECT versionuuid FROM fhemversions WHERE versionuuid = '$uuid'");
$found //= 'notfound'; # to prevent perl warning $found //= 'notfound'; # to prevent perl warning
Log 1, "found: >$found<";
$found = substr($found,0,32); $found = substr($found,0,32);
Log 1, "found: >$found<"; Log 5, "configDB: statefile found: >$found<";
unless ($uuid eq $found) { unless ($uuid eq $found) {
Log 1, "del2 >$filename<"; Log 5, "configDB: statefile del2 >$filename<";
# $fhem_dbh->do("delete from fhemb64filesave where filename = '$filename'"); $fhem_dbh->do("delete from fhemb64filesave where filename = '$filename'");
} }
} }
$fhem_dbh->commit(); $fhem_dbh->commit();