:debug version

git-svn-id: https://svn.fhem.de/fhem/trunk/fhem@25726 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
betateilchen 2022-02-21 18:26:27 +00:00
parent 389f05f8d2
commit dd0161948e

View File

@ -177,8 +177,8 @@
# done - this ID must be used for statefile # done - this ID must be used for statefile
# done - manual statfile creation must use existing ID for version 0 # done - manual statfile creation must use existing ID for version 0
# done - table fhemstate no longer needed # done - table fhemstate no longer needed
# configdb reorg must delete old statefiles # done - configdb reorg must delete old statefiles
# remove special handling for large readings # done - remove special handling for large readings
# check recovery # check recovery
# #
############################################################################## ##############################################################################
@ -1069,6 +1069,7 @@ sub _cfgDB_Reorg {
_cfgDB_InsertLine($fhem_dbh,$configDB{loaded},"attr configdb lastReorg $ts",-1); _cfgDB_InsertLine($fhem_dbh,$configDB{loaded},"attr configdb lastReorg $ts",-1);
$fhem_dbh->commit(); $fhem_dbh->commit();
$fhem_dbh->disconnect(); $fhem_dbh->disconnect();
_cfgDB_deleteStatefiles();
eval { qx(sqlite3 $cfgDB_filename vacuum) } if($cfgDB_dbtype eq "SQLITE"); eval { qx(sqlite3 $cfgDB_filename vacuum) } if($cfgDB_dbtype eq "SQLITE");
return if(defined($quiet)); return if(defined($quiet));
return " Result after database reorg:\n"._cfgDB_Info(undef); return " Result after database reorg:\n"._cfgDB_Info(undef);
@ -1280,6 +1281,22 @@ sub _cfgDB_deleteRF {
$fhem_dbh2->disconnect(); $fhem_dbh2->disconnect();
} }
sub _cfgDB_deleteStatefiles {
my $filename;
my $fhem_dbh = _cfgDB_Connect;
my $sth = $fhem_dbh->prepare( "SELECT filename FROM fhemb64filesave where filename like '%.fhem.save'" );
$sth->execute();
while ($filename = $sth->fetchrow_array()) {
my $uuid = substr($filename,0,32);
my $found = $fhem_dbh->selectrow_array("SELECT versionuuid FROM fhemversions WHERE versionuuid = '$uuid'");
unless ($uuid eq $found) {
$fhem_dbh->do("delete from fhemb64filesave where filename = '$filename'");
}
}
$fhem_dbh->commit();
$fhem_dbh->disconnect();
}
################################################## ##################################################
# functions used for file handling # functions used for file handling
# called by 98_configdb.pm # called by 98_configdb.pm