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
Download (untitled) / with headers
text/plain 465b
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').
Download (untitled) / with headers
text/plain 831b
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.


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.