Merge 'trunk' into 'storage-interbase'
Rafael Kitover [Fri, 19 Feb 2010 11:17:57 +0000 (11:17 +0000)]
r23119@hlagh (orig r8601):  caelum | 2010-02-10 15:29:51 -0500
workaround for Moose bug affecting Replicated storage
r23120@hlagh (orig r8602):  caelum | 2010-02-10 15:40:07 -0500
revert Moose bug workaround, bump Moose dep for Replicated to 0.98
r23121@hlagh (orig r8603):  caelum | 2010-02-10 16:48:34 -0500
add a couple proxy methods to Replicated so it can run
r23133@hlagh (orig r8615):  caelum | 2010-02-11 05:35:01 -0500
 r21090@hlagh (orig r7836):  caelum | 2009-11-02 06:40:52 -0500
 new branch to fix unhandled methods in Storage::DBI::Replicated
 r21091@hlagh (orig r7837):  caelum | 2009-11-02 06:42:00 -0500
 add test to display unhandled methods
 r21092@hlagh (orig r7838):  caelum | 2009-11-02 06:55:34 -0500
 minor fix to last committed test
 r21093@hlagh (orig r7839):  caelum | 2009-11-02 09:26:00 -0500
 minor test code cleanup
 r23125@hlagh (orig r8607):  caelum | 2010-02-10 19:25:51 -0500
 add unimplemented Storage::DBI methods to ::DBI::Replicated
 r23130@hlagh (orig r8612):  ribasushi | 2010-02-11 05:12:48 -0500
 Podtesting exclusion

r23135@hlagh (orig r8617):  frew | 2010-02-11 05:45:54 -0500
Changes (from a while ago)
r23136@hlagh (orig r8618):  caelum | 2010-02-11 05:46:58 -0500
savepoints for SQLAnywhere
r23145@hlagh (orig r8627):  ribasushi | 2010-02-11 06:33:19 -0500
 r8424@Thesaurus (orig r8411):  ribasushi | 2010-01-22 11:19:40 +0100
 Chaining POC test

r23146@hlagh (orig r8628):  ribasushi | 2010-02-11 06:34:19 -0500
 r8426@Thesaurus (orig r8413):  ribasushi | 2010-01-22 11:35:15 +0100
 Moev failing regression test away from trunk

r23147@hlagh (orig r8629):  ribasushi | 2010-02-11 06:34:56 -0500

r23148@hlagh (orig r8630):  ribasushi | 2010-02-11 06:35:03 -0500
 r8507@Thesaurus (orig r8494):  frew | 2010-02-01 04:33:08 +0100
 small refactor to put select/as/+select/+as etc merging in it's own function

r23149@hlagh (orig r8631):  ribasushi | 2010-02-11 06:35:11 -0500
 r8514@Thesaurus (orig r8501):  frew | 2010-02-02 05:12:29 +0100
 revert actual changes from yesterday as per ribasushis advice

r23150@hlagh (orig r8632):  ribasushi | 2010-02-11 06:35:16 -0500
 r8522@Thesaurus (orig r8509):  frew | 2010-02-02 19:39:33 +0100
 delete +stuff if stuff exists

r23151@hlagh (orig r8633):  ribasushi | 2010-02-11 06:35:23 -0500
 r8534@Thesaurus (orig r8521):  frew | 2010-02-03 06:14:44 +0100
 change deletion/overriding to fix t/76

r23152@hlagh (orig r8634):  ribasushi | 2010-02-11 06:35:30 -0500
 r8535@Thesaurus (orig r8522):  frew | 2010-02-03 06:57:15 +0100
 some basic readability factorings (aka, fewer nested ternaries and long maps)

r23153@hlagh (orig r8635):  ribasushi | 2010-02-11 06:36:01 -0500
 r8558@Thesaurus (orig r8545):  frew | 2010-02-04 20:32:54 +0100
 fix incorrect test in t/76select.t and posit an incorrect solution

