From: Peter Rabbitson Date: Wed, 17 Apr 2013 07:34:50 +0000 (+0200) Subject: Merge branch 'master' into topic/constructor_rewrite X-Git-Tag: v0.08250~31^2~21 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=723f25e0;p=dbsrgits%2FDBIx-Class.git Merge branch 'master' into topic/constructor_rewrite Add some extra code to enforce the assumption that any bind type constant is accessible in _dbi_attrs_for_bind, or in other words that all necessary DBDs are already loaded (concept originally introduced in ad7c50fc) Without this the combination of 9930caaf7e (do not recalculate bind attrs on dbh_do retry) and a2f228547 (do not wrap iterators in dbh_do) can result in _dbi_attrs_for_bind being called before DBI/DBD::* has been loaded at all --- 723f25e01d5265eab37b8281da0b22387cfa1aaa diff --cc Changes index fc2b3a1,819dc5b..6b9a3b4 --- a/Changes +++ b/Changes @@@ -1,28 -1,26 +1,51 @@@ Revision history for DBIx::Class + * Fixes ++ - Fix _dbi_attrs_for_bind() being called befor DBI has been loaded ++ (regression in 0.08210) + - Fix update/delete operations on resultsets *joining* the updated + table failing on MySQL. Resolves oversights in the fixes for + RT#81378 and RT#81897 + - Stop Sybase ASE storage from generating invalid SQL in subselects + when a limit without offset is encountered + + 0.08210 2013-04-04 15:30 (UTC) + * New Features / Changes + - Officially deprecate the 'cols' and 'include_columns' resultset + attributes + - Remove ::Storage::DBI::sth() deprecated in 0.08191 + + * Fixes + - Work around a *critical* bug with potential for data loss in + DBD::SQLite - RT#79576 + - Audit and correct potential bugs associated with braindead reuse + of $1 on unsuccessful matches + - Fix incorrect warning/exception originator reported by carp*() and + throw_exception() + +0.08242-TRIAL (EXPERIMENTAL BETA RELEASE) 2013-03-10 14:44 (UTC) + * New Features / Changes + - Prefetch with limit on right-side ordered resultsets now works + correctly (via aggregated grouping) + - Changing the result_class of a ResultSet in progress is now + explicitly forbidden. The behavior was undefined before, and + would result in wildly differing outcomes depending on $rs + attributes. + - Scale back validation of the 'as' attribute - in the field + there are legitimate-ish uses of a inflating into an apparently + invalid relationship graph + - Warn in case of iterative collapse being upgraded to an eager + cursor slurp + - No longer order the insides of a complex prefetch subquery, + unless required to satisfy a limit + + * Fixes + - Properly consider unselected order_by criteria during complex + subqueried prefetch + - Properly support "MySQL-style" left-side group_by with prefetch + - Fix $grouped_rs->get_column($col)->func($func) producing incorrect + SQL (RT#81127) + 0.08209 2013-03-01 12:56 (UTC) * New Features / Changes - Debugging aid - warn on invalid result objects created by what diff --cc lib/DBIx/Class/Storage/DBI.pm index 9c622f8,b4b421c..d207767 --- a/lib/DBIx/Class/Storage/DBI.pm +++ b/lib/DBIx/Class/Storage/DBI.pm @@@ -1703,11 -1706,10 +1703,15 @@@ sub _execute my ($sql, $bind) = $self->_prep_for_execute($op, $ident, \@args); - shift->dbh_do( # retry over disconnects - '_dbh_execute', - shift->dbh_do( _dbh_execute => # retry over disconnects ++ # not even a PID check - we do not care about the state of the _dbh. ++ # All we need is to get the appropriate drivers loaded if they aren't ++ # already so that the assumption in ad7c50fc26e holds ++ $self->_populate_dbh unless $self->_dbh; ++ ++ $self->dbh_do( _dbh_execute => # retry over disconnects $sql, $bind, - $ident, + $self->_dbi_attrs_for_bind($ident, $bind), ); } diff --cc t/60core.t index ffb7d13,dc62500..3a674de --- a/t/60core.t +++ b/t/60core.t @@@ -300,16 -298,10 +300,18 @@@ is($or_rs->next->cdid, $rel_rs->next->c $or_rs->reset; $rel_rs->reset; +# at this point there should be no active statements +# (finish() was called everywhere, either explicitly via +# reset() or on DESTROY) +for (keys %{$schema->storage->dbh->{CachedKids}}) { + fail("Unreachable cached statement still active: $_") + if $schema->storage->dbh->{CachedKids}{$_}->FETCH('Active'); +} + my $tag = $schema->resultset('Tag')->search( - [ { 'me.tag' => 'Blue' } ], { cols=>[qw/tagid/] } )->next; + [ { 'me.tag' => 'Blue' } ], + { columns => 'tagid' } + )->next; ok($tag->has_column_loaded('tagid'), 'Has tagid loaded'); ok(!$tag->has_column_loaded('tag'), 'Has not tag loaded');