That error is fixed in SVN. (The registry entry class was actually
missing a whole bunch of driver-specific attributes. I've added them
all.)
> using post_connect_sql => ["SET NAMES utf8"], is ok ( no error), but
> suffer a strange problem:
> sometimes the Chinese displays normal, and when i reload the page, it
> is abnormal, and reload, normal again and reload again then may go
> abnormal...(most of the times are normal).
>
> I think the problem is as stated in the docs of Rose::DB,
>
> " If the database handle returned by dbi_connect was originally
> connected by another Rose::DB-derived object (e.g., if a subclass's
> custom implementation of dbi_connect calls DBI's connect_cached
> method) then the post_connect_sql statements will not be run, nor will
> any custom DBI attributes be applied (e.g., Rose::DB::MySQL's
> mysql_enable_utf8 attribute). "
I doubt if that's the problem. If one of your database handles "was
originally connected by another Rose::DB-derived object," then it will
already have had the post_connect_sql run on it. You only need to run
"SET NAMES utf8" once per connection, right?
Given the information presented so far, I think this issue is probably
unrelated to Rose::DB. But please try the SVN version where the
mysql_enable_utf8 registry attribute is supported, just in case it
actually solves your problem.
SVN URL: http://rose.googlecode.com/svn/trunk/modules/Rose-DB
-John