r23154@hlagh (orig r8636):  ribasushi | 2010-02-11 06:38:47 -0500

r23155@hlagh (orig r8637):  ribasushi | 2010-02-11 06:38:57 -0500
 r8578@Thesaurus (orig r8565):  ribasushi | 2010-02-05 19:11:09 +0100
 Should not be needed

r23156@hlagh (orig r8638):  ribasushi | 2010-02-11 06:39:03 -0500
 r8579@Thesaurus (orig r8566):  ribasushi | 2010-02-05 19:13:24 +0100
 SQLA now fixed

r23157@hlagh (orig r8639):  ribasushi | 2010-02-11 06:39:10 -0500
 r8624@Thesaurus (orig r8611):  ribasushi | 2010-02-11 10:31:08 +0100
 MOAR testing

r23158@hlagh (orig r8640):  ribasushi | 2010-02-11 06:39:17 -0500
 r8626@Thesaurus (orig r8613):  frew | 2010-02-11 11:16:30 +0100
 fix bad test

r23159@hlagh (orig r8641):  ribasushi | 2010-02-11 06:39:23 -0500
 r8627@Thesaurus (orig r8614):  frew | 2010-02-11 11:21:52 +0100
 fix t/76, break rsc tests

r23160@hlagh (orig r8642):  ribasushi | 2010-02-11 06:39:30 -0500
 r8632@Thesaurus (orig r8619):  frew | 2010-02-11 11:53:50 +0100
 fix incorrect test

r23161@hlagh (orig r8643):  ribasushi | 2010-02-11 06:39:35 -0500
 r8633@Thesaurus (orig r8620):  frew | 2010-02-11 11:54:49 +0100
 make t/76s and t/88 pass by deleting from the correct attr hash

r23162@hlagh (orig r8644):  ribasushi | 2010-02-11 06:39:40 -0500
 r8634@Thesaurus (orig r8621):  frew | 2010-02-11 11:55:41 +0100
 fix a test due to ordering issues

r23163@hlagh (orig r8645):  ribasushi | 2010-02-11 06:39:45 -0500
 r8635@Thesaurus (orig r8622):  frew | 2010-02-11 11:58:23 +0100
 this is why you run tests before you commit them.

r23164@hlagh (orig r8646):  ribasushi | 2010-02-11 06:39:51 -0500
 r8636@Thesaurus (orig r8623):  frew | 2010-02-11 12:00:59 +0100
 fix another ordering issue

r23165@hlagh (orig r8647):  ribasushi | 2010-02-11 06:39:57 -0500
 r8637@Thesaurus (orig r8624):  frew | 2010-02-11 12:11:31 +0100
 fix for search/select_chains

r23166@hlagh (orig r8648):  ribasushi | 2010-02-11 06:40:03 -0500

r23167@hlagh (orig r8649):  caelum | 2010-02-11 06:40:07 -0500
test nanosecond precision for SQLAnywhere
r23168@hlagh (orig r8650):  ribasushi | 2010-02-11 06:40:09 -0500
 r8639@Thesaurus (orig r8626):  ribasushi | 2010-02-11 12:33:03 +0100
 Changes and small ommission

