From: Peter Rabbitson Date: Sat, 8 Aug 2009 15:51:23 +0000 (+0000) Subject: Merge 'trunk' into 'table_name_ref' X-Git-Tag: v0.08109~29^2~2 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=13bf737a843f9dcdbf746c28ec4de63439d0e081;hp=-c;p=dbsrgits%2FDBIx-Class.git Merge 'trunk' into 'table_name_ref' r7256@Thesaurus (orig r7253): ribasushi | 2009-08-07 11:19:35 +0200 r7232@Thesaurus (orig r7229): jnapiorkowski | 2009-08-05 16:56:32 +0200 added test for the new default force pool behavior in PK->discard_changes and cleaned up the related tests a bit to give more meaningful info r7233@Thesaurus (orig r7230): jnapiorkowski | 2009-08-05 16:57:45 +0200 opps typo in test status messages r7234@Thesaurus (orig r7231): jnapiorkowski | 2009-08-05 17:03:46 +0200 added the default attrs to solve the failing test recently commited r7235@Thesaurus (orig r7232): jnapiorkowski | 2009-08-05 17:58:44 +0200 added test to make sure you can override the default attributes to discard_changes r7241@Thesaurus (orig r7238): jnapiorkowski | 2009-08-05 22:00:58 +0200 added replication as an optional feature to make installing it easier r7253@Thesaurus (orig r7250): ribasushi | 2009-08-07 11:06:41 +0200 Streamline makefile dep handling r7254@Thesaurus (orig r7251): ribasushi | 2009-08-07 11:07:14 +0200 Switch to done_testing r7255@Thesaurus (orig r7252): ribasushi | 2009-08-07 11:19:13 +0200 Move discard_changes code to Row.pm, better docs r7257@Thesaurus (orig r7254): ribasushi | 2009-08-07 11:21:35 +0200 Remove merged branch r7259@Thesaurus (orig r7256): ribasushi | 2009-08-07 14:16:13 +0200 Fix bogus POD r7261@Thesaurus (orig r7258): ribasushi | 2009-08-07 17:22:58 +0200 per mst: no optional deps r7262@Thesaurus (orig r7259): ribasushi | 2009-08-08 17:02:39 +0200 Stop using discard_changes() in Ordered (if I knew it will be *that* complex I would not touch it) r7265@Thesaurus (orig r7262): ribasushi | 2009-08-08 17:49:19 +0200 r7032@Thesaurus (orig r7031): caelum | 2009-07-11 11:28:52 +0200 new branch to reduce connected() calls r7033@Thesaurus (orig r7032): caelum | 2009-07-11 13:07:41 +0200 added failing test r7034@Thesaurus (orig r7033): caelum | 2009-07-11 14:36:53 +0200 minor optimization r7048@Thesaurus (orig r7047): caelum | 2009-07-14 15:09:47 +0200 substantially reduced ping count, dynamic cursors support for mssql through odbc r7050@Thesaurus (orig r7049): caelum | 2009-07-14 16:06:39 +0200 a couple more options for odbc/mssql r7052@Thesaurus (orig r7051): caelum | 2009-07-15 00:14:09 +0200 unfuck ensure_connected for odbc/mssql r7055@Thesaurus (orig r7054): caelum | 2009-07-15 21:10:27 +0200 rename _scope_identity to _identity for odbc/mssql r7056@Thesaurus (orig r7055): caelum | 2009-07-16 00:41:45 +0200 add IC::DT tests for odbc/mssql r7069@Thesaurus (orig r7068): caelum | 2009-07-17 11:47:31 +0200 don't run connection actions if ->_rebless does not connect r7108@Thesaurus (orig r7105): caelum | 2009-07-24 07:26:13 +0200 moving test to another branch r7110@Thesaurus (orig r7107): caelum | 2009-07-24 07:52:33 +0200 revert odbc/mssql code to trunk and move it to another branch r7111@Thesaurus (orig r7108): caelum | 2009-07-24 08:13:35 +0200 revert t/746mssql.t to trunk and move to another branch r7224@Thesaurus (orig r7221): caelum | 2009-08-05 11:48:04 +0200 update branch after pull r7225@Thesaurus (orig r7222): ribasushi | 2009-08-05 12:09:07 +0200 Rename last_dbh and turn it into a public method r7226@Thesaurus (orig r7223): ribasushi | 2009-08-05 12:12:20 +0200 Whoopsie - more renames r7227@Thesaurus (orig r7224): ribasushi | 2009-08-05 12:32:09 +0200 Changes and a deploy() fix r7228@Thesaurus (orig r7225): ribasushi | 2009-08-05 12:36:01 +0200 We do not count pings during deploy - they are expected r7229@Thesaurus (orig r7226): ribasushi | 2009-08-05 12:49:06 +0200 Clarify autocommit default r7238@Thesaurus (orig r7235): caelum | 2009-08-05 20:39:47 +0200 fix up txn_begin and the ping_count test r7263@Thesaurus (orig r7260): ribasushi | 2009-08-08 17:40:19 +0200 A more straightforward txn_begin fix, some more test fixes --- 13bf737a843f9dcdbf746c28ec4de63439d0e081 diff --combined lib/DBIx/Class/Storage/DBI/Pg.pm index b113a97,7723a21..91418a4 --- a/lib/DBIx/Class/Storage/DBI/Pg.pm +++ b/lib/DBIx/Class/Storage/DBI/Pg.pm @@@ -15,7 -15,7 +15,7 @@@ warn "DBD::Pg 2.9.2 or greater is stron sub with_deferred_fk_checks { my ($self, $sub) = @_; - $self->dbh->do('SET CONSTRAINTS ALL DEFERRED'); + $self->last_dbh->do('SET CONSTRAINTS ALL DEFERRED'); $sub->(); } @@@ -52,16 -52,8 +52,16 @@@ sub get_autoinc_seq my ($self,$source,$col) = @_; my @pri = $source->primary_columns; - my ($schema,$table) = $source->name =~ /^(.+)\.(.+)$/ ? ($1,$2) - : (undef,$source->name); + + my $schema; + my $table = $source->name; + + if (ref $table eq 'SCALAR') { + $table = $$table; + } + elsif ($table =~ /^(.+)\.(.+)$/) { + ($schema, $table) = ($1, $2); + } $self->dbh_do('_dbh_get_autoinc_seq', $schema, $table, @pri); } @@@ -90,26 -82,26 +90,26 @@@ sub bind_attribute_by_data_type sub _sequence_fetch { my ( $self, $type, $seq ) = @_; - my ($id) = $self->dbh->selectrow_array("SELECT nextval('${seq}')"); + my ($id) = $self->last_dbh->selectrow_array("SELECT nextval('${seq}')"); return $id; } sub _svp_begin { my ($self, $name) = @_; - $self->dbh->pg_savepoint($name); + $self->last_dbh->pg_savepoint($name); } sub _svp_release { my ($self, $name) = @_; - $self->dbh->pg_release($name); + $self->last_dbh->pg_release($name); } sub _svp_rollback { my ($self, $name) = @_; - $self->dbh->pg_rollback_to($name); + $self->last_dbh->pg_rollback_to($name); } 1;