Skip Menu |

This queue is for tickets about the DBD-mysql CPAN distribution.

Report information
The Basics
Id: 18348
Status: resolved
Priority: 0/
Queue: DBD-mysql

People
Owner: Nobody in particular
Requestors: Michael.Kramer [...] emuge.de
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 3.0002
Fixed in: (no value)



Subject: utf8 and mysql_auto_reconnect
DBD::mysql has a bug when reading utf8 data from a MySQL database and "mysql_auto_reconnect" is enabled. First you have to set the character set for the connection to get the results in the correct encoding: $dbh->do("set names utf8"); Then you read data from the database--->everything is okay. When a reconnect occurs the driver forgets about the connection encoding and the results are delivered with the default encoding (e.g. 'latin1').
On Fri Mar 24 06:06:08 2006, guest wrote: Show quoted text
> DBD::mysql has a bug when reading utf8 data from a MySQL database and > "mysql_auto_reconnect" is enabled. > > First you have to set the character set for the connection to get the > results in the correct encoding: > $dbh->do("set names utf8"); > Then you read data from the database--->everything is okay. > > When a reconnect occurs the driver forgets about the connection > encoding and the results are delivered with the default encoding (e.g. > 'latin1').
This is not a bug in auto reconnect but rather a limitation thereof. an auto reconnect will also cause you to lose any table locks that you may have or any open transactions. Auto reconnect is mainly for backwards compatibility and simple applications that do not reqire state to be kept across a reconnect.