r23171@hlagh (orig r8653):  ribasushi | 2010-02-11 12:16:45 -0500
Changes
r23179@hlagh (orig r8661):  ribasushi | 2010-02-12 03:12:45 -0500
Fix moose dep
r23185@hlagh (orig r8667):  dew | 2010-02-12 12:05:11 -0500
Add is_ordered to DBIC::ResultSet
r23193@hlagh (orig r8675):  ribasushi | 2010-02-13 03:36:29 -0500
 r8667@Thesaurus (orig r8654):  ribasushi | 2010-02-11 18:17:35 +0100
 Try a dep-handling idea
 r8675@Thesaurus (orig r8662):  ribasushi | 2010-02-12 12:46:11 +0100
 Move optional deps out of the Makefile
 r8676@Thesaurus (orig r8663):  ribasushi | 2010-02-12 13:40:53 +0100
 Support methods to verify group dependencies
 r8677@Thesaurus (orig r8664):  ribasushi | 2010-02-12 13:45:18 +0100
 Move sqlt dephandling to Optional::Deps
 r8679@Thesaurus (orig r8666):  ribasushi | 2010-02-12 14:03:17 +0100
 Move replicated to Opt::Deps
 r8684@Thesaurus (orig r8671):  ribasushi | 2010-02-13 02:47:52 +0100
 Auto-POD for Optional Deps
 r8685@Thesaurus (orig r8672):  ribasushi | 2010-02-13 02:53:20 +0100
 Privatize the full list method
 r8686@Thesaurus (orig r8673):  ribasushi | 2010-02-13 02:59:51 +0100
 Scary warning
 r8687@Thesaurus (orig r8674):  ribasushi | 2010-02-13 09:35:01 +0100
 Changes

