From 289823ad61eb2edecb17ee2b7ddfcb28a4aa2e6b Mon Sep 17 00:00:00 2001 From: nasseeder1 Date: Sun, 22 Sep 2019 13:55:54 +0000 Subject: [PATCH] 93_DbRep: comma can be shown in sqlCmdHistory, Forum: #103908 git-svn-id: https://svn.fhem.de/fhem/trunk@20228 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/CHANGED | 1 + fhem/FHEM/93_DbRep.pm | 20 ++++++++++---------- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/fhem/CHANGED b/fhem/CHANGED index 58ef7fad9..64aae17bd 100644 --- a/fhem/CHANGED +++ b/fhem/CHANGED @@ -1,5 +1,6 @@ # 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. + - change: 93_DbRep: comma can be shown in sqlCmdHistory, Forum: #103908 - feature: 49_SSCamSTRM: new attribute "hideAudio" - bugfix: 73_AutoShuttersControl: change code in ShuttersCommandSet - bugfix: 88_Timer: fix sort function diff --git a/fhem/FHEM/93_DbRep.pm b/fhem/FHEM/93_DbRep.pm index 70659653f..96acacd50 100644 --- a/fhem/FHEM/93_DbRep.pm +++ b/fhem/FHEM/93_DbRep.pm @@ -58,6 +58,7 @@ no if $] >= 5.017011, warnings => 'experimental::smartmatch'; # Version History intern our %DbRep_vNotesIntern = ( + "8.27.1" => "22.09.2019 comma are shown in sqlCmdHistory, Forum: #103908 ", "8.27.0" => "15.09.2019 save memory usage by eliminating \$hash -> {dbloghash}, fix warning uninitialized value \$idevice in split ", "8.26.0" => "07.09.2019 make SQL Wildcard (\%) possible as placeholder in a reading list: https://forum.fhem.de/index.php/topic,101756.0.html ". "sub DbRep_createUpdateSql deleted, new sub DbRep_createCommonSql ", @@ -855,7 +856,8 @@ sub DbRep_Set($@) { } if($opt eq "sqlCmdHistory") { $prop =~ tr/ A-Za-z0-9!"#$%&'()*+,-.\/:;<=>?@[\\]^_`{|}~äöüÄÖÜ߀/ /cs; - $prop =~ s//,/g; + $prop =~ s//,/g; # noch aus Kompatibilitätsgründen enthalten + $prop =~ s/(\x20)*\xbc/,/g; # Forum: https://forum.fhem.de/index.php/topic,103908.0.html $sqlcmd = $prop; if($sqlcmd eq "___purge_historylist___") { delete($hash->{HELPER}{SQLHIST}); @@ -5968,8 +5970,9 @@ sub sqlCmd_ParseDone($) { # Drop-Down Liste bisherige sqlCmd-Befehle füllen und in Key-File sichern # my $hl = $hash->{HELPER}{SQLHIST}; my @sqlhist = split(",",$hash->{HELPER}{SQLHIST}); - $cmd =~ s/\s/ /g; - $cmd =~ s/,//g; + $cmd =~ s/\s+/ /g; + $cmd =~ s/,/,/g; # Forum: https://forum.fhem.de/index.php/topic,103908.0.html + $cmd =~ s/, /,/g; my $hlc = AttrVal($name, "sqlCmdHistoryLength", 0); # Anzahl der Einträge in Drop-Down Liste if(!@sqlhist || (@sqlhist && !($cmd ~~ @sqlhist))) { unshift @sqlhist,$cmd; @@ -12394,9 +12397,8 @@ return;
  • sqlCmdHistory - If history is activated by attribute "sqlCmdHistoryLength", an already successfully executed sqlCmd-command can be repeated from a drop-down list.
    - By execution of the last list entry, "__purge_historylist__", the list itself can be deleted.
    - If the statement contains "," this character is displayed as "<c>" in the history - list due to technical restrictions.

    + By execution of the last list entry, "__purge_historylist__", the list itself can be + deleted.

    For a better overview the relevant attributes for this command are listed in a table:

    @@ -14833,7 +14835,7 @@ sub bdump { executeBeforeProc : FHEM Kommando (oder Perl-Routine) vor der Operation ausführen executeAfterProc : FHEM Kommando (oder Perl-Routine) nach der Operation ausführen allowDeletion : aktiviert Löschmöglichkeit - sqlResultFormat : legt die Darstellung des Kommandoergebnis fest + sqlResultFormat : legt die Darstellung des Kommandoergebnisses fest sqlResultFieldSep : Auswahl Feldtrenner im Ergebnis sqlCmdHistoryLength : Aktivierung Kommando-Historie und deren Umfang sqlCmdVars : setzt SQL Session Variablen oder PRAGMA vor jeder Ausführung des SQL-Statements @@ -14853,9 +14855,7 @@ sub bdump {
  • sqlCmdHistory - Wenn mit dem Attribut "sqlCmdHistoryLength" aktiviert, kann aus einer Liste ein bereits erfolgreich ausgeführtes sqlCmd-Kommando wiederholt werden.
    Mit Ausführung des letzten Eintrags der Liste, "__purge_historylist__", kann die Liste gelöscht - werden.
    - Falls das Statement "," enthält, wird dieses Zeichen aus technischen Gründen in der - History-Liste als "<c>" dargestellt.

    + werden.

    Zur besseren Übersicht sind die zur Steuerung dieser Funktion von relevanten Attribute hier noch einmal zusammenstellt: