From b9c795d64be351d1e528e5e4f24848f26202d1bc Mon Sep 17 00:00:00 2001 From: nasseeder1 Date: Mon, 30 Oct 2017 11:59:28 +0000 Subject: [PATCH] 93_DbRep: V5.8.6, don't limit length of attr reading/device if attr contains a list git-svn-id: https://svn.fhem.de/fhem/trunk@15352 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/CHANGED | 2 ++ fhem/FHEM/93_DbRep.pm | 12 +++++++----- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/fhem/CHANGED b/fhem/CHANGED index 0807be655..51fde1801 100644 --- a/fhem/CHANGED +++ b/fhem/CHANGED @@ -1,5 +1,7 @@ # 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. + - bugfix: 93_DbRep: V5.8.6, don't limit length of attr reading/device if + attr contains a list - feature: 70_KODI: added reading jsonResponse which contains the last received message from Kodi - feature: 46_Aqicn: FHEMWEB text color formated, thanks to maddhin diff --git a/fhem/FHEM/93_DbRep.pm b/fhem/FHEM/93_DbRep.pm index 6d90d376c..562a953f6 100644 --- a/fhem/FHEM/93_DbRep.pm +++ b/fhem/FHEM/93_DbRep.pm @@ -37,6 +37,7 @@ ########################################################################################################################### # Versions History: # +# 5.8.6 30.10.2017 don't limit length of attr reading/device if attr contains a list # 5.8.5 19.10.2017 filter unwanted characters in "procinfo"-result # 5.8.4 17.10.2017 createSelectSql, createDeleteSql, currentfillup_Push switch to devspec # 5.8.3 16.10.2017 change to use createSelectSql: minValue,diffValue - createDeleteSql: delEntries @@ -244,7 +245,7 @@ use Encode qw(encode_utf8); sub DbRep_Main($$;$); -my $DbRepVersion = "5.8.5"; +my $DbRepVersion = "5.8.6"; my %dbrep_col = ("DEVICE" => 64, "TYPE" => 64, @@ -793,10 +794,11 @@ sub DbRep_Attr($$$$) { if ($aName eq "reading" || $aName eq "device") { if ($dbmodel && $dbmodel ne 'SQLITE') { - if ($dbmodel eq 'POSTGRESQL') { - return "Length of \"$aName\" is too big. Maximum length for database type $dbmodel is $dbrep_col{READING}" if(length($aVal) > $dbrep_col{READING}); - } elsif ($dbmodel eq 'MYSQL') { - return "Length of \"$aName\" is too big. Maximum length for database type $dbmodel is $dbrep_col{READING}" if(length($aVal) > $dbrep_col{READING}); + my $attrname = uc($aName); + if ($dbmodel eq 'POSTGRESQL' && $aVal !~ m/,/) { + return "Length of \"$aName\" is too big. Maximum length for database type $dbmodel is $dbrep_col{$attrname}" if(length($aVal) > $dbrep_col{$attrname}); + } elsif ($dbmodel eq 'MYSQL' && $aVal !~ m/,/) { + return "Length of \"$aName\" is too big. Maximum length for database type $dbmodel is $dbrep_col{$attrname}" if(length($aVal) > $dbrep_col{$attrname}); } } }