mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-02-25 09:55:38 +00:00
93_DbLog: contrib 5.8.1
git-svn-id: https://svn.fhem.de/fhem/trunk@27228 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
331f57d976
commit
1793ad0750
@ -2603,6 +2603,27 @@ 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 '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") {
|
||||||
@ -2611,29 +2632,6 @@ sub _DbLog_SBP_connectDB {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
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",
|
||||||
"PRAGMA synchronous=FULL",
|
"PRAGMA synchronous=FULL",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user