r23196@hlagh (orig r8678):  ribasushi | 2010-02-13 04:07:15 -0500
Autogen comment for Dependencies.pod
r23197@hlagh (orig r8679):  ribasushi | 2010-02-13 04:11:24 -0500
Ask for newer M::I
r23203@hlagh (orig r8685):  ribasushi | 2010-02-13 05:11:10 -0500
Add author/license to pod
r23204@hlagh (orig r8686):  arcanez | 2010-02-13 07:43:22 -0500
fix typo per nuba on irc
r23210@hlagh (orig r8692):  ribasushi | 2010-02-13 09:15:33 -0500
 r8001@Thesaurus (orig r7989):  goraxe | 2009-11-30 01:14:47 +0100
 Branch for dbicadmin script refactor

 r8003@Thesaurus (orig r7991):  goraxe | 2009-11-30 01:26:39 +0100
 add DBIx::Class::Admin
 r8024@Thesaurus (orig r8012):  goraxe | 2009-12-02 22:49:27 +0100
 get deployment tests to pass
 r8025@Thesaurus (orig r8013):  goraxe | 2009-12-02 22:50:42 +0100
 get deployment tests to pass
 r8026@Thesaurus (orig r8014):  goraxe | 2009-12-02 23:52:40 +0100
 all ddl tests now pass
 r8083@Thesaurus (orig r8071):  goraxe | 2009-12-12 17:01:11 +0100
 add quite attribute to DBIx::Class admin
 r8086@Thesaurus (orig r8074):  goraxe | 2009-12-12 17:36:58 +0100
 add tests for data manipulation ported from 89dbicadmin.t
 r8088@Thesaurus (orig r8076):  goraxe | 2009-12-12 17:38:07 +0100
 add sleep 1 to t/admin/02ddl.t so insert into upgrade table does not happen too quickly
 r8089@Thesaurus (orig r8077):  goraxe | 2009-12-12 17:40:33 +0100
 update DBIx::Class::Admin data manip functions to pass the test
 r8095@Thesaurus (orig r8083):  goraxe | 2009-12-12 19:36:22 +0100
 change passing of preversion to be a parameter
 r8096@Thesaurus (orig r8084):  goraxe | 2009-12-12 19:38:26 +0100
 add some pod to DBIx::Class::Admin
 r8103@Thesaurus (orig r8091):  goraxe | 2009-12-12 22:08:55 +0100
 some changes to make DBIx::Class::Admin more compatible with dbicadmin interface
 r8104@Thesaurus (orig r8092):  goraxe | 2009-12-12 22:09:39 +0100
 commit refactored dbicadmin script and very minor changes to its existing test suite
 r8107@Thesaurus (orig r8095):  goraxe | 2009-12-12 22:34:35 +0100
 add compatability for --op for dbicadmin, revert test suite
 r8127@Thesaurus (orig r8115):  goraxe | 2009-12-15 22:14:20 +0100
 dep check to end of module
 r8128@Thesaurus (orig r8116):  goraxe | 2009-12-15 23:15:25 +0100
 add namespace::autoclean to DBIx::Class::Admin
 r8129@Thesaurus (orig r8117):  goraxe | 2009-12-15 23:16:00 +0100
 update test suite to skip if cannot load DBIx::Class::Admin
 r8130@Thesaurus (orig r8118):  goraxe | 2009-12-15 23:18:35 +0100
 add deps check for 89dbicadmin.t
 r8131@Thesaurus (orig r8119):  goraxe | 2009-12-15 23:19:01 +0100
 include deps for dbicadmin DBIx::Class::Admin to Makefile.PL
 r8149@Thesaurus (orig r8137):  goraxe | 2009-12-17 23:21:50 +0100
 use DBICTest::_database over creating a schema object to steal conn info
 r8338@Thesaurus (orig r8326):  goraxe | 2010-01-15 19:00:17 +0100
 change white space to not be tabs
 r8339@Thesaurus (orig r8327):  goraxe | 2010-01-15 19:10:42 +0100
 remove Module::Load from test suite
 r8358@Thesaurus (orig r8346):  ribasushi | 2010-01-17 17:52:10 +0100
 Real detabify
 r8359@Thesaurus (orig r8347):  ribasushi | 2010-01-17 18:01:53 +0100
 Fix POD (spacing matters)
 r8360@Thesaurus (orig r8348):  ribasushi | 2010-01-17 21:57:53 +0100
 More detabification
 r8361@Thesaurus (orig r8349):  ribasushi | 2010-01-17 22:33:12 +0100
 Test cleanup
 r8362@Thesaurus (orig r8350):  ribasushi | 2010-01-17 22:41:11 +0100
 More tets cleanup
 r8363@Thesaurus (orig r8351):  ribasushi | 2010-01-17 22:43:57 +0100
 And more cleanup
 r8364@Thesaurus (orig r8352):  ribasushi | 2010-01-17 22:51:21 +0100
 Disallow mucking with INC
 r8365@Thesaurus (orig r8353):  ribasushi | 2010-01-17 23:23:15 +0100
 More cleanup
 r8366@Thesaurus (orig r8354):  ribasushi | 2010-01-17 23:27:49 +0100
 Add lib path to ENV so that $^X can see it
 r8367@Thesaurus (orig r8355):  ribasushi | 2010-01-17 23:33:10 +0100
 Move script-test
 r8368@Thesaurus (orig r8356):  goraxe | 2010-01-17 23:35:03 +0100
 change warns/dies -> carp/throw_exception
 r8369@Thesaurus (orig r8357):  goraxe | 2010-01-17 23:53:54 +0100
 add goraxe to contributors
 r8370@Thesaurus (orig r8358):  goraxe | 2010-01-17 23:54:15 +0100
 remove comment headers
 r8404@Thesaurus (orig r8391):  caelum | 2010-01-20 20:54:29 +0100
 minor fixups
 r8405@Thesaurus (orig r8392):  goraxe | 2010-01-20 21:13:24 +0100
 add private types to coerce
 r8406@Thesaurus (orig r8393):  goraxe | 2010-01-20 21:17:19 +0100
 remove un-needed coerce from schema_class of type Str
 r8411@Thesaurus (orig r8398):  caelum | 2010-01-21 23:36:25 +0100
 minor documentation updates
 r8436@Thesaurus (orig r8423):  caelum | 2010-01-25 02:56:30 +0100
 this code never runs anyway
 r8440@Thesaurus (orig r8427):  caelum | 2010-01-26 14:05:53 +0100
 prefer JSON::DWIW for barekey support
 r8693@Thesaurus (orig r8680):  ribasushi | 2010-02-13 10:27:18 +0100
 dbicadmin dependencies
 r8694@Thesaurus (orig r8681):  ribasushi | 2010-02-13 10:28:04 +0100
 Some cleaup, make use of Text::CSV
 r8695@Thesaurus (orig r8682):  ribasushi | 2010-02-13 10:34:19 +0100
 We use Try::Tiny in a single spot, not grounds for inlusion in deps
 r8696@Thesaurus (orig r8683):  ribasushi | 2010-02-13 10:37:30 +0100
 POD section
 r8697@Thesaurus (orig r8684):  ribasushi | 2010-02-13 11:05:17 +0100
 Switch tests to Optional::Deps
 r8700@Thesaurus (orig r8687):  ribasushi | 2010-02-13 14:32:50 +0100
 Switch Admin/dbicadmin to Opt::Deps
 r8702@Thesaurus (orig r8689):  ribasushi | 2010-02-13 14:39:24 +0100
 JSON dep is needed for Admin.pm itself
 r8703@Thesaurus (orig r8690):  ribasushi | 2010-02-13 15:06:28 +0100
 Test fixes
 r8704@Thesaurus (orig r8691):  ribasushi | 2010-02-13 15:13:31 +0100
 Changes

