From 8fd2ecb8d647afce8646e000373df3798f17e906 Mon Sep 17 00:00:00 2001 From: nasseeder1 Date: Wed, 13 Nov 2019 20:34:47 +0000 Subject: [PATCH] 93_DbLog: contrib 4.9.1 git-svn-id: https://svn.fhem.de/fhem/trunk@20507 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/contrib/DS_Starter/93_DbLog.pm | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/fhem/contrib/DS_Starter/93_DbLog.pm b/fhem/contrib/DS_Starter/93_DbLog.pm index 53f901be2..42090a21b 100644 --- a/fhem/contrib/DS_Starter/93_DbLog.pm +++ b/fhem/contrib/DS_Starter/93_DbLog.pm @@ -30,6 +30,7 @@ no if $] >= 5.017011, warnings => 'experimental::smartmatch'; # Version History intern by DS_Starter: our %DbLog_vNotesIntern = ( + "4.9.1" => "13.11.2019 escape \ with \\ in DbLog_Push and DbLog_PushAsync ", "4.9.0" => "11.11.2019 new attribute defaultMinInterval to set a default minInterval central in dblog for all events ". "Forum: https://forum.fhem.de/index.php/topic,65860.msg972352.html#msg972352 ", "4.8.0" => "14.10.2019 change SQL-Statement for delta-h, delta-d (SVG getter) ", @@ -1722,9 +1723,9 @@ sub DbLog_Push(@) { push(@event, "$a[3]"); push(@reading, "$a[4]"); push(@value, "$a[5]"); - push(@unit, "$a[6]"); + push(@unit, "$a[6]"); Log3 $hash->{NAME}, 4, "DbLog $name -> processing event Timestamp: $a[0], Device: $a[1], Type: $a[2], Event: $a[3], Reading: $a[4], Value: $a[5], Unit: $a[6]" - if($vb4show); + if($vb4show); } use warnings; @@ -1756,6 +1757,9 @@ sub DbLog_Push(@) { $a[3] =~ s/'/''/g; # escape ' with '' $a[5] =~ s/'/''/g; # escape ' with '' $a[6] =~ s/'/''/g; # escape ' with '' + $a[3] =~ s/\\/\\\\/g; # escape \ with \\ + $a[5] =~ s/\\/\\\\/g; # escape \ with \\ + $a[6] =~ s/\\/\\\\/g; # escape \ with \\ $sqlins .= "('$a[0]','$a[1]','$a[2]','$a[3]','$a[4]','$a[5]','$a[6]'),"; } use warnings; @@ -2348,8 +2352,8 @@ sub DbLog_PushAsync(@) { push(@event, "$a[3]"); push(@reading, "$a[4]"); push(@value, "$a[5]"); - push(@unit, "$a[6]"); - Log3 $hash->{NAME}, 5, "DbLog $name -> processing event Timestamp: $a[0], Device: $a[1], Type: $a[2], Event: $a[3], Reading: $a[4], Value: $a[5], Unit: $a[6]"; + push(@unit, "$a[6]"); + Log3 $hash->{NAME}, 5, "DbLog $name -> processing event Timestamp: $a[0], Device: $a[1], Type: $a[2], Event: $a[3], Reading: $a[4], Value: $a[5], Unit: $a[6]"; } use warnings; @@ -2380,6 +2384,9 @@ sub DbLog_PushAsync(@) { $a[3] =~ s/'/''/g; # escape ' with '' $a[5] =~ s/'/''/g; # escape ' with '' $a[6] =~ s/'/''/g; # escape ' with '' + $a[3] =~ s/\\/\\\\/g; # escape \ with \\ + $a[5] =~ s/\\/\\\\/g; # escape \ with \\ + $a[6] =~ s/\\/\\\\/g; # escape \ with \\ $sqlins .= "('$a[0]','$a[1]','$a[2]','$a[3]','$a[4]','$a[5]','$a[6]'),"; } use warnings;