From: Peter Rabbitson Date: Tue, 5 Aug 2014 12:56:18 +0000 (+0200) Subject: S::L tests rely on preserving the sqlmaker between reconnections X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=26aea721d0dd94fe9920efa3c01f081642399c28;p=dbsrgits%2FDBIx-Class-Historic.git S::L tests rely on preserving the sqlmaker between reconnections While this is utterly retarded, punt and backout the b6a469f7 change for now. Will revisit again during the connect_info consolidation --- diff --git a/lib/DBIx/Class/Storage/DBI.pm b/lib/DBIx/Class/Storage/DBI.pm index afa07c5..9a456d4 100644 --- a/lib/DBIx/Class/Storage/DBI.pm +++ b/lib/DBIx/Class/Storage/DBI.pm @@ -1038,8 +1038,11 @@ sub _init {} sub _populate_dbh { $_[0]->_dbh(undef); # in case ->connected failed we might get sent here + $_[0]->_dbh_details({}); # reset everything we know - $_[0]->_sql_maker(undef); # this may also end up being different + + # FIXME - this needs reenabling with the proper "no reset on same DSN" check + #$_[0]->_sql_maker(undef); # this may also end up being different $_[0]->_dbh($_[0]->_connect); diff --git a/t/sqlmaker/mysql.t b/t/sqlmaker/mysql.t index 6fb1526..0e2ad29 100644 --- a/t/sqlmaker/mysql.t +++ b/t/sqlmaker/mysql.t @@ -126,13 +126,18 @@ for ( ) { my ($ver, $join_op) = @$_; - no warnings 'redefine'; - local *DBIx::Class::Storage::DBI::mysql::_get_server_version = sub { $ver }; - # we do not care at this point if data is available, just do a reconnect cycle - # to clear all caches - $schema->storage->disconnect; - $schema->storage->ensure_connected; + # to clear the server version cache and then get a new maker + { + $schema->storage->disconnect; + $schema->storage->_sql_maker(undef); + + no warnings 'redefine'; + local *DBIx::Class::Storage::DBI::mysql::_get_server_version = sub { $ver }; + + $schema->storage->ensure_connected; + $schema->storage->sql_maker; + } is_same_sql_bind ( $schema->resultset('CD')->search ({}, { prefetch => 'artist' })->as_query,