r23212@hlagh (orig r8694):  ribasushi | 2010-02-13 10:37:57 -0500
Test for optional deps manager
r23215@hlagh (orig r8697):  caelum | 2010-02-13 23:22:03 -0500
add doc on maximum cursors for SQLAnywhere
r23216@hlagh (orig r8698):  ribasushi | 2010-02-14 03:23:09 -0500
Cleanup dependencies / Admin inheritance
r23217@hlagh (orig r8699):  ribasushi | 2010-02-14 03:28:29 -0500
Some formatting
r23220@hlagh (orig r8702):  ribasushi | 2010-02-14 04:46:51 -0500
This is Moose, so use CMOP
r23225@hlagh (orig r8707):  ribasushi | 2010-02-15 04:28:22 -0500
Final POD touches
r23226@hlagh (orig r8708):  ribasushi | 2010-02-15 04:31:38 -0500
Spellcheck (jawnsy++)
r23227@hlagh (orig r8709):  ribasushi | 2010-02-15 04:32:24 -0500
One more
r23228@hlagh (orig r8710):  ribasushi | 2010-02-15 08:49:26 -0500
Release 0.08119
r23230@hlagh (orig r8712):  ribasushi | 2010-02-15 08:50:56 -0500
Bump trunl version
r23231@hlagh (orig r8713):  rafl | 2010-02-15 09:49:55 -0500
Make sure we actually run all tests, given we're using done_testing.
r23232@hlagh (orig r8714):  rafl | 2010-02-15 09:50:01 -0500
Make sure overriding deployment_statements is possible from within schemas.
r23233@hlagh (orig r8715):  rafl | 2010-02-15 09:56:06 -0500
Changelogging.
r23234@hlagh (orig r8716):  rafl | 2010-02-15 09:58:09 -0500
Make some cookbook code compile.
r23235@hlagh (orig r8717):  nuba | 2010-02-15 10:11:52 -0500
spelling fixes in the documaentation, sholud be gud now ;)
r23237@hlagh (orig r8719):  caelum | 2010-02-16 05:09:58 -0500
use OO interface of Hash::Merge for ::DBI::Replicated
r23239@hlagh (orig r8721):  ribasushi | 2010-02-16 05:41:06 -0500
Augment did-author-run-makefile check to include OptDeps
r23240@hlagh (orig r8722):  ribasushi | 2010-02-16 06:16:06 -0500
Reorg support section, add live-chat link
r23244@hlagh (orig r8726):  caelum | 2010-02-16 08:51:58 -0500
set behavior for Hash::Merge in ::DBI::Replicated, otherwise it uses the global setting
r23245@hlagh (orig r8727):  caelum | 2010-02-16 09:43:25 -0500
POD touchups
r23346@hlagh (orig r8746):  ribasushi | 2010-02-18 18:30:37 -0500
Fix bogus test
r23347@hlagh (orig r8747):  ribasushi | 2010-02-18 18:34:22 -0500
Retire useless abstraction (all rdbms need this anyway)
r23348@hlagh (orig r8748):  ribasushi | 2010-02-18 18:35:01 -0500
Fix count of group_by over aliased function
r23352@hlagh (orig r8752):  ribasushi | 2010-02-19 04:11:20 -0500
 r8497@Thesaurus (orig r8484):  ribasushi | 2010-01-31 10:06:29 +0100
 Branch to unify mandatory PK handling
 r8498@Thesaurus (orig r8485):  ribasushi | 2010-01-31 10:20:36 +0100
 This is not really used for anything (same code in DBI)
 r8499@Thesaurus (orig r8486):  ribasushi | 2010-01-31 10:25:55 +0100
 Helper primary_columns wrapper to throw if a PK is not defined
 r8500@Thesaurus (orig r8487):  ribasushi | 2010-01-31 11:07:25 +0100
 Stupid errors
 r8501@Thesaurus (orig r8488):  ribasushi | 2010-01-31 12:18:57 +0100
 Saner handling of nonexistent/partial conditions
 r8762@Thesaurus (orig r8749):  ribasushi | 2010-02-19 10:07:40 +0100
 trap unresolvable conditions due to incomplete relationship specification
 r8764@Thesaurus (orig r8751):  ribasushi | 2010-02-19 10:11:09 +0100
 Changes

