mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-03-10 03:06:37 +00:00
98_serviced: repeat failed commit - sorry Heiko
git-svn-id: https://svn.fhem.de/fhem/trunk@27227 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
ec2ed32d9e
commit
1c6cd4c1b9
@ -16,7 +16,7 @@ use Blocking;
|
|||||||
use Time::HiRes;
|
use Time::HiRes;
|
||||||
use vars qw{%defs};
|
use vars qw{%defs};
|
||||||
|
|
||||||
my $servicedVersion = "1.2.8";
|
my $servicedVersion = "1.2.9";
|
||||||
|
|
||||||
sub serviced_shutdownwait($);
|
sub serviced_shutdownwait($);
|
||||||
|
|
||||||
@ -402,6 +402,7 @@ sub serviced_Shutdown($)
|
|||||||
{
|
{
|
||||||
my ($hash) = @_;
|
my ($hash) = @_;
|
||||||
my $name = $hash->{NAME};
|
my $name = $hash->{NAME};
|
||||||
|
return if (IsDisabled($name));
|
||||||
my $autostop = AttrNum($name,"serviceAutostop",0);
|
my $autostop = AttrNum($name,"serviceAutostop",0);
|
||||||
$autostop = $autostop > 300 ? 300 : $autostop;
|
$autostop = $autostop > 300 ? 300 : $autostop;
|
||||||
if ($autostop)
|
if ($autostop)
|
||||||
|
@ -38,8 +38,8 @@ no if $] >= 5.017011, warnings => 'experimental::smartmatch';
|
|||||||
|
|
||||||
# Version History intern by DS_Starter:
|
# Version History intern by DS_Starter:
|
||||||
my %DbLog_vNotesIntern = (
|
my %DbLog_vNotesIntern = (
|
||||||
"5.8.1" => "13.02.2023 change field type of DbLogInclude, DbLogExclude to textField-long, ".
|
"5.8.1" => "13.02.2023 change field type of DbLogInclude, DbLogExclude to textField-long, configCheck evaluate collation ".
|
||||||
"_DbLog_SBP_connectDB evaluate DB Character set and use it for connection collation ",
|
"_DbLog_SBP_connectDB evaluate DB Character/collation set and use it for connection collation ",
|
||||||
"5.8.0" => "30.01.2023 new Get menu for a selection of getters, fix creation of new subprocess during shutdown sequence ",
|
"5.8.0" => "30.01.2023 new Get menu for a selection of getters, fix creation of new subprocess during shutdown sequence ",
|
||||||
"5.7.0" => "25.01.2023 send Log3() data back ro parent process, improve _DbLog_dbReadings function ",
|
"5.7.0" => "25.01.2023 send Log3() data back ro parent process, improve _DbLog_dbReadings function ",
|
||||||
"5.6.2" => "22.01.2023 check Syntax of DbLogValueFn attribute with Log output, Forum:#131777 ",
|
"5.6.2" => "22.01.2023 check Syntax of DbLogValueFn attribute with Log output, Forum:#131777 ",
|
||||||
@ -2602,25 +2602,7 @@ sub _DbLog_SBP_connectDB {
|
|||||||
|
|
||||||
if($utf8) {
|
if($utf8) {
|
||||||
if($model eq "MYSQL") {
|
if($model eq "MYSQL") {
|
||||||
$dbh->{mysql_enable_utf8} = 1;
|
$dbh->{mysql_enable_utf8} = 1;
|
||||||
|
|
||||||
($err, my @se) = _DbLog_prepExecQueryOnly ($name, $dbh, "SHOW VARIABLES LIKE 'character_set_database';");
|
|
||||||
return ($err, q{}) if($err);
|
|
||||||
|
|
||||||
my $dbcharset = @se ? uc($se[1]) : "no result";
|
|
||||||
|
|
||||||
_DbLog_SBP_Log3Parent ( { name => $name,
|
|
||||||
level => 4,
|
|
||||||
msg => qq(Database Character set is >$dbcharset<),
|
|
||||||
oper => 'log3parent',
|
|
||||||
subprocess => $subprocess
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
$dbcharset = 'UTF8' if($dbcharset !~ /UTF8MB4/xs);
|
|
||||||
|
|
||||||
($err, undef) = _DbLog_SBP_dbhDo ($name, $dbh, qq(set names "$dbcharset"), $subprocess);
|
|
||||||
return ($err, q{}) if($err);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if($model eq "SQLITE") {
|
if($model eq "SQLITE") {
|
||||||
@ -2628,6 +2610,29 @@ sub _DbLog_SBP_connectDB {
|
|||||||
return ($err, q{}) if($err);
|
return ($err, q{}) if($err);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($model eq "MYSQL") {
|
||||||
|
($err, my @se) = _DbLog_prepExecQueryOnly ($name, $dbh, "SHOW VARIABLES LIKE 'collation_database'");
|
||||||
|
return ($err, q{}) if($err);
|
||||||
|
|
||||||
|
my $dbcharset = @se ? $se[1] : 'noresult';
|
||||||
|
|
||||||
|
_DbLog_SBP_Log3Parent ( { name => $name,
|
||||||
|
level => 4,
|
||||||
|
msg => qq(Database Character set is >$dbcharset<),
|
||||||
|
oper => 'log3parent',
|
||||||
|
subprocess => $subprocess
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
if ($dbcharset !~ /noresult|ucs2|utf16|utf32/ixs) { # Impermissible Client Character Sets -> https://dev.mysql.com/doc/refman/8.0/en/charset-connection.html
|
||||||
|
my $collation = $dbcharset;
|
||||||
|
$dbcharset = (split '_', $collation, 2)[0];
|
||||||
|
|
||||||
|
($err, undef) = _DbLog_SBP_dbhDo ($name, $dbh, qq(set names "$dbcharset" collate "$collation"), $subprocess); # set names utf8 collate utf8_general_ci
|
||||||
|
return ($err, q{}) if($err);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if ($model eq 'SQLITE') {
|
if ($model eq 'SQLITE') {
|
||||||
my @dos = ("PRAGMA temp_store=MEMORY",
|
my @dos = ("PRAGMA temp_store=MEMORY",
|
||||||
@ -7107,10 +7112,10 @@ sub DbLog_configcheck {
|
|||||||
my ($chutf8mod,$chutf8dat);
|
my ($chutf8mod,$chutf8dat);
|
||||||
|
|
||||||
if ($dbmodel =~ /MYSQL/) {
|
if ($dbmodel =~ /MYSQL/) {
|
||||||
($err, @ce) = _DbLog_prepExecQueryOnly ($name, $dbh, "SHOW VARIABLES LIKE 'character_set_connection'");
|
($err, @ce) = _DbLog_prepExecQueryOnly ($name, $dbh, qq(SHOW VARIABLES LIKE 'collation_connection')); # character_set_connection
|
||||||
$chutf8mod = @ce ? uc($ce[1]) : "no result";
|
$chutf8mod = @ce ? uc($ce[1]) : "no result";
|
||||||
|
|
||||||
($err, @se) = _DbLog_prepExecQueryOnly ($name, $dbh, "SHOW VARIABLES LIKE 'character_set_database'");
|
($err, @se) = _DbLog_prepExecQueryOnly ($name, $dbh, qq(SHOW VARIABLES LIKE 'collation_database')); # character_set_database
|
||||||
$chutf8dat = @se ? uc($se[1]) : "no result";
|
$chutf8dat = @se ? uc($se[1]) : "no result";
|
||||||
|
|
||||||
if($chutf8mod eq $chutf8dat) {
|
if($chutf8mod eq $chutf8dat) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user