- Timestamp:
- 05/16/08 22:36:08 (19 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
branches/release-38/lib/MT/ObjectDriver/Driver/DBD/mysql.pm
r1769 r2367 37 37 } 38 38 39 sub configure{39 sub init_dbh { 40 40 my $dbd = shift; 41 my ($d river) = @_;42 $dbd-> _set_names($driver);43 $dbd ;41 my ($dbh) = @_; 42 $dbd->SUPER::init_dbh(@_); 43 $dbd->_set_names($dbh); 44 44 } 45 45 46 46 sub _set_names { 47 47 my $dbd = shift; 48 my ($d river) = @_;49 my $dbh = $driver->rw_handle;48 my ($dbh) = @_; 49 return 1 if exists $dbh->{private_set_names}; 50 50 51 warn "got here"; 51 52 my $cfg = MT->config; 52 53 my $set_names = $cfg->SQLSetNames; 54 $dbh->{private_set_names} = 1; 53 55 return 1 if (defined $set_names) && !$set_names; 54 56 … … 56 58 local $@; 57 59 my $sth = $dbh->prepare('show variables like "character_set_database"') 58 or return $driver->error($dbh->errstr);59 $sth->execute or return $driver->error($sth->errstr);60 or die "error collecting variables from mysql: " . $dbh->errstr; 61 $sth->execute or die "error collecting variables from mysql: " . $sth->errstr; 60 62 my $result = $sth->fetchall_hashref('Variable_name'); 61 63 my $charset_db = $result->{character_set_database}{Value};