r23354@hlagh (orig r8754):  ribasushi | 2010-02-19 05:14:30 -0500
Fix for RT54697

1  2 
lib/DBIx/Class/Row.pm
lib/DBIx/Class/Storage/DBI.pm

diff --combined lib/DBIx/Class/Row.pm
@@@ -347,26 -347,6 +347,26 @@@ sub insert 
      $self->store_column($auto_pri[$_] => $ids[$_]) for 0 .. $#ids;
    }
  
 +  # get non-PK auto-incs
 +  {
 +    my $rsrc = $self->result_source;
 +    my %pk;
 +    @pk{ $rsrc->primary_columns } = (); 
 +
 +    my @non_pk_autoincs = grep {
 +      (not exists $pk{$_})
 +      && (not defined $self->get_column($_))
 +      && $rsrc->column_info($_)->{is_auto_increment}
 +    } $rsrc->columns;
 +
 +    if (@non_pk_autoincs) {
 +      my @ids = $rsrc->storage->last_insert_id($rsrc, @non_pk_autoincs);
 +
 +      if (@ids == @non_pk_autoincs) {
 +        $self->store_column($non_pk_autoincs[$_] => $ids[$_]) for 0 .. $#ids;
 +      }
 +    }
 +  }
  
    $self->{_dirty_columns} = {};
    $self->{related_resultsets} = {};
@@@ -470,7 -450,7 +470,7 @@@ need to preserve the hashref, it is suf
  to C<update>, e.g. ( { %{ $href } } )
  
  If the values passed or any of the column values set on the object
- contain scalar references, eg:
+ contain scalar references, e.g.:
  
    $row->last_modified(\'NOW()');
    # OR
@@@ -918,7 -898,7 +918,7 @@@ Will even accept arrayrefs of data as 
  L<DBIx::Class::Relationship/has_many> key, and create the related
  objects if necessary.
  
- Be aware that the input hashref might be edited in place, so dont rely
+ Be aware that the input hashref might be edited in place, so don't rely
  on it being the same after a call to C<set_inflated_columns>. If you
  need to preserve the hashref, it is sufficient to pass a shallow copy
  to C<set_inflated_columns>, e.g. ( { %{ $href } } )
@@@ -972,7 -952,7 +972,7 @@@ so that the database can insert its ow
  the new object.
  
  Relationships will be followed by the copy procedure B<only> if the
- relationship specifes a true value for its
+ relationship specifies a true value for its
  L<cascade_copy|DBIx::Class::Relationship::Base> attribute. C<cascade_copy>
  is set by default on C<has_many> relationships and unset on all others.
  
