2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-02-27 20:34:52 +00:00

93_DbRep: the "explain" SQL-command is possible now in sqlCmd

git-svn-id: https://svn.fhem.de/fhem/trunk@19121 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
nasseeder1 2019-04-05 20:09:22 +00:00
parent 92b5db7df1
commit 969b8bcd0e
2 changed files with 13 additions and 6 deletions

View File

@ -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.
- feature: 93_DbRep: the "explain" SQL-command is possible now in sqlCmd
- feature: 10_MYSENSORS_DEVICE: add attrTemplate support - feature: 10_MYSENSORS_DEVICE: add attrTemplate support
- change: 00_MYSENSORS: enhance support for node functions - change: 00_MYSENSORS: enhance support for node functions
when using multiple GW's when using multiple GW's

View File

@ -58,6 +58,7 @@ no if $] >= 5.017011, warnings => 'experimental::smartmatch';
# Version History intern # Version History intern
our %DbRep_vNotesIntern = ( our %DbRep_vNotesIntern = (
"8.19.0" => "04.04.2019 explain is possible in sqlCmd ",
"8.18.0" => "01.04.2019 new aggregation year ", "8.18.0" => "01.04.2019 new aggregation year ",
"8.17.2" => "28.03.2019 consideration of daylight saving time/leap year changed (func DbRep_corrRelTime) ", "8.17.2" => "28.03.2019 consideration of daylight saving time/leap year changed (func DbRep_corrRelTime) ",
"8.17.1" => "24.03.2019 edit Meta data, activate Meta.pm, prevent module from deactivation in case of unavailable Meta.pm ", "8.17.1" => "24.03.2019 edit Meta data, activate Meta.pm, prevent module from deactivation in case of unavailable Meta.pm ",
@ -146,6 +147,7 @@ our %DbRep_vNotesIntern = (
# Version History extern: # Version History extern:
our %DbRep_vNotesExtern = ( our %DbRep_vNotesExtern = (
"8.19.0" => "04.04.2019 The \"explain\" SQL-command is possible in sqlCmd ",
"8.18.0" => "01.04.2019 New aggregation type \"year\" ", "8.18.0" => "01.04.2019 New aggregation type \"year\" ",
"8.17.0" => "20.03.2019 With new attribute \"sqlCmdVars\" you are able to set SQL session variables or SQLite PRAGMA every time ". "8.17.0" => "20.03.2019 With new attribute \"sqlCmdVars\" you are able to set SQL session variables or SQLite PRAGMA every time ".
"before running a SQL-statement with sqlCmd command.", "before running a SQL-statement with sqlCmd command.",
@ -5802,7 +5804,7 @@ sub sqlCmd_DoParse($) {
my @rows; my @rows;
my $nrows = 0; my $nrows = 0;
if($sql =~ m/^\s*(select|pragma|show)/is) { if($sql =~ m/^\s*(explain|select|pragma|show)/is) {
while (my @line = $sth->fetchrow_array()) { while (my @line = $sth->fetchrow_array()) {
Log3 ($name, 4, "DbRep $name - SQL result: @line"); Log3 ($name, 4, "DbRep $name - SQL result: @line");
my $row = join("$srs", @line); my $row = join("$srs", @line);
@ -9226,12 +9228,14 @@ sub DbRep_delread($;$$) {
# Highlighted Readings löschen und save statefile wegen Inkompatibilitär beim Restart # Highlighted Readings löschen und save statefile wegen Inkompatibilitär beim Restart
if($key =~ /<html><span/) { if($key =~ /<html><span/) {
$do = 1; $do = 1;
delete($defs{$name}{READINGS}{$key}); # delete($defs{$name}{READINGS}{$key});
readingsDelete($hash,$key);
} }
# Reading löschen wenn Featuelevel > 5.9 und zu lang nach der neuen Festlegung # Reading löschen wenn Featuelevel > 5.9 und zu lang nach der neuen Festlegung
if($do == 0 && $featurelevel > 5.9 && !goodReadingName($key)) { if($do == 0 && $featurelevel > 5.9 && !goodReadingName($key)) {
$do = 1; $do = 1;
delete($defs{$name}{READINGS}{$key}); # delete($defs{$name}{READINGS}{$key});
readingsDelete($hash,$key);
} }
} }
WriteStatefile() if($do == 1); WriteStatefile() if($do == 1);
@ -9248,13 +9252,15 @@ sub DbRep_delread($;$$) {
} }
} }
if($dodel) { if($dodel) {
delete($defs{$name}{READINGS}{$key}); # delete($defs{$name}{READINGS}{$key});
readingsDelete($hash,$key);
} }
} }
} else { } else {
foreach my $key(@allrds) { foreach my $key(@allrds) {
# Log3 ($name, 1, "DbRep $name - Reading Schlüssel: $key"); # Log3 ($name, 1, "DbRep $name - Reading Schlüssel: $key");
delete($defs{$name}{READINGS}{$key}) if($key ne "state"); # delete($defs{$name}{READINGS}{$key}) if($key ne "state");
readingsDelete($hash,$key) if($key ne "state");
} }
} }
return undef; return undef;
@ -13680,7 +13686,7 @@ sub bdump {
<tr><td> <b>device</b> </td><td>: einschließen oder ausschließen von Datensätzen die &lt;device&gt; enthalten </td></tr> <tr><td> <b>device</b> </td><td>: einschließen oder ausschließen von Datensätzen die &lt;device&gt; enthalten </td></tr>
<tr><td> <b>reading</b> </td><td>: einschließen oder ausschließen von Datensätzen die &lt;reading&gt; enthalten </td></tr> <tr><td> <b>reading</b> </td><td>: einschließen oder ausschließen von Datensätzen die &lt;reading&gt; enthalten </td></tr>
<tr><td> <b>time.*</b> </td><td>: eine Reihe von Attributen zur Zeitabgrenzung </td></tr> <tr><td> <b>time.*</b> </td><td>: eine Reihe von Attributen zur Zeitabgrenzung </td></tr>
<tr><td style="vertical-align:top"> <b>valueFilter</b> <td>: filtert die anzuzeigenden Datensätze mit einem regulären Ausdruck. Der Regex wird auf Werte des DAtenbankfelder 'VALUE' angewendet. </td></tr> <tr><td style="vertical-align:top"> <b>valueFilter</b> <td>: filtert die anzuzeigenden Datensätze mit einem regulären Ausdruck (Datenbank spezifischer REGEXP). Der REGEXP wird auf Werte des Datenbankfeldes 'VALUE' angewendet. </td></tr>
</table> </table>
</ul> </ul>
<br> <br>