mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-04-15 22:26:04 +00:00
93_DbRep: SQL syntax for Postgre maxValue deleteOther Forum:#134170
git-svn-id: https://svn.fhem.de/fhem/trunk@27726 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
8c3eba47e7
commit
b5e827f1a7
@ -1,5 +1,6 @@
|
|||||||
# Add changes at the top of the list. Keep it in ASCII, and 80-char wide.
|
# Add changes at the top of the list. Keep it in ASCII, and 80-char wide.
|
||||||
# Do not insert empty lines here, update check depends on it.
|
# Do not insert empty lines here, update check depends on it.
|
||||||
|
- bugfix: 93_DbRep: SQL syntax for Postgre maxValue deleteOther Forum:#134170
|
||||||
- bugfix: 93_DbRep: fix check of DbRep_afterproc, DbRep_beforeproc if should
|
- bugfix: 93_DbRep: fix check of DbRep_afterproc, DbRep_beforeproc if should
|
||||||
exec PERL code
|
exec PERL code
|
||||||
- bugfix : 74_AutomowerConnect: Common.pm fixed bug in WS filter
|
- bugfix : 74_AutomowerConnect: Common.pm fixed bug in WS filter
|
||||||
|
@ -59,6 +59,7 @@ no if $] >= 5.017011, warnings => 'experimental::smartmatch';
|
|||||||
|
|
||||||
# Version History intern
|
# Version History intern
|
||||||
my %DbRep_vNotesIntern = (
|
my %DbRep_vNotesIntern = (
|
||||||
|
"8.52.9" => "05.07.2023 fix wrong SQL syntax for PostgreSQL -> maxValue deleteOther, Forum:#134170 ",
|
||||||
"8.52.8" => "28.06.2023 fix check of DbRep_afterproc, DbRep_beforeproc if should exec PERL code ",
|
"8.52.8" => "28.06.2023 fix check of DbRep_afterproc, DbRep_beforeproc if should exec PERL code ",
|
||||||
"8.52.7" => "16.05.2023 DbRep_afterproc, DbRep_beforeproc can execute FHEM commands as well as PERL code ",
|
"8.52.7" => "16.05.2023 DbRep_afterproc, DbRep_beforeproc can execute FHEM commands as well as PERL code ",
|
||||||
"8.52.6" => "11.04.2023 change diffValue for aggr month ",
|
"8.52.6" => "11.04.2023 change diffValue for aggr month ",
|
||||||
@ -13700,11 +13701,11 @@ sub DbRep_deleteOtherFromDB {
|
|||||||
my ($dbh,$sth,$timestamp,$value,$addon,$row_extreme_time,$runtime_string_first,$runtime_string_next);
|
my ($dbh,$sth,$timestamp,$value,$addon,$row_extreme_time,$runtime_string_first,$runtime_string_next);
|
||||||
my @row_array;
|
my @row_array;
|
||||||
|
|
||||||
my %rh = split("§", $rows);
|
my %rh = split "§", $rows;
|
||||||
|
|
||||||
for my $key (sort(keys(%rh))) {
|
for my $key (sort(keys(%rh))) {
|
||||||
# Inhalt $rh{$key} -> $runtime_string."|".$max_value."|".$row_max_time."|".$runtime_string_first."|".$runtime_string_next
|
# Inhalt $rh{$key} -> $runtime_string."|".$max_value."|".$row_max_time."|".$runtime_string_first."|".$runtime_string_next
|
||||||
my @k = split("\\|",$rh{$key});
|
my @k = split "\\|", $rh{$key};
|
||||||
$value = $k[1] // undef;
|
$value = $k[1] // undef;
|
||||||
$row_extreme_time = $k[2];
|
$row_extreme_time = $k[2];
|
||||||
$runtime_string_first = $k[3];
|
$runtime_string_first = $k[3];
|
||||||
@ -13728,7 +13729,7 @@ sub DbRep_deleteOtherFromDB {
|
|||||||
my $dlines = 0;
|
my $dlines = 0;
|
||||||
|
|
||||||
for my $row (@row_array) {
|
for my $row (@row_array) {
|
||||||
my @a = split("\\|",$row);
|
my @a = split "\\|", $row;
|
||||||
$device = $a[0];
|
$device = $a[0];
|
||||||
$reading = $a[1];
|
$reading = $a[1];
|
||||||
$value = $a[2];
|
$value = $a[2];
|
||||||
@ -13738,8 +13739,8 @@ sub DbRep_deleteOtherFromDB {
|
|||||||
|
|
||||||
my($date, $time) = split "_", $row_extreme_time;
|
my($date, $time) = split "_", $row_extreme_time;
|
||||||
$time =~ s/-/:/gxs;
|
$time =~ s/-/:/gxs;
|
||||||
$addon = qq{AND (TIMESTAMP,VALUE) != ("$date $time","$value")};
|
$addon = qq{AND (TIMESTAMP,VALUE) != ('$date $time','$value')};
|
||||||
my $sql = DbRep_createDeleteSql($hash,$table,$device,$reading,$runtime_string_first,$runtime_string_next,$addon);
|
my $sql = DbRep_createDeleteSql($hash, $table, $device, $reading, $runtime_string_first, $runtime_string_next, $addon);
|
||||||
|
|
||||||
($err, $sth) = DbRep_prepareExecuteQuery ($name, $dbh, $sql);
|
($err, $sth) = DbRep_prepareExecuteQuery ($name, $dbh, $sql);
|
||||||
return $err if ($err);
|
return $err if ($err);
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
##########################################################################################################
|
##########################################################################################################
|
||||||
# $Id: 93_DbRep.pm 27577 2023-05-16 19:56:58Z DS_Starter $
|
# $Id: 93_DbRep.pm 27720 2023-07-02 08:57:40Z DS_Starter $
|
||||||
##########################################################################################################
|
##########################################################################################################
|
||||||
# 93_DbRep.pm
|
# 93_DbRep.pm
|
||||||
#
|
#
|
||||||
@ -59,6 +59,7 @@ no if $] >= 5.017011, warnings => 'experimental::smartmatch';
|
|||||||
|
|
||||||
# Version History intern
|
# Version History intern
|
||||||
my %DbRep_vNotesIntern = (
|
my %DbRep_vNotesIntern = (
|
||||||
|
"8.52.9" => "05.07.2023 fix wrong SQL syntax for PostgreSQL -> maxValue deleteOther, Forum:#134170 ",
|
||||||
"8.52.8" => "28.06.2023 fix check of DbRep_afterproc, DbRep_beforeproc if should exec PERL code ",
|
"8.52.8" => "28.06.2023 fix check of DbRep_afterproc, DbRep_beforeproc if should exec PERL code ",
|
||||||
"8.52.7" => "16.05.2023 DbRep_afterproc, DbRep_beforeproc can execute FHEM commands as well as PERL code ",
|
"8.52.7" => "16.05.2023 DbRep_afterproc, DbRep_beforeproc can execute FHEM commands as well as PERL code ",
|
||||||
"8.52.6" => "11.04.2023 change diffValue for aggr month ",
|
"8.52.6" => "11.04.2023 change diffValue for aggr month ",
|
||||||
@ -13700,11 +13701,11 @@ sub DbRep_deleteOtherFromDB {
|
|||||||
my ($dbh,$sth,$timestamp,$value,$addon,$row_extreme_time,$runtime_string_first,$runtime_string_next);
|
my ($dbh,$sth,$timestamp,$value,$addon,$row_extreme_time,$runtime_string_first,$runtime_string_next);
|
||||||
my @row_array;
|
my @row_array;
|
||||||
|
|
||||||
my %rh = split("§", $rows);
|
my %rh = split "§", $rows;
|
||||||
|
|
||||||
for my $key (sort(keys(%rh))) {
|
for my $key (sort(keys(%rh))) {
|
||||||
# Inhalt $rh{$key} -> $runtime_string."|".$max_value."|".$row_max_time."|".$runtime_string_first."|".$runtime_string_next
|
# Inhalt $rh{$key} -> $runtime_string."|".$max_value."|".$row_max_time."|".$runtime_string_first."|".$runtime_string_next
|
||||||
my @k = split("\\|",$rh{$key});
|
my @k = split "\\|", $rh{$key};
|
||||||
$value = $k[1] // undef;
|
$value = $k[1] // undef;
|
||||||
$row_extreme_time = $k[2];
|
$row_extreme_time = $k[2];
|
||||||
$runtime_string_first = $k[3];
|
$runtime_string_first = $k[3];
|
||||||
@ -13728,7 +13729,7 @@ sub DbRep_deleteOtherFromDB {
|
|||||||
my $dlines = 0;
|
my $dlines = 0;
|
||||||
|
|
||||||
for my $row (@row_array) {
|
for my $row (@row_array) {
|
||||||
my @a = split("\\|",$row);
|
my @a = split "\\|", $row;
|
||||||
$device = $a[0];
|
$device = $a[0];
|
||||||
$reading = $a[1];
|
$reading = $a[1];
|
||||||
$value = $a[2];
|
$value = $a[2];
|
||||||
@ -13738,8 +13739,8 @@ sub DbRep_deleteOtherFromDB {
|
|||||||
|
|
||||||
my($date, $time) = split "_", $row_extreme_time;
|
my($date, $time) = split "_", $row_extreme_time;
|
||||||
$time =~ s/-/:/gxs;
|
$time =~ s/-/:/gxs;
|
||||||
$addon = qq{AND (TIMESTAMP,VALUE) != ("$date $time","$value")};
|
$addon = qq{AND (TIMESTAMP,VALUE) != ('$date $time','$value')};
|
||||||
my $sql = DbRep_createDeleteSql($hash,$table,$device,$reading,$runtime_string_first,$runtime_string_next,$addon);
|
my $sql = DbRep_createDeleteSql($hash, $table, $device, $reading, $runtime_string_first, $runtime_string_next, $addon);
|
||||||
|
|
||||||
($err, $sth) = DbRep_prepareExecuteQuery ($name, $dbh, $sql);
|
($err, $sth) = DbRep_prepareExecuteQuery ($name, $dbh, $sql);
|
||||||
return $err if ($err);
|
return $err if ($err);
|
||||||
@ -14145,12 +14146,12 @@ sub DbRep_setVersionInfo {
|
|||||||
if($modules{$type}{META}{x_prereqs_src} && !$hash->{HELPER}{MODMETAABSENT}) {
|
if($modules{$type}{META}{x_prereqs_src} && !$hash->{HELPER}{MODMETAABSENT}) {
|
||||||
# META-Daten sind vorhanden
|
# META-Daten sind vorhanden
|
||||||
$modules{$type}{META}{version} = "v".$v; # Version aus META.json überschreiben, Anzeige mit {Dumper $modules{SMAPortal}{META}}
|
$modules{$type}{META}{version} = "v".$v; # Version aus META.json überschreiben, Anzeige mit {Dumper $modules{SMAPortal}{META}}
|
||||||
if($modules{$type}{META}{x_version}) { # {x_version} ( nur gesetzt wenn $Id: 93_DbRep.pm 27577 2023-05-16 19:56:58Z DS_Starter $ im Kopf komplett! vorhanden )
|
if($modules{$type}{META}{x_version}) { # {x_version} ( nur gesetzt wenn $Id: 93_DbRep.pm 27720 2023-07-02 08:57:40Z DS_Starter $ im Kopf komplett! vorhanden )
|
||||||
$modules{$type}{META}{x_version} =~ s/1.1.1/$v/g;
|
$modules{$type}{META}{x_version} =~ s/1.1.1/$v/g;
|
||||||
} else {
|
} else {
|
||||||
$modules{$type}{META}{x_version} = $v;
|
$modules{$type}{META}{x_version} = $v;
|
||||||
}
|
}
|
||||||
return $@ unless (FHEM::Meta::SetInternals($hash)); # FVERSION wird gesetzt ( nur gesetzt wenn $Id: 93_DbRep.pm 27577 2023-05-16 19:56:58Z DS_Starter $ im Kopf komplett! vorhanden )
|
return $@ unless (FHEM::Meta::SetInternals($hash)); # FVERSION wird gesetzt ( nur gesetzt wenn $Id: 93_DbRep.pm 27720 2023-07-02 08:57:40Z DS_Starter $ im Kopf komplett! vorhanden )
|
||||||
if(__PACKAGE__ eq "FHEM::$type" || __PACKAGE__ eq $type) {
|
if(__PACKAGE__ eq "FHEM::$type" || __PACKAGE__ eq $type) {
|
||||||
# es wird mit Packages gearbeitet -> Perl übliche Modulversion setzen
|
# es wird mit Packages gearbeitet -> Perl übliche Modulversion setzen
|
||||||
# mit {<Modul>->VERSION()} im FHEMWEB kann Modulversion abgefragt werden
|
# mit {<Modul>->VERSION()} im FHEMWEB kann Modulversion abgefragt werden
|
||||||
|
Loading…
x
Reference in New Issue
Block a user