@@@ -995,7 -975,7 +995,7 @@@ sub copy 
    $new->insert;
  
    # Its possible we'll have 2 relations to the same Source. We need to make
-   # sure we don't try to insert the same row twice esle we'll violate unique
+   # sure we don't try to insert the same row twice else we'll violate unique
    # constraints
    my $rels_copied = {};
  
@@@ -16,11 -16,6 +16,6 @@@ use List::Util()
  use Data::Dumper::Concise();
  use Sub::Name ();
  
- # what version of sqlt do we require if deploy() without a ddl_dir is invoked
- # when changing also adjust the corresponding author_require in Makefile.PL
- my $minimum_sqlt_version = '0.11002';
  __PACKAGE__->mk_group_accessors('simple' =>
    qw/_connect_info _dbi_connect_info _dbh _sql_maker _sql_maker_opts _conn_pid
       _conn_tid transaction_depth _dbh_autocommit _driver_determined savepoints/
@@@ -195,7 -190,7 +190,7 @@@ for most DBDs. See L</DBIx::Class and A
  In addition to the standard L<DBI|DBI/ATTRIBUTES_COMMON_TO_ALL_HANDLES>
  L<connection|DBI/Database_Handle_Attributes> attributes, DBIx::Class recognizes
  the following connection options. These options can be mixed in with your other
- L<DBI> connection attributes, or placed in a seperate hashref
+ L<DBI> connection attributes, or placed in a separate hashref
  (C<\%extra_attributes>) as shown above.
  
  Every time C<connect_info> is invoked, any previous settings for
@@@ -347,7 -342,7 +342,7 @@@ SQL Server you should use C<< quote_cha
  =item name_sep
  
  This only needs to be used in conjunction with C<quote_char>, and is used to
- specify the charecter that seperates elements (schemas, tables, columns) from
+ specify the character that separates elements (schemas, tables, columns) from
  each other. In most cases this is simply a C<.>.
  
  The consequences of not supplying this value is that L<SQL::Abstract>
@@@ -783,8 -778,8 +778,8 @@@ sub with_deferred_fk_checks 
  
  =back
  
- Verifies that the the current database handle is active and ready to execute
- an SQL statement (i.e. the connection did not get stale, server is still
+ Verifies that the current database handle is active and ready to execute
+ an SQL statement (e.g. the connection did not get stale, server is still
  answering, etc.) This method is used internally by L</dbh>.
  
  =cut
@@@ -1518,11 -1513,7 +1513,11 @@@ sub _execute_array 
  
      my @data = map { $_->[$data_index] } @$data;
  
 -    $sth->bind_param_array( $placeholder_index, [@data], $attributes );
 +    $sth->bind_param_array(
 +      $placeholder_index,
 +      [@data],
 +      (%$attributes ?  $attributes : ()),
 +    );
      $placeholder_index++;
    }
  
@@@ -1610,15 -1601,7 +1605,7 @@@ sub _subq_update_delete 
    my $rsrc = $rs->result_source;
  
    # quick check if we got a sane rs on our hands
-   my @pcols = $rsrc->primary_columns;
-   unless (@pcols) {
-     $self->throw_exception (
-       sprintf (
-         "You must declare primary key(s) on source '%s' (via set_primary_key) in order to update or delete complex resultsets",
-         $rsrc->source_name || $rsrc->from
-       )
-     );
-   }
+   my @pcols = $rsrc->_pri_cols;
  
    my $sel = $rs->_resolved_attrs->{select};
    $sel = [ $sel ] unless ref $sel eq 'ARRAY';
@@@ -1671,7 -1654,7 +1658,7 @@@ sub _per_row_update_delete 
    my ($rs, $op, $values) = @_;
  
    my $rsrc = $rs->result_source;
-   my @pcols = $rsrc->primary_columns;
+   my @pcols = $rsrc->_pri_cols;
  
    my $guard = $self->txn_scope_guard;
  
@@@ -1905,7 -1888,33 +1892,33 @@@ sub _count_select 
  #
  sub _subq_count_select {
    my ($self, $source, $rs_attrs) = @_;
-   return $rs_attrs->{group_by} if $rs_attrs->{group_by};
+   if (my $groupby = $rs_attrs->{group_by}) {
+     my $avail_columns = $self->_resolve_column_info ($rs_attrs->{from});
+     my $sel_index;
+     for my $sel (@{$rs_attrs->{select}}) {
+       if (ref $sel eq 'HASH' and $sel->{-as}) {
+         $sel_index->{$sel->{-as}} = $sel;
+       }
+     }
+     my @selection;
+     for my $g_part (@$groupby) {
+       if (ref $g_part or $avail_columns->{$g_part}) {
+         push @selection, $g_part;
+       }
+       elsif ($sel_index->{$g_part}) {
+         push @selection, $sel_index->{$g_part};
+       }
+       else {
+         $self->throw_exception ("group_by criteria '$g_part' not contained within current resultset source(s)");
+       }
+     }
+     return \@selection;
+   }
  
    my @pcols = map { join '.', $rs_attrs->{alias}, $_ } ($source->primary_columns);
    return @pcols ? \@pcols : [ 1 ];
@@@ -2255,8 -2264,9 +2268,9 @@@ sub create_ddl_dir 
      %{$sqltargs || {}}
    };
  
-   $self->throw_exception("Can't create a ddl file without SQL::Translator: " . $self->_sqlt_version_error)
-     if !$self->_sqlt_version_ok;
+   unless (DBIx::Class::Optional::Dependencies->req_ok_for ('deploy')) {
+     $self->throw_exception("Can't create a ddl file without " . DBIx::Class::Optional::Dependencies->req_missing_for ('deploy') );
+   }
  
    my $sqlt = SQL::Translator->new( $sqltargs );
  
@@@ -2398,8 -2408,9 +2412,9 @@@ sub deployment_statements 
        return join('', @rows);
    }
  
-   $self->throw_exception("Can't deploy without either SQL::Translator or a ddl_dir: " . $self->_sqlt_version_error )
-     if !$self->_sqlt_version_ok;
+   unless (DBIx::Class::Optional::Dependencies->req_ok_for ('deploy') ) {
+     $self->throw_exception("Can't deploy without a ddl_dir or " . DBIx::Class::Optional::Dependencies->req_missing_for ('deploy') );
+   }
  
    # sources needs to be a parser arg, but for simplicty allow at top level
    # coming in
@@@ -2449,7 -2460,7 +2464,7 @@@ sub deploy 
      }
      $self->_query_end($line);
    };
-   my @statements = $self->deployment_statements($schema, $type, undef, $dir, { %{ $sqltargs || {} }, no_comments => 1 } );
+   my @statements = $schema->deployment_statements($type, undef, $dir, { %{ $sqltargs || {} }, no_comments => 1 } );
    if (@statements > 1) {
      foreach my $statement (@statements) {
        $deploy->( $statement );
@@@ -2523,33 -2534,6 +2538,6 @@@ sub lag_behind_master 
      return;
  }
  
- # SQLT version handling
- {
-   my $_sqlt_version_ok;     # private
-   my $_sqlt_version_error;  # private
-   sub _sqlt_version_ok {
-     if (!defined $_sqlt_version_ok) {
-       eval "use SQL::Translator $minimum_sqlt_version";
-       if ($@) {
-         $_sqlt_version_ok = 0;
-         $_sqlt_version_error = $@;
-       }
-       else {
-         $_sqlt_version_ok = 1;
-       }
-     }
-     return $_sqlt_version_ok;
-   }
-   sub _sqlt_version_error {
-     shift->_sqlt_version_ok unless defined $_sqlt_version_ok;
-     return $_sqlt_version_error;
-   }
-   sub _sqlt_minimum_version { $minimum_sqlt_version };
- }
  =head2 relname_to_table_alias
  
  =over 4