2011-04-10 Junichi Satoh <junichi@rworks.jp>

* lib/PandoraFMS/DB.pm: Moved mysql_enable_utf8 to after database
	connection. It is to avoid coding conversion against multibyte
	characters by mysql.



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@4181 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
jsatoh 2011-04-10 01:18:01 +00:00
parent e76e5c1e9a
commit bee4eb2f4d
2 changed files with 10 additions and 1 deletions

View File

@ -1,3 +1,9 @@
2011-04-10 Junichi Satoh <junichi@rworks.jp>
* lib/PandoraFMS/DB.pm: Moved mysql_enable_utf8 to after database
connection. It is to avoid coding conversion against multibyte
characters by mysql.
2011-04-04 Junichi Satoh <junichi@rworks.jp>
* lib/PandoraFMS/Tools.pm: Added UTF-8 flags deletion from multibyte

View File

@ -66,12 +66,15 @@ sub db_connect ($$$$$$) {
if ($rdbms eq 'mysql') {
# Connect to MySQL
my $dbh = DBI->connect("DBI:mysql:$db_name:$db_host:3306", $db_user, $db_pass, { RaiseError => 1, AutoCommit => 1, mysql_enable_utf8 => 1 });
my $dbh = DBI->connect("DBI:mysql:$db_name:$db_host:3306", $db_user, $db_pass, { RaiseError => 1, AutoCommit => 1 });
return undef unless defined ($dbh);
# Enable auto reconnect
$dbh->{'mysql_auto_reconnect'} = 1;
# Enable character semantics
$dbh->{'mysql_enable_utf8'} = 1;
return $dbh;
}