[Bast-commits] r6282 - in DBIx-Class/0.08/branches/joined_count: . lib/DBIx/Class lib/DBIx/Class/Manual lib/DBIx/Class/Storage lib/DBIx/Class/Storage/DBI lib/DBIx/Class/Storage/DBI/Replicated lib/DBIx/Class/Storage/DBI/Replicated/Balancer t t/lib t/lib/DBICTest t/lib/DBICTest/Schema t/prefetch

ribasushi at dev.catalyst.perl.org ribasushi at dev.catalyst.perl.org
Sat May 16 07:35:47 GMT 2009


Author: ribasushi
Date: 2009-05-16 07:35:47 +0000 (Sat, 16 May 2009)
New Revision: 6282

Added:
   DBIx-Class/0.08/branches/joined_count/lib/DBIx/Class/Storage/DBI/Replicated/Types.pm
   DBIx-Class/0.08/branches/joined_count/lib/DBIx/Class/Storage/DBI/Replicated/WithDSN.pm
   DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/BaseResult.pm
   DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/BaseResultSet.pm
Modified:
   DBIx-Class/0.08/branches/joined_count/
   DBIx-Class/0.08/branches/joined_count/Changes
   DBIx-Class/0.08/branches/joined_count/Makefile.PL
   DBIx-Class/0.08/branches/joined_count/lib/DBIx/Class/Manual/Cookbook.pod
   DBIx-Class/0.08/branches/joined_count/lib/DBIx/Class/Ordered.pm
   DBIx-Class/0.08/branches/joined_count/lib/DBIx/Class/Storage/DBI/Replicated.pm
   DBIx-Class/0.08/branches/joined_count/lib/DBIx/Class/Storage/DBI/Replicated/Balancer.pm
   DBIx-Class/0.08/branches/joined_count/lib/DBIx/Class/Storage/DBI/Replicated/Balancer/First.pm
   DBIx-Class/0.08/branches/joined_count/lib/DBIx/Class/Storage/DBI/Replicated/Balancer/Random.pm
   DBIx-Class/0.08/branches/joined_count/lib/DBIx/Class/Storage/DBI/Replicated/Pool.pm
   DBIx-Class/0.08/branches/joined_count/lib/DBIx/Class/Storage/DBI/Replicated/Replicant.pm
   DBIx-Class/0.08/branches/joined_count/lib/DBIx/Class/Storage/Statistics.pm
   DBIx-Class/0.08/branches/joined_count/t/60core.t
   DBIx-Class/0.08/branches/joined_count/t/66relationship.t
   DBIx-Class/0.08/branches/joined_count/t/76joins.t
   DBIx-Class/0.08/branches/joined_count/t/82cascade_copy.t
   DBIx-Class/0.08/branches/joined_count/t/83cache.t
   DBIx-Class/0.08/branches/joined_count/t/93storage_replication.t
   DBIx-Class/0.08/branches/joined_count/t/96multi_create.t
   DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest.pm
   DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/Schema/Artist.pm
   DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/Schema/ArtistUndirectedMap.pm
   DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/Schema/Artwork.pm
   DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/Schema/Artwork_to_Artist.pm
   DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/Schema/BindType.pm
   DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/Schema/Bookmark.pm
   DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/Schema/BooksInLibrary.pm
   DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/Schema/CD.pm
   DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/Schema/CD_to_Producer.pm
   DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/Schema/Collection.pm
   DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/Schema/CollectionObject.pm
   DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/Schema/Dummy.pm
   DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/Schema/Employee.pm
   DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/Schema/Encoded.pm
   DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/Schema/Event.pm
   DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/Schema/EventTZ.pm
   DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/Schema/EventTZDeprecated.pm
   DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/Schema/FileColumn.pm
   DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/Schema/ForceForeign.pm
   DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/Schema/FourKeys.pm
   DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/Schema/FourKeys_to_TwoKeys.pm
   DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/Schema/Genre.pm
   DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/Schema/Image.pm
   DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/Schema/LinerNotes.pm
   DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/Schema/Link.pm
   DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/Schema/LyricVersion.pm
   DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/Schema/Lyrics.pm
   DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/Schema/NoPrimaryKey.pm
   DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/Schema/OneKey.pm
   DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/Schema/Owners.pm
   DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/Schema/Producer.pm
   DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/Schema/SelfRef.pm
   DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/Schema/SelfRefAlias.pm
   DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/Schema/SequenceTest.pm
   DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/Schema/Serialized.pm
   DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/Schema/Tag.pm
   DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/Schema/Track.pm
   DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/Schema/TreeLike.pm
   DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/Schema/TwoKeyTreeLike.pm
   DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/Schema/TwoKeys.pm
   DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/Schema/TypedObject.pm
   DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/Schema/Year1999CDs.pm
   DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/Schema/Year2000CDs.pm
   DBIx-Class/0.08/branches/joined_count/t/prefetch/attrs_untouched.t
   DBIx-Class/0.08/branches/joined_count/t/prefetch/multiple_hasmany.t
   DBIx-Class/0.08/branches/joined_count/t/prefetch/pollute_already_joined.t
   DBIx-Class/0.08/branches/joined_count/t/prefetch/standard.t
   DBIx-Class/0.08/branches/joined_count/t/resultset_class.t
Log:
 r6264 at Thesaurus (orig r6263):  ribasushi | 2009-05-14 15:40:19 +0200
  r6121 at Thesaurus (orig r6120):  caelum | 2009-05-04 17:13:22 +0200
  Making new branch for storage tweaking
  r6122 at Thesaurus (orig r6121):  caelum | 2009-05-04 20:07:47 +0200
  support hashrefs for connect_replicants
  r6123 at Thesaurus (orig r6122):  caelum | 2009-05-04 23:07:43 +0200
  ::Replicated - test hashref for connect_replicants and croak on coderef, switch to MX::Types, make test less noisy
  r6143 at Thesaurus (orig r6142):  caelum | 2009-05-06 05:13:56 +0200
  fix ::DBI::Replicated::all_storages
  r6144 at Thesaurus (orig r6143):  caelum | 2009-05-06 05:25:04 +0200
  Replicated - fixup types and namespace::clean
  r6147 at Thesaurus (orig r6146):  caelum | 2009-05-06 15:29:39 +0200
  ::DBI:Replicated - merge connect_info from master to replicants
  r6184 at Thesaurus (orig r6183):  caelum | 2009-05-08 18:08:29 +0200
  support ::DBI::Replicated opts in connect_info
  r6190 at Thesaurus (orig r6189):  caelum | 2009-05-09 05:31:15 +0200
  ::DBI::Replicated - add master_read_weight to ::Random balancer_type
  r6191 at Thesaurus (orig r6190):  caelum | 2009-05-09 12:50:25 +0200
  ::DBI::Replicated - fix fallback to master, test for the warning, other cleanups
  r6193 at Thesaurus (orig r6192):  caelum | 2009-05-09 13:52:52 +0200
  updated Changes
  r6194 at Thesaurus (orig r6193):  caelum | 2009-05-09 14:21:44 +0200
  ::DBI::Replicated - don't build pool/balancer from connect_info unless necessary
 
 r6268 at Thesaurus (orig r6267):  caelum | 2009-05-15 04:04:12 +0200
 minor replication changes - use a real hash merge, clarify master_read_weight, really done with this now.
 r6272 at Thesaurus (orig r6271):  abraxxa | 2009-05-15 13:45:54 +0200
 added Static sub-classing DBIx::Class result classes section to the cookbook
 
 r6277 at Thesaurus (orig r6276):  ribasushi | 2009-05-16 00:46:00 +0200
 Optimize some Ordered.pm code
 r6278 at Thesaurus (orig r6277):  ribasushi | 2009-05-16 08:02:18 +0200
 Cleanup tests
 r6280 at Thesaurus (orig r6279):  ribasushi | 2009-05-16 09:30:05 +0200
 Not sure what this part of the test is for, but it breaks custom resultsets, and the test passes without it. Removing as a possible remnant of an ancient civilization
 r6281 at Thesaurus (orig r6280):  ribasushi | 2009-05-16 09:33:24 +0200
 Add default resultclass/resultsetclass to the entire test schema, as I am tired of typing extra shit for debugging purposes
 r6282 at Thesaurus (orig r6281):  ribasushi | 2009-05-16 09:34:21 +0200
 Now we can do diag $rs->hri_dump, ain't that nice



Property changes on: DBIx-Class/0.08/branches/joined_count
___________________________________________________________________
Name: svk:merge
   - 168d5346-440b-0410-b799-f706be625ff1:/DBIx-Class-current:2207
462d4d0c-b505-0410-bf8e-ce8f877b3390:/local/bast/DBIx-Class:3159
4d5fae46-8e6a-4e08-abee-817e9fb894a2:/local/bast/DBIx-Class/0.08/branches/resultsetcolumn_custom_columns:5160
4d5fae46-8e6a-4e08-abee-817e9fb894a2:/local/bast/DBIx-Class/0.08/branches/sqla_1.50_compat:5414
4d5fae46-8e6a-4e08-abee-817e9fb894a2:/local/bast/DBIx-Class/0.08/trunk:5969
9c88509d-e914-0410-b01c-b9530614cbfe:/local/DBIx-Class:32260
9c88509d-e914-0410-b01c-b9530614cbfe:/local/DBIx-Class-CDBICompat:54993
9c88509d-e914-0410-b01c-b9530614cbfe:/vendor/DBIx-Class:31122
ab17426e-7cd3-4704-a2a2-80b7c0a611bb:/local/dbic_column_attr:10946
ab17426e-7cd3-4704-a2a2-80b7c0a611bb:/local/dbic_trunk:11142
bd5ac9a7-f185-4d95-9186-dbb8b392a572:/local/os/bast/DBIx-Class/0.08/trunk:2798
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/DBIx-Class/0.08/branches/belongs_to_null_col_fix:5244
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/DBIx-Class/0.08/branches/cdbicompat_integration:4160
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/DBIx-Class/0.08/branches/column_attr:5074
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/DBIx-Class/0.08/branches/complex_join_rels:4589
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/DBIx-Class/0.08/branches/count_distinct:6218
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/DBIx-Class/0.08/branches/file_column:3920
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/DBIx-Class/0.08/branches/fix-update-and-delete-as_query:6162
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/DBIx-Class/0.08/branches/multi_stuff:5565
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/DBIx-Class/0.08/branches/on_disconnect_do:3694
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/DBIx-Class/0.08/branches/oracle-tweaks:6222
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/DBIx-Class/0.08/branches/oracle_sequence:4173
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/DBIx-Class/0.08/branches/parser_fk_index:4485
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/DBIx-Class/0.08/branches/prefetch:5699
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/DBIx-Class/0.08/branches/replication_dedux:4600
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/DBIx-Class/0.08/branches/rt_bug_41083:5437
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/DBIx-Class/0.08/branches/savepoints:4223
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/DBIx-Class/0.08/branches/sqla_1.50_compat:5321
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/DBIx-Class/0.08/branches/storage-ms-access:4142
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/DBIx-Class/0.08/branches/subclassed_rsset:5930
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/DBIx-Class/0.08/branches/subquery:5617
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/DBIx-Class/0.08/branches/sybase:5651
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/DBIx-Class/0.08/branches/sybase_mssql:6125
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/DBIx-Class/0.08/branches/versioned_enhancements:4125
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/DBIx-Class/0.08/branches/versioning:4578
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/DBIx-Class/0.08/branches/views:5585
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class-C3:318
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class-current:2222
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class-joins:173
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class-resultset:570
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class/datetime:1716
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class/find_compat:1855
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class/find_unique_query_fixes:2142
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class/inflate:1988
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class/many_to_many:2025
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class/re_refactor_bugfix:1944
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class/reorganize_tests:1827
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class/resultset-new-refactor:1766
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class/resultset_2_electric_boogaloo:2175
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class/resultset_cleanup:2102
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class/sqlt_tests_refactor:2043
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/trunk/DBIx-Class:3606
fe160bb6-dc1c-0410-9f2b-d64a711b54a5:/local/DBIC-trunk-0.08:10510
   + 168d5346-440b-0410-b799-f706be625ff1:/DBIx-Class-current:2207
462d4d0c-b505-0410-bf8e-ce8f877b3390:/local/bast/DBIx-Class:3159
4d5fae46-8e6a-4e08-abee-817e9fb894a2:/local/bast/DBIx-Class/0.08/branches/resultsetcolumn_custom_columns:5160
4d5fae46-8e6a-4e08-abee-817e9fb894a2:/local/bast/DBIx-Class/0.08/branches/sqla_1.50_compat:5414
4d5fae46-8e6a-4e08-abee-817e9fb894a2:/local/bast/DBIx-Class/0.08/trunk:5969
9c88509d-e914-0410-b01c-b9530614cbfe:/local/DBIx-Class:32260
9c88509d-e914-0410-b01c-b9530614cbfe:/local/DBIx-Class-CDBICompat:54993
9c88509d-e914-0410-b01c-b9530614cbfe:/vendor/DBIx-Class:31122
ab17426e-7cd3-4704-a2a2-80b7c0a611bb:/local/dbic_column_attr:10946
ab17426e-7cd3-4704-a2a2-80b7c0a611bb:/local/dbic_trunk:11142
bd5ac9a7-f185-4d95-9186-dbb8b392a572:/local/os/bast/DBIx-Class/0.08/trunk:2798
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/DBIx-Class/0.08/branches/belongs_to_null_col_fix:5244
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/DBIx-Class/0.08/branches/cdbicompat_integration:4160
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/DBIx-Class/0.08/branches/column_attr:5074
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/DBIx-Class/0.08/branches/complex_join_rels:4589
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/DBIx-Class/0.08/branches/count_distinct:6218
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/DBIx-Class/0.08/branches/file_column:3920
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/DBIx-Class/0.08/branches/fix-update-and-delete-as_query:6162
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/DBIx-Class/0.08/branches/multi_stuff:5565
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/DBIx-Class/0.08/branches/on_disconnect_do:3694
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/DBIx-Class/0.08/branches/oracle-tweaks:6222
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/DBIx-Class/0.08/branches/oracle_sequence:4173
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/DBIx-Class/0.08/branches/parser_fk_index:4485
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/DBIx-Class/0.08/branches/prefetch:5699
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/DBIx-Class/0.08/branches/replication_dedux:4600
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/DBIx-Class/0.08/branches/rt_bug_41083:5437
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/DBIx-Class/0.08/branches/savepoints:4223
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/DBIx-Class/0.08/branches/sqla_1.50_compat:5321
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/DBIx-Class/0.08/branches/storage-ms-access:4142
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/DBIx-Class/0.08/branches/storage-tweaks:6262
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/DBIx-Class/0.08/branches/subclassed_rsset:5930
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/DBIx-Class/0.08/branches/subquery:5617
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/DBIx-Class/0.08/branches/sybase:5651
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/DBIx-Class/0.08/branches/sybase_mssql:6125
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/DBIx-Class/0.08/branches/versioned_enhancements:4125
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/DBIx-Class/0.08/branches/versioning:4578
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/DBIx-Class/0.08/branches/views:5585
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/DBIx-Class/0.08/trunk:6281
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class-C3:318
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class-current:2222
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class-joins:173
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class-resultset:570
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class/datetime:1716
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class/find_compat:1855
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class/find_unique_query_fixes:2142
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class/inflate:1988
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class/many_to_many:2025
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class/re_refactor_bugfix:1944
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class/reorganize_tests:1827
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class/resultset-new-refactor:1766
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class/resultset_2_electric_boogaloo:2175
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class/resultset_cleanup:2102
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class/sqlt_tests_refactor:2043
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/trunk/DBIx-Class:3606
fe160bb6-dc1c-0410-9f2b-d64a711b54a5:/local/DBIC-trunk-0.08:10510

Modified: DBIx-Class/0.08/branches/joined_count/Changes
===================================================================
--- DBIx-Class/0.08/branches/joined_count/Changes	2009-05-16 07:34:21 UTC (rev 6281)
+++ DBIx-Class/0.08/branches/joined_count/Changes	2009-05-16 07:35:47 UTC (rev 6282)
@@ -16,6 +16,11 @@
           circumvent DateTime parsing
         - Support inflation of timestamp datatype
         - Support BLOB and CLOB datatypes on Oracle
+        - Storage::DBI::Replicated::Balancer::Random:
+          added master_read_weight
+        - Storage::DBI::Replicated: storage opts from connect_info,
+          connect_info merging to replicants, hashref connect_info support,
+          improved trace output, other bug fixes/cleanups
 
 0.08102 2009-04-30 08:29:00 (UTC)
         - Fixed two subtle bugs when using columns or select/as

Modified: DBIx-Class/0.08/branches/joined_count/Makefile.PL
===================================================================
--- DBIx-Class/0.08/branches/joined_count/Makefile.PL	2009-05-16 07:34:21 UTC (rev 6281)
+++ DBIx-Class/0.08/branches/joined_count/Makefile.PL	2009-05-16 07:35:47 UTC (rev 6282)
@@ -77,10 +77,11 @@
   ,
 
   # t/93storage_replication.t
-  'Moose',                        => 0.54,
-  'Moose::Util::TypeConstraints'  => 0.54,
+  'Moose',                        => 0.77,
   'MooseX::AttributeHelpers'      => 0.12,
-  'Class::MOP'                    => 0.63,
+  'MooseX::Types',                => 0.10,
+  'namespace::clean'              => 0.11,
+  'Hash::Merge',                  => 0.11,
 
   # t/96_is_deteministic_value.t
   'DateTime::Format::Strptime' => 0,

Modified: DBIx-Class/0.08/branches/joined_count/lib/DBIx/Class/Manual/Cookbook.pod
===================================================================
--- DBIx-Class/0.08/branches/joined_count/lib/DBIx/Class/Manual/Cookbook.pod	2009-05-16 07:34:21 UTC (rev 6281)
+++ DBIx-Class/0.08/branches/joined_count/lib/DBIx/Class/Manual/Cookbook.pod	2009-05-16 07:35:47 UTC (rev 6282)
@@ -733,6 +733,48 @@
     # do whatever else you wanted if it was a new row
   }
 
+=head2 Static sub-classing DBIx::Class result classes 
+
+AKA adding additional relationships/methods/etc. to a model for a
+specific usage of the (shared) model.
+
+B<Schema definition> 
+ 
+    package My::App::Schema; 
+     
+    use base DBIx::Class::Schema; 
+
+    # load subclassed classes from My::App::Schema::Result/ResultSet
+    __PACKAGE__->load_namespaces;
+
+    # load classes from shared model
+    load_classes({
+        'My::Shared::Model::Result' => [qw/
+            Foo
+            Bar
+        /]});
+
+    1;
+ 
+B<Result-Subclass definition> 
+ 
+    package My::App::Schema::Result::Baz;
+     
+    use strict; 
+    use warnings; 
+    use base My::Shared::Model::Result::Baz; 
+    
+    # WARNING: Make sure you call table() again in your subclass,
+    # otherwise DBIx::Class::ResultSourceProxy::Table will not be called
+    # and the class name is not correctly registered as a source
+    __PACKAGE__->table('baz'); 
+     
+    sub additional_method { 
+        return "I'm an additional method only needed by this app"; 
+    }
+
+    1;
+     
 =head2 Dynamic Sub-classing DBIx::Class proxy classes 
 
 AKA multi-class object inflation from one table
@@ -760,7 +802,9 @@
      
     use base qw/DBIx::Class::Schema/; 
  
-    __PACKAGE__->load_namespaces; 
+    __PACKAGE__->load_namespaces;
+
+    1;
  
  
 B<Proxy-Class definitions> 
@@ -798,8 +842,10 @@
         print "I am a regular user.\n"; 
         return ; 
     } 
+    
+    1;
+
      
-     
     package My::Schema::Result::User::Admin; 
      
     use strict; 
@@ -816,7 +862,9 @@
     { 
         print "I am doing admin stuff\n"; 
         return ; 
-    } 
+    }
+
+    1;
  
 B<Test File> test.pl 
  

Modified: DBIx-Class/0.08/branches/joined_count/lib/DBIx/Class/Ordered.pm
===================================================================
--- DBIx-Class/0.08/branches/joined_count/lib/DBIx/Class/Ordered.pm	2009-05-16 07:34:21 UTC (rev 6281)
+++ DBIx-Class/0.08/branches/joined_count/lib/DBIx/Class/Ordered.pm	2009-05-16 07:35:47 UTC (rev 6282)
@@ -272,6 +272,20 @@
     return defined $lsib ? $lsib : 0;
 }
 
+# an optimised method to get the last sibling position without inflating a row object
+sub _last_sibling_pos {
+    my $self = shift;
+    my $position_column = $self->position_column;
+
+    my $cursor = $self->next_siblings->search(
+        {},
+        { rows => 1, order_by => { '-desc' => $position_column }, columns => $position_column },
+    )->cursor;
+
+    my ($pos) = $cursor->next;
+    return $pos;
+}
+
 =head2 move_previous
 
   $item->move_previous();
@@ -427,7 +441,7 @@
         if ( not defined($to_position) or $to_position > $new_group_count) {
             $self->set_column(
                 $position_column => $new_group_count
-                    ? $self->_next_position_value ( $self->last_sibling->get_column ($position_column) )    # FIXME - no need to inflate last_sibling
+                    ? $self->_next_position_value ( $self->_last_sibling_pos )
                     : $self->_initial_position_value
             );
         }
@@ -459,10 +473,10 @@
     my $position_column = $self->position_column;
 
     unless ($self->get_column($position_column)) {
-        my $lsib = $self->last_sibling;     # FIXME - no need to inflate last_sibling
+        my $lsib_pos = $self->_last_sibling_pos;
         $self->set_column(
-            $position_column => ($lsib
-                ? $self->_next_position_value ( $lsib->get_column ($position_column) )
+            $position_column => (defined $lsib_pos
+                ? $self->_next_position_value ( $lsib_pos )
                 : $self->_initial_position_value
             )
         );
@@ -692,12 +706,22 @@
     # position column is part of a unique constraint, and do a
     # one-by-one update if this is the case
 
-    if (grep { $_ eq $position_column } ( map { @$_ } (values %{{ $self->result_source->unique_constraints }} ) ) ) {
+    my $rsrc = $self->result_source;
 
-        my $rs = $shift_rs->search ({}, { order_by => { "-$ord", $position_column } } );
-        # FIXME - no need to inflate each row
-        while (my $r = $rs->next) {
-            $r->_ordered_internal_update ({ $position_column => \ "$position_column $op 1" } );
+    if (grep { $_ eq $position_column } ( map { @$_ } (values %{{ $rsrc->unique_constraints }} ) ) ) {
+
+        my @pcols = $rsrc->primary_columns;
+        my $cursor = $shift_rs->search ({}, { order_by => { "-$ord", $position_column }, columns => \@pcols } )->cursor;
+        my $rs = $self->result_source->resultset;
+
+        while (my @pks = $cursor->next ) {
+
+          my $cond;
+          for my $i (0.. $#pcols) {
+            $cond->{$pcols[$i]} = $pks[$i];
+          }
+
+          $rs->search($cond)->update ({ $position_column => \ "$position_column $op 1" } );
         }
     }
     else {

Modified: DBIx-Class/0.08/branches/joined_count/lib/DBIx/Class/Storage/DBI/Replicated/Balancer/First.pm
===================================================================
--- DBIx-Class/0.08/branches/joined_count/lib/DBIx/Class/Storage/DBI/Replicated/Balancer/First.pm	2009-05-16 07:34:21 UTC (rev 6281)
+++ DBIx-Class/0.08/branches/joined_count/lib/DBIx/Class/Storage/DBI/Replicated/Balancer/First.pm	2009-05-16 07:35:47 UTC (rev 6282)
@@ -2,6 +2,7 @@
 
 use Moose;
 with 'DBIx::Class::Storage::DBI::Replicated::Balancer';
+use namespace::clean -except => 'meta';
 
 =head1 NAME
 
@@ -50,4 +51,4 @@
 
 __PACKAGE__->meta->make_immutable;
 
-1;
\ No newline at end of file
+1;

Modified: DBIx-Class/0.08/branches/joined_count/lib/DBIx/Class/Storage/DBI/Replicated/Balancer/Random.pm
===================================================================
--- DBIx-Class/0.08/branches/joined_count/lib/DBIx/Class/Storage/DBI/Replicated/Balancer/Random.pm	2009-05-16 07:34:21 UTC (rev 6281)
+++ DBIx-Class/0.08/branches/joined_count/lib/DBIx/Class/Storage/DBI/Replicated/Balancer/Random.pm	2009-05-16 07:35:47 UTC (rev 6282)
@@ -2,6 +2,8 @@
 
 use Moose;
 with 'DBIx::Class::Storage::DBI::Replicated::Balancer';
+use DBIx::Class::Storage::DBI::Replicated::Types 'Weight';
+use namespace::clean -except => 'meta';
 
 =head1 NAME
 
@@ -26,6 +28,23 @@
 
 This class defines the following attributes.
 
+=head2 master_read_weight
+
+A number greater than 0 that specifies what weight to give the master when
+choosing which backend to execute a read query on. A value of 0, which is the
+default, does no reads from master, while a value of 1 gives it the same
+priority as any single replicant.
+
+For example: if you have 2 replicants, and a L</master_read_weight> of C<0.5>,
+the chance of reading from master will be C<20%>.
+
+You can set it to a value higher than 1, making master have higher weight than
+any single replicant, if for example you have a very powerful master.
+
+=cut
+
+has master_read_weight => (is => 'rw', isa => Weight, default => sub { 0 });
+
 =head1 METHODS
 
 This class defines the following methods.
@@ -40,13 +59,25 @@
 
 sub next_storage {
   my $self = shift @_;
-  my @active_replicants = $self->pool->active_replicants;
-  my $count_active_replicants = $#active_replicants +1;
-  my $random_replicant = int(rand($count_active_replicants));
-  
-  return $active_replicants[$random_replicant];
+
+  my @replicants = $self->pool->active_replicants;
+
+  if (not @replicants) {
+    # will fall back to master anyway
+    return;
+  }
+
+  my $master     = $self->master;
+
+  my $rnd = $self->_random_number(@replicants + $self->master_read_weight);
+
+  return $rnd >= @replicants ? $master : $replicants[int $rnd];
 }
 
+sub _random_number {
+  rand($_[1])
+}
+
 =head1 AUTHOR
 
 John Napiorkowski <john.napiorkowski at takkle.com>
@@ -59,4 +90,4 @@
 
 __PACKAGE__->meta->make_immutable;
 
-1;
\ No newline at end of file
+1;

Modified: DBIx-Class/0.08/branches/joined_count/lib/DBIx/Class/Storage/DBI/Replicated/Balancer.pm
===================================================================
--- DBIx-Class/0.08/branches/joined_count/lib/DBIx/Class/Storage/DBI/Replicated/Balancer.pm	2009-05-16 07:34:21 UTC (rev 6281)
+++ DBIx-Class/0.08/branches/joined_count/lib/DBIx/Class/Storage/DBI/Replicated/Balancer.pm	2009-05-16 07:35:47 UTC (rev 6282)
@@ -2,7 +2,10 @@
 
 use Moose::Role;
 requires 'next_storage';
+use MooseX::Types::Moose qw/Int/;
 
+use namespace::clean -except => 'meta';
+
 =head1 NAME
 
 DBIx::Class::Storage::DBI::Replicated::Balancer - A Software Load Balancer 
@@ -31,7 +34,7 @@
 
 has 'auto_validate_every' => (
   is=>'rw',
-  isa=>'Int',
+  isa=>Int,
   predicate=>'has_auto_validate_every',
 );
 

Modified: DBIx-Class/0.08/branches/joined_count/lib/DBIx/Class/Storage/DBI/Replicated/Pool.pm
===================================================================
--- DBIx-Class/0.08/branches/joined_count/lib/DBIx/Class/Storage/DBI/Replicated/Pool.pm	2009-05-16 07:34:21 UTC (rev 6281)
+++ DBIx-Class/0.08/branches/joined_count/lib/DBIx/Class/Storage/DBI/Replicated/Pool.pm	2009-05-16 07:35:47 UTC (rev 6282)
@@ -3,8 +3,13 @@
 use Moose;
 use MooseX::AttributeHelpers;
 use DBIx::Class::Storage::DBI::Replicated::Replicant;
-use List::Util qw(sum);
+use List::Util 'sum';
+use Scalar::Util 'reftype';
+use Carp::Clan qw/^DBIx::Class/;
+use MooseX::Types::Moose qw/Num Int ClassName HashRef/;
 
+use namespace::clean -except => 'meta';
+
 =head1 NAME
 
 DBIx::Class::Storage::DBI::Replicated::Pool - Manage a pool of replicants
@@ -37,7 +42,7 @@
 
 has 'maximum_lag' => (
   is=>'rw',
-  isa=>'Num',
+  isa=>Num,
   required=>1,
   lazy=>1,
   default=>0,
@@ -53,7 +58,7 @@
 
 has 'last_validated' => (
   is=>'rw',
-  isa=>'Int',
+  isa=>Int,
   reader=>'last_validated',
   writer=>'_last_validated',
   lazy=>1,
@@ -70,7 +75,7 @@
 
 has 'replicant_type' => (
   is=>'ro',
-  isa=>'ClassName',
+  isa=>ClassName,
   required=>1,
   default=>'DBIx::Class::Storage::DBI',
   handles=>{
@@ -120,7 +125,7 @@
 has 'replicants' => (
   is=>'rw',
   metaclass => 'Collection::Hash',
-  isa=>'HashRef[DBIx::Class::Storage::DBI]',
+  isa=>HashRef['DBIx::Class::Storage::DBI'],
   default=>sub {{}},
   provides  => {
     'set' => 'set_replicant',
@@ -149,8 +154,18 @@
   
   my @newly_created = ();
   foreach my $connect_info (@_) {
+    $connect_info = [ $connect_info ]
+      if reftype $connect_info ne 'ARRAY';
+
+    croak "coderef replicant connect_info not supported"
+      if ref $connect_info->[0] && reftype $connect_info->[0] eq 'CODE';
+
     my $replicant = $self->connect_replicant($schema, $connect_info);
-    my ($key) = ($connect_info->[0]=~m/^dbi\:.+\:(.+)$/);
+
+    my $key = $connect_info->[0];
+    $key = $key->{dsn} if ref $key && reftype $key eq 'HASH';
+    ($key) = ($key =~ m/^dbi\:.+\:(.+)$/);
+
     $self->set_replicant( $key => $replicant);  
     push @newly_created, $replicant;
   }
@@ -280,13 +295,13 @@
     if($self->_safely_ensure_connected($replicant)) {
       my $is_replicating = $replicant->is_replicating;
       unless(defined $is_replicating) {
-        $replicant->debugobj->print("Storage Driver ".ref $self." Does not support the 'is_replicating' method.  Assuming you are manually managing.");
+        $replicant->debugobj->print("Storage Driver ".ref($self)." Does not support the 'is_replicating' method.  Assuming you are manually managing.\n");
         next;
       } else {
         if($is_replicating) {
           my $lag_behind_master = $replicant->lag_behind_master;
           unless(defined $lag_behind_master) {
-            $replicant->debugobj->print("Storage Driver ".ref $self." Does not support the 'lag_behind_master' method.  Assuming you are manually managing.");
+            $replicant->debugobj->print("Storage Driver ".ref($self)." Does not support the 'lag_behind_master' method.  Assuming you are manually managing.\n");
             next;
           } else {
             if($lag_behind_master <= $self->maximum_lag) {

Modified: DBIx-Class/0.08/branches/joined_count/lib/DBIx/Class/Storage/DBI/Replicated/Replicant.pm
===================================================================
--- DBIx-Class/0.08/branches/joined_count/lib/DBIx/Class/Storage/DBI/Replicated/Replicant.pm	2009-05-16 07:34:21 UTC (rev 6281)
+++ DBIx-Class/0.08/branches/joined_count/lib/DBIx/Class/Storage/DBI/Replicated/Replicant.pm	2009-05-16 07:35:47 UTC (rev 6282)
@@ -2,7 +2,11 @@
 
 use Moose::Role;
 requires qw/_query_start/;
+with 'DBIx::Class::Storage::DBI::Replicated::WithDSN';
+use MooseX::Types::Moose 'Bool';
 
+use namespace::clean -except => 'meta';
+
 =head1 NAME
 
 DBIx::Class::Storage::DBI::Replicated::Replicant - A replicated DBI Storage Role
@@ -42,7 +46,7 @@
 
 has 'active' => (
   is=>'rw',
-  isa=>'Bool',
+  isa=>Bool,
   lazy=>1,
   required=>1,
   default=>1,
@@ -52,18 +56,6 @@
 
 This class defines the following methods.
 
-=head2 around: _query_start
-
-advice iof the _query_start method to add more debuggin
-
-=cut
-
-around '_query_start' => sub {
-  my ($method, $self, $sql, @bind) = @_;
-  my $dsn = $self->_dbi_connect_info->[0];
-  $self->$method("DSN: $dsn SQL: $sql", @bind);
-};
-
 =head2 debugobj
 
 Override the debugobj method to redirect this method call back to the master.
@@ -76,7 +68,8 @@
 
 =head1 ALSO SEE
 
-L<<a href="http://en.wikipedia.org/wiki/Replicant">http://en.wikipedia.org/wiki/Replicant</a>>
+L<http://en.wikipedia.org/wiki/Replicant>,
+L<DBIx::Class::Storage::DBI::Replicated>
 
 =head1 AUTHOR
 
@@ -88,4 +81,4 @@
 
 =cut
 
-1;
\ No newline at end of file
+1;

Added: DBIx-Class/0.08/branches/joined_count/lib/DBIx/Class/Storage/DBI/Replicated/Types.pm
===================================================================
--- DBIx-Class/0.08/branches/joined_count/lib/DBIx/Class/Storage/DBI/Replicated/Types.pm	                        (rev 0)
+++ DBIx-Class/0.08/branches/joined_count/lib/DBIx/Class/Storage/DBI/Replicated/Types.pm	2009-05-16 07:35:47 UTC (rev 6282)
@@ -0,0 +1,47 @@
+package # hide from PAUSE
+  DBIx::Class::Storage::DBI::Replicated::Types;
+
+=head1 NAME
+
+DBIx::Class::Storage::DBI::Replicated::Types - Types used internally by
+L<DBIx::Class::Storage::DBI::Replicated>
+
+=cut
+
+use MooseX::Types
+  -declare => [qw/BalancerClassNamePart Weight/];
+use MooseX::Types::Moose qw/ClassName Str Num/;
+
+class_type 'DBIx::Class::Storage::DBI';
+class_type 'DBIx::Class::Schema';
+
+subtype BalancerClassNamePart,
+  as ClassName;
+    
+coerce BalancerClassNamePart,
+  from Str,
+  via {
+    my $type = $_;
+    if($type=~m/^::/) {
+      $type = 'DBIx::Class::Storage::DBI::Replicated::Balancer'.$type;
+    }  
+    Class::MOP::load_class($type);  
+    $type;  	
+  };
+
+subtype Weight,
+  as Num,
+  where { $_ >= 0 },
+  message { 'weight must be a decimal greater than 0' };
+
+=head1 AUTHOR
+
+  John Napiorkowski <john.napiorkowski at takkle.com>
+
+=head1 LICENSE
+
+You may distribute this code under the same terms as Perl itself.
+
+=cut
+
+1;

Added: DBIx-Class/0.08/branches/joined_count/lib/DBIx/Class/Storage/DBI/Replicated/WithDSN.pm
===================================================================
--- DBIx-Class/0.08/branches/joined_count/lib/DBIx/Class/Storage/DBI/Replicated/WithDSN.pm	                        (rev 0)
+++ DBIx-Class/0.08/branches/joined_count/lib/DBIx/Class/Storage/DBI/Replicated/WithDSN.pm	2009-05-16 07:35:47 UTC (rev 6282)
@@ -0,0 +1,51 @@
+package DBIx::Class::Storage::DBI::Replicated::WithDSN;
+
+use Moose::Role;
+requires qw/_query_start/;
+
+use namespace::clean -except => 'meta';
+
+=head1 NAME
+
+DBIx::Class::Storage::DBI::Replicated::WithDSN - A DBI Storage Role with DSN
+information in trace output
+
+=head1 SYNOPSIS
+
+This class is used internally by L<DBIx::Class::Storage::DBI::Replicated>.
+    
+=head1 DESCRIPTION
+
+This role adds C<DSN: > info to storage debugging output.
+
+=head1 METHODS
+
+This class defines the following methods.
+
+=head2 around: _query_start
+
+Add C<DSN: > to debugging output.
+
+=cut
+
+around '_query_start' => sub {
+  my ($method, $self, $sql, @bind) = @_;
+  my $dsn = $self->_dbi_connect_info->[0];
+  $self->$method("DSN: $dsn SQL: $sql", @bind);
+};
+
+=head1 ALSO SEE
+
+L<DBIx::Class::Storage::DBI>
+
+=head1 AUTHOR
+
+John Napiorkowski <john.napiorkowski at takkle.com>
+
+=head1 LICENSE
+
+You may distribute this code under the same terms as Perl itself.
+
+=cut
+
+1;

Modified: DBIx-Class/0.08/branches/joined_count/lib/DBIx/Class/Storage/DBI/Replicated.pm
===================================================================
--- DBIx-Class/0.08/branches/joined_count/lib/DBIx/Class/Storage/DBI/Replicated.pm	2009-05-16 07:34:21 UTC (rev 6281)
+++ DBIx-Class/0.08/branches/joined_count/lib/DBIx/Class/Storage/DBI/Replicated.pm	2009-05-16 07:35:47 UTC (rev 6282)
@@ -7,10 +7,11 @@
   ## use, so we explicitly test for these.
 	
   my %replication_required = (
-    Moose => '0.54',
+    Moose => '0.77',
     MooseX::AttributeHelpers => '0.12',
-    Moose::Util::TypeConstraints => '0.54',
-    Class::MOP => '0.63',
+    MooseX::Types => '0.10',
+    namespace::clean => '0.11',
+    Hash::Merge => '0.11'
   );
 	
   my @didnt_load;
@@ -25,10 +26,18 @@
     if @didnt_load;  	
 }
 
+use Moose;
 use DBIx::Class::Storage::DBI;
 use DBIx::Class::Storage::DBI::Replicated::Pool;
 use DBIx::Class::Storage::DBI::Replicated::Balancer;
+use DBIx::Class::Storage::DBI::Replicated::Types 'BalancerClassNamePart';
+use MooseX::Types::Moose qw/ClassName HashRef Object/;
+use Scalar::Util 'reftype';
+use Carp::Clan qw/^DBIx::Class/;
+use Hash::Merge 'merge';
 
+use namespace::clean -except => 'meta';
+
 =head1 NAME
 
 DBIx::Class::Storage::DBI::Replicated - BETA Replicated database support
@@ -99,10 +108,11 @@
 
 Replicated Storage has additional requirements not currently part of L<DBIx::Class>
 
-  Moose => 0.54
+  Moose => 0.77
   MooseX::AttributeHelpers => 0.12 
-  Moose::Util::TypeConstraints => 0.54
-  Class::MOP => 0.63
+  MooseX::Types => 0.10
+  namespace::clean => 0.11
+  Hash::Merge => 0.11
   
 You will need to install these modules manually via CPAN or make them part of the
 Makefile for your distribution.
@@ -132,9 +142,8 @@
 =cut
 
 has 'pool_type' => (
-  is=>'ro',
-  isa=>'ClassName',
-  required=>1,
+  is=>'rw',
+  isa=>ClassName,
   default=>'DBIx::Class::Storage::DBI::Replicated::Pool',
   handles=>{
     'create_pool' => 'new',
@@ -149,10 +158,9 @@
 =cut
 
 has 'pool_args' => (
-  is=>'ro',
-  isa=>'HashRef',
+  is=>'rw',
+  isa=>HashRef,
   lazy=>1,
-  required=>1,
   default=>sub { {} },
 );
 
@@ -164,23 +172,9 @@
 
 =cut
 
-subtype 'DBIx::Class::Storage::DBI::Replicated::BalancerClassNamePart',
-  as 'ClassName';
-    
-coerce 'DBIx::Class::Storage::DBI::Replicated::BalancerClassNamePart',
-  from 'Str',
-  via {
-  	my $type = $_;
-    if($type=~m/^::/) {
-      $type = 'DBIx::Class::Storage::DBI::Replicated::Balancer'.$type;
-    }  
-    Class::MOP::load_class($type);  
-    $type;  	
-  };
-
 has 'balancer_type' => (
-  is=>'ro',
-  isa=>'DBIx::Class::Storage::DBI::Replicated::BalancerClassNamePart',
+  is=>'rw',
+  isa=>BalancerClassNamePart,
   coerce=>1,
   required=>1,
   default=> 'DBIx::Class::Storage::DBI::Replicated::Balancer::First',
@@ -197,8 +191,8 @@
 =cut
 
 has 'balancer_args' => (
-  is=>'ro',
-  isa=>'HashRef',
+  is=>'rw',
+  isa=>HashRef,
   lazy=>1,
   required=>1,
   default=>sub { {} },
@@ -230,7 +224,7 @@
 =cut
 
 has 'balancer' => (
-  is=>'ro',
+  is=>'rw',
   isa=>'DBIx::Class::Storage::DBI::Replicated::Balancer',
   lazy_build=>1,
   handles=>[qw/auto_validate_every/],
@@ -265,7 +259,7 @@
 
 has 'read_handler' => (
   is=>'rw',
-  isa=>'Object',
+  isa=>Object,
   lazy_build=>1,
   handles=>[qw/
     select
@@ -282,9 +276,8 @@
 
 has 'write_handler' => (
   is=>'ro',
-  isa=>'Object',
+  isa=>Object,
   lazy_build=>1,
-  lazy_build=>1,
   handles=>[qw/   
     on_connect_do
     on_disconnect_do       
@@ -317,6 +310,56 @@
   /],
 );
 
+has _master_connect_info_opts =>
+  (is => 'rw', isa => HashRef, default => sub { {} });
+
+=head2 around: connect_info
+
+Preserve master's C<connect_info> options (for merging with replicants.)
+Also set any Replicated related options from connect_info, such as
+C<pool_type>, C<pool_args>, C<balancer_type> and C<balancer_args>.
+
+=cut
+
+around connect_info => sub {
+  my ($next, $self, $info, @extra) = @_;
+
+  my %opts;
+  for my $arg (@$info) {
+    next unless (reftype($arg)||'') eq 'HASH';
+    %opts = %{ merge($arg, \%opts) };
+  }
+  delete $opts{dsn};
+
+  if (@opts{qw/pool_type pool_args/}) {
+    $self->pool_type(delete $opts{pool_type})
+      if $opts{pool_type};
+
+    $self->pool_args(
+      merge((delete $opts{pool_args} || {}), $self->pool_args)
+    );
+
+    $self->pool($self->_build_pool)
+	if $self->pool;
+  }
+
+  if (@opts{qw/balancer_type balancer_args/}) {
+    $self->balancer_type(delete $opts{balancer_type})
+      if $opts{balancer_type};
+
+    $self->balancer_args(
+      merge((delete $opts{balancer_args} || {}), $self->balancer_args)
+    );
+
+    $self->balancer($self->_build_balancer)
+	if $self->balancer;
+  }
+
+  $self->_master_connect_info_opts(\%opts);
+
+  $self->$next($info, @extra);
+};
+
 =head1 METHODS
 
 This class defines the following methods.
@@ -347,7 +390,9 @@
 
 sub _build_master {
   my $self = shift @_;
-  DBIx::Class::Storage::DBI->new($self->schema);
+  my $master = DBIx::Class::Storage::DBI->new($self->schema);
+  DBIx::Class::Storage::DBI::Replicated::WithDSN->meta->apply($master);
+  $master
 }
 
 =head2 _build_pool
@@ -402,13 +447,49 @@
 =head2 around: connect_replicants
 
 All calls to connect_replicants needs to have an existing $schema tacked onto
-top of the args, since L<DBIx::Storage::DBI> needs it.
+top of the args, since L<DBIx::Storage::DBI> needs it, and any C<connect_info>
+options merged with the master, with replicant opts having higher priority.
 
 =cut
 
-around 'connect_replicants' => sub {
-  my ($method, $self, @args) = @_;
-  $self->$method($self->schema, @args);
+around connect_replicants => sub {
+  my ($next, $self, @args) = @_;
+
+  for my $r (@args) {
+    $r = [ $r ] unless reftype $r eq 'ARRAY';
+
+    croak "coderef replicant connect_info not supported"
+      if ref $r->[0] && reftype $r->[0] eq 'CODE';
+
+# any connect_info options?
+    my $i = 0;
+    $i++ while $i < @$r && (reftype($r->[$i])||'') ne 'HASH';
+
+# make one if none    
+    $r->[$i] = {} unless $r->[$i];
+
+# merge if two hashes
+    my @hashes = @$r[$i .. $#{$r}];
+
+    croak "invalid connect_info options"
+      if (grep { reftype($_) eq 'HASH' } @hashes) != @hashes;
+
+    croak "too many hashrefs in connect_info"
+      if @hashes > 2;
+
+    my %opts = %{ merge(reverse @hashes) };
+
+# delete them
+    splice @$r, $i+1, ($#{$r} - $i), ();
+
+# merge with master
+    %opts = %{ merge(\%opts, $self->_master_connect_info_opts) };
+
+# update
+    $r->[$i] = \%opts;
+  }
+
+  $self->$next($self->schema, @args);
 };
 
 =head2 all_storages
@@ -423,7 +504,7 @@
   my $self = shift @_;
   return grep {defined $_ && blessed $_} (
      $self->master,
-     $self->replicants,
+     values %{ $self->replicants },
   );
 }
 
@@ -693,6 +774,21 @@
   }
 }
 
+=head2 cursor_class
+
+set cursor class on all storages, or return master's
+
+=cut
+
+sub cursor_class {
+  my ($self, $cursor_class) = @_;
+
+  if ($cursor_class) {
+    $_->cursor_class($cursor_class) for $self->all_storages;
+  }
+  $self->master->cursor_class;
+}
+  
 =head1 GOTCHAS
 
 Due to the fact that replicants can lag behind a master, you must take care to

Modified: DBIx-Class/0.08/branches/joined_count/lib/DBIx/Class/Storage/Statistics.pm
===================================================================
--- DBIx-Class/0.08/branches/joined_count/lib/DBIx/Class/Storage/Statistics.pm	2009-05-16 07:34:21 UTC (rev 6281)
+++ DBIx-Class/0.08/branches/joined_count/lib/DBIx/Class/Storage/Statistics.pm	2009-05-16 07:35:47 UTC (rev 6282)
@@ -5,7 +5,7 @@
 use base qw/Class::Accessor::Grouped/;
 use IO::File;
 
-__PACKAGE__->mk_group_accessors(simple => qw/callback debugfh/);
+__PACKAGE__->mk_group_accessors(simple => qw/callback debugfh silence/);
 
 =head1 NAME
 
@@ -56,6 +56,8 @@
 sub print {
   my ($self, $msg) = @_;
 
+  return if $self->silence;
+
   if(!defined($self->debugfh())) {
     my $fh;
     my $debug_env = $ENV{DBIX_CLASS_STORAGE_DBI_DEBUG}
@@ -75,6 +77,10 @@
   $self->debugfh->print($msg);
 }
 
+=head2 silence
+
+Turn off all output if set to true.
+
 =head2 txn_begin
 
 Called when a transaction begins.

Modified: DBIx-Class/0.08/branches/joined_count/t/60core.t
===================================================================
--- DBIx-Class/0.08/branches/joined_count/t/60core.t	2009-05-16 07:34:21 UTC (rev 6281)
+++ DBIx-Class/0.08/branches/joined_count/t/60core.t	2009-05-16 07:35:47 UTC (rev 6282)
@@ -13,19 +13,6 @@
 eval { require DateTime::Format::MySQL };
 my $NO_DTFM = $@ ? 1 : 0;
 
-# figure out if we've got a version of sqlite that is older than 3.2.6, in
-# which case COUNT(DISTINCT()) doesn't work
-my $is_broken_sqlite = 0;
-my ($sqlite_major_ver,$sqlite_minor_ver,$sqlite_patch_ver) =
-    split /\./, $schema->storage->dbh->get_info(18);
-if( $schema->storage->dbh->get_info(17) eq 'SQLite' &&
-    ( ($sqlite_major_ver < 3) ||
-      ($sqlite_major_ver == 3 && $sqlite_minor_ver < 2) ||
-      ($sqlite_major_ver == 3 && $sqlite_minor_ver == 2 && $sqlite_patch_ver < 6) ) ) {
-    $is_broken_sqlite = 1;
-}
-
-
 my @art = $schema->resultset("Artist")->search({ }, { order_by => 'name DESC'});
 
 is(@art, 3, "Three artists returned");
@@ -245,10 +232,7 @@
 my $distinct_rs = $schema->resultset("CD")->search($search, { join => 'tags', distinct => 1 });
 is($distinct_rs->all, 4, 'DISTINCT search with OR ok');
 
-SKIP: {
-  skip "SQLite < 3.2.6 doesn't understand COUNT(DISTINCT())", 2
-    if $is_broken_sqlite;
-
+{
   my $tcount = $schema->resultset('Track')->search(
     {},
     {

Modified: DBIx-Class/0.08/branches/joined_count/t/66relationship.t
===================================================================
--- DBIx-Class/0.08/branches/joined_count/t/66relationship.t	2009-05-16 07:34:21 UTC (rev 6281)
+++ DBIx-Class/0.08/branches/joined_count/t/66relationship.t	2009-05-16 07:35:47 UTC (rev 6282)
@@ -62,10 +62,10 @@
 }
 
 my( $rs_from_list ) = $artist->search_related_rs('cds');
-is( ref($rs_from_list), 'DBIx::Class::ResultSet', 'search_related_rs in list context returns rs' );
+isa_ok( $rs_from_list, 'DBIx::Class::ResultSet', 'search_related_rs in list context returns rs' );
 
 ( $rs_from_list ) = $artist->cds_rs();
-is( ref($rs_from_list), 'DBIx::Class::ResultSet', 'relation_rs in list context returns rs' );
+isa_ok( $rs_from_list, 'DBIx::Class::ResultSet', 'relation_rs in list context returns rs' );
 
 # count_related
 is( $artist->count_related('cds'), 4, 'count_related ok' );

Modified: DBIx-Class/0.08/branches/joined_count/t/76joins.t
===================================================================
--- DBIx-Class/0.08/branches/joined_count/t/76joins.t	2009-05-16 07:34:21 UTC (rev 6281)
+++ DBIx-Class/0.08/branches/joined_count/t/76joins.t	2009-05-16 07:35:47 UTC (rev 6282)
@@ -20,18 +20,6 @@
         : ( tests => 33 );
 }
 
-# figure out if we've got a version of sqlite that is older than 3.2.6, in
-# which case COUNT(DISTINCT()) doesn't work
-my $is_broken_sqlite = 0;
-my ($sqlite_major_ver,$sqlite_minor_ver,$sqlite_patch_ver) =
-    split /\./, $schema->storage->dbh->get_info(18);
-if( $schema->storage->dbh->get_info(17) eq 'SQLite' &&
-    ( ($sqlite_major_ver < 3) ||
-      ($sqlite_major_ver == 3 && $sqlite_minor_ver < 2) ||
-      ($sqlite_major_ver == 3 && $sqlite_minor_ver == 2 && $sqlite_patch_ver < 6) ) ) {
-    $is_broken_sqlite = 1;
-}
-
 # test the abstract join => SQL generator
 my $sa = new DBIx::Class::SQLAHacks;
 

Modified: DBIx-Class/0.08/branches/joined_count/t/82cascade_copy.t
===================================================================
--- DBIx-Class/0.08/branches/joined_count/t/82cascade_copy.t	2009-05-16 07:34:21 UTC (rev 6281)
+++ DBIx-Class/0.08/branches/joined_count/t/82cascade_copy.t	2009-05-16 07:35:47 UTC (rev 6282)
@@ -11,15 +11,8 @@
 my $artist = $schema->resultset('Artist')->find(1);
 my $artist_cds = $artist->search_related('cds');
 
-my $cover_band;
+my $cover_band = $artist->copy;
 
-{
-  no warnings qw(redefine once);
-  local *DBICTest::Artist::result_source_instance = \&DBICTest::Schema::Artist::result_source_instance;
-
-  $cover_band = $artist->copy;
-}
-
 my $cover_cds = $cover_band->search_related('cds');
 cmp_ok($cover_band->id, '!=', $artist->id, 'ok got new column id...');
 is($cover_cds->count, $artist_cds->count, 'duplicated rows count ok');

Modified: DBIx-Class/0.08/branches/joined_count/t/83cache.t
===================================================================
--- DBIx-Class/0.08/branches/joined_count/t/83cache.t	2009-05-16 07:34:21 UTC (rev 6281)
+++ DBIx-Class/0.08/branches/joined_count/t/83cache.t	2009-05-16 07:35:47 UTC (rev 6282)
@@ -83,7 +83,7 @@
 $rs->reset();
 
 # make sure artist contains a related resultset for cds
-is( ref $artist->{related_resultsets}->{cds}, 'DBIx::Class::ResultSet', 'artist has a related_resultset for cds' );
+isa_ok( $artist->{related_resultsets}{cds}, 'DBIx::Class::ResultSet', 'artist has a related_resultset for cds' );
 
 # check if $artist->cds->get_cache is populated
 is( scalar @{$artist->cds->get_cache}, 3, 'cache for artist->cds contains correct number of records');

Modified: DBIx-Class/0.08/branches/joined_count/t/93storage_replication.t
===================================================================
--- DBIx-Class/0.08/branches/joined_count/t/93storage_replication.t	2009-05-16 07:34:21 UTC (rev 6281)
+++ DBIx-Class/0.08/branches/joined_count/t/93storage_replication.t	2009-05-16 07:35:47 UTC (rev 6282)
@@ -4,12 +4,15 @@
 use Test::More;
 use Test::Exception;
 use DBICTest;
+use List::Util 'first';
+use Scalar::Util 'reftype';
+use IO::Handle;
 
 BEGIN {
     eval "use DBIx::Class::Storage::DBI::Replicated; use Test::Moose";
     plan $@
         ? ( skip_all => "Deps not installed: $@" )
-        : ( tests => 79 );
+        : ( tests => 90 );
 }
 
 use_ok 'DBIx::Class::Storage::DBI::Replicated::Pool';
@@ -49,10 +52,10 @@
     ## Initialize the object
     
 	sub new {
-	    my $class = shift @_;
+	    my ($class, $schema_method) = (shift, shift);
 	    my $self = $class->SUPER::new(@_);
 	
-	    $self->schema( $self->init_schema );
+	    $self->schema( $self->init_schema($schema_method) );
 	    return $self;
 	}
     
@@ -62,30 +65,71 @@
         # current SQLT SQLite producer does not handle DROP TABLE IF EXISTS, trap warnings here
         local $SIG{__WARN__} = sub { warn @_ unless $_[0] =~ /no such table.+DROP TABLE/ };
 
-        my $class = shift @_;
+        my ($class, $schema_method) = @_;
 
-        my $schema = DBICTest->init_schema(
-            sqlite_use_file => 1,
-            storage_type=>{
-            	'::DBI::Replicated' => {
-            		balancer_type=>'::Random',
-                    balancer_args=>{
-                    	auto_validate_every=>100,
-                    },
-            	}
-            },
-            deploy_args=>{
-                   add_drop_table => 1,
-            },
-        );
+        my $method = "get_schema_$schema_method";
+        my $schema = $class->$method;
 
         return $schema;
     }
-    
+
+    sub get_schema_by_storage_type {
+      DBICTest->init_schema(
+        sqlite_use_file => 1,
+        storage_type=>{
+          '::DBI::Replicated' => {
+            balancer_type=>'::Random',
+            balancer_args=>{
+              auto_validate_every=>100,
+	      master_read_weight => 1
+            },
+          }
+        },
+        deploy_args=>{
+          add_drop_table => 1,
+        },
+      );
+    }
+
+    sub get_schema_by_connect_info {
+      DBICTest->init_schema(
+        sqlite_use_file => 1,
+        storage_type=> '::DBI::Replicated',
+        balancer_type=>'::Random',
+        balancer_args=> {
+          auto_validate_every=>100,
+	  master_read_weight => 1
+        },
+        deploy_args=>{
+          add_drop_table => 1,
+        },
+      );
+    }
+
     sub generate_replicant_connect_info {}
     sub replicate {}
     sub cleanup {}
 
+    ## --------------------------------------------------------------------- ##
+    ## Add a connect_info option to test option merging.
+    ## --------------------------------------------------------------------- ##
+    {
+    package DBIx::Class::Storage::DBI::Replicated;
+
+    use Moose;
+
+    __PACKAGE__->meta->make_mutable;
+
+    around connect_info => sub {
+      my ($next, $self, $info) = @_;
+      $info->[3]{master_option} = 1;
+      $self->$next($info);
+    };
+
+    __PACKAGE__->meta->make_immutable;
+
+    no Moose;
+    }
   
     ## --------------------------------------------------------------------- ##
     ## Subclass for when you are using SQLite for testing, this provides a fake
@@ -124,9 +168,20 @@
             "dbi:SQLite:${_}";
         } @{$self->slave_paths};
         
-        return map { [$_,'','',{AutoCommit=>1}] } @dsn;
+        my @connect_infos = map { [$_,'','',{AutoCommit=>1}] } @dsn;
+
+    # try a hashref too
+        my $c = $connect_infos[0];
+        $connect_infos[0] = {
+          dsn => $c->[0],
+          user => $c->[1],
+          password => $c->[2],
+          %{ $c->[3] }
+        };
+
+        @connect_infos
     }
-    
+
     ## Do a 'good enough' replication by copying the master dbfile over each of
     ## the slave dbfiles.  If the master is SQLite we do this, otherwise we
     ## just do a one second pause to let the slaves catch up.
@@ -185,15 +240,23 @@
     'DBIx::Class::DBI::Replicated::TestReplication::Custom' :
     'DBIx::Class::DBI::Replicated::TestReplication::SQLite';
 
-ok my $replicated = $replicated_class->new
-    => 'Created a replication object';
-    
-isa_ok $replicated->schema
-    => 'DBIx::Class::Schema';
-    
-isa_ok $replicated->schema->storage
-    => 'DBIx::Class::Storage::DBI::Replicated';
+my $replicated;
 
+for my $method (qw/by_connect_info by_storage_type/) {
+  ok $replicated = $replicated_class->new($method)
+      => "Created a replication object $method";
+      
+  isa_ok $replicated->schema
+      => 'DBIx::Class::Schema';
+      
+  isa_ok $replicated->schema->storage
+      => 'DBIx::Class::Storage::DBI::Replicated';
+
+  isa_ok $replicated->schema->storage->balancer
+      => 'DBIx::Class::Storage::DBI::Replicated::Balancer::Random'
+      => 'configured balancer_type';
+}
+
 ok $replicated->schema->storage->meta
     => 'has a meta object';
     
@@ -211,10 +274,38 @@
 
 ok my @replicated_storages = $replicated->schema->storage->connect_replicants(@replicant_connects)
     => 'Created some storages suitable for replicants';
-    
+
+ok my @all_storages = $replicated->schema->storage->all_storages
+    => '->all_storages';
+
+is scalar @all_storages,
+    3
+    => 'correct number of ->all_storages';
+
+is ((grep $_->isa('DBIx::Class::Storage::DBI'), @all_storages),
+    3
+    => '->all_storages are correct type');
+
+my @all_storage_opts =
+  grep { (reftype($_)||'') eq 'HASH' }
+    map @{ $_->_connect_info }, @all_storages;
+
+is ((grep $_->{master_option}, @all_storage_opts),
+    3
+    => 'connect_info was merged from master to replicants');
+ 
+my @replicant_names = keys %{ $replicated->schema->storage->replicants };
+
+## Silence warning about not supporting the is_replicating method if using the
+## sqlite dbs.
+$replicated->schema->storage->debugobj->silence(1)
+  if first { m{^t/} } @replicant_names;
+   
 isa_ok $replicated->schema->storage->balancer->current_replicant
-    => 'DBIx::Class::Storage::DBI';
-    
+    => 'DBIx::Class::Storage::DBI'; 
+
+$replicated->schema->storage->debugobj->silence(0);
+
 ok $replicated->schema->storage->pool->has_replicants
     => 'does have replicants';     
 
@@ -227,8 +318,6 @@
 does_ok $replicated_storages[1]
     => 'DBIx::Class::Storage::DBI::Replicated::Replicant';
     
-my @replicant_names = keys %{$replicated->schema->storage->replicants};
-
 does_ok $replicated->schema->storage->replicants->{$replicant_names[0]}
     => 'DBIx::Class::Storage::DBI::Replicated::Replicant';
 
@@ -249,8 +338,16 @@
 $replicated->replicate;
 $replicated->schema->storage->replicants->{$replicant_names[0]}->active(1);
 $replicated->schema->storage->replicants->{$replicant_names[1]}->active(1);
+
+## Silence warning about not supporting the is_replicating method if using the
+## sqlite dbs.
+$replicated->schema->storage->debugobj->silence(1)
+  if first { m{^t/} } @replicant_names;
+ 
 $replicated->schema->storage->pool->validate_replicants;
 
+$replicated->schema->storage->debugobj->silence(0);
+
 ## Make sure we can read the data.
 
 ok my $artist1 = $replicated->schema->resultset('Artist')->find(4)
@@ -262,6 +359,28 @@
 is $artist1->name, 'Ozric Tentacles'
     => 'Found expected name for first result';
 
+## Check that master_read_weight is honored
+{
+    no warnings 'once';
+
+    # turn off redefined warning
+    local $SIG{__WARN__} = sub {};
+
+    local
+    *DBIx::Class::Storage::DBI::Replicated::Balancer::Random::_random_number =
+	sub { 999 };
+
+    $replicated->schema->storage->balancer->increment_storage;
+
+    is $replicated->schema->storage->balancer->current_replicant,
+       $replicated->schema->storage->master
+       => 'master_read_weight is honored';
+
+    ## turn it off for the duration of the test
+    $replicated->schema->storage->balancer->master_read_weight(0);
+    $replicated->schema->storage->balancer->increment_storage;
+}
+
 ## Add some new rows that only the master will have  This is because
 ## we overload any type of write operation so that is must hit the master
 ## database.
@@ -350,14 +469,34 @@
 
 $replicated->schema->storage->replicants->{$replicant_names[0]}->active(0);
 $replicated->schema->storage->replicants->{$replicant_names[1]}->active(0);
-    
-ok $replicated->schema->resultset('Artist')->find(2)
-    => 'Fallback to master';
 
+{
+    ## catch the fallback to master warning
+    open my $debugfh, '>', \my $fallback_warning;
+    my $oldfh = $replicated->schema->storage->debugfh;
+    $replicated->schema->storage->debugfh($debugfh);
+
+    ok $replicated->schema->resultset('Artist')->find(2)
+	=> 'Fallback to master';
+
+    like $fallback_warning, qr/falling back to master/
+	=> 'emits falling back to master warning';
+
+    $replicated->schema->storage->debugfh($oldfh);
+}
+
 $replicated->schema->storage->replicants->{$replicant_names[0]}->active(1);
 $replicated->schema->storage->replicants->{$replicant_names[1]}->active(1);
+
+## Silence warning about not supporting the is_replicating method if using the
+## sqlite dbs.
+$replicated->schema->storage->debugobj->silence(1)
+  if first { m{^t/} } @replicant_names;
+ 
 $replicated->schema->storage->pool->validate_replicants;
 
+$replicated->schema->storage->debugobj->silence(0);
+
 ok $replicated->schema->resultset('Artist')->find(2)
     => 'Returned to replicates';
     
@@ -577,3 +716,5 @@
 
 ## Delete the old database files
 $replicated->cleanup;
+
+# vim: sw=4 sts=4 :

Modified: DBIx-Class/0.08/branches/joined_count/t/96multi_create.t
===================================================================
--- DBIx-Class/0.08/branches/joined_count/t/96multi_create.t	2009-05-16 07:34:21 UTC (rev 6281)
+++ DBIx-Class/0.08/branches/joined_count/t/96multi_create.t	2009-05-16 07:35:47 UTC (rev 6282)
@@ -362,16 +362,16 @@
 
 	});
 	
-	ok( $cd_result && ref $cd_result eq 'DBICTest::CD', "Got Good CD Class");
+	isa_ok( $cd_result, 'DBICTest::CD', "Got Good CD Class");
 	ok( $cd_result->title eq "TestOneCD1", "Got Expected Title");
 	
 	my $tracks = $cd_result->tracks;
 	
-	ok( ref $tracks eq "DBIx::Class::ResultSet", "Got Expected Tracks ResultSet");
+	isa_ok( $tracks, 'DBIx::Class::ResultSet', 'Got Expected Tracks ResultSet');
 	
 	foreach my $track ($tracks->all)
 	{
-		ok( $track && ref $track eq 'DBICTest::Track', 'Got Expected Track Class');
+		isa_ok( $track, 'DBICTest::Track', 'Got Expected Track Class');
 	}
 }, 'First create_related pass');
 
@@ -391,17 +391,17 @@
 
 	});
 	
-	ok( $cd_result && ref $cd_result eq 'DBICTest::CD', "Got Good CD Class");
+	isa_ok( $cd_result, 'DBICTest::CD', "Got Good CD Class");
 	ok( $cd_result->title eq "TestOneCD2", "Got Expected Title");
   ok( $cd_result->notes eq 'I can haz liner notes?', 'Liner notes');
 	
 	my $tracks = $cd_result->tracks;
 	
-	ok( ref $tracks eq "DBIx::Class::ResultSet", "Got Expected Tracks ResultSet");
+	isa_ok( $tracks, 'DBIx::Class::ResultSet', "Got Expected Tracks ResultSet");
 	
 	foreach my $track ($tracks->all)
 	{
-		ok( $track && ref $track eq 'DBICTest::Track', 'Got Expected Track Class');
+		isa_ok( $track, 'DBICTest::Track', 'Got Expected Track Class');
 	}
 }, 'second create_related with same arguments');
 

Added: DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/BaseResult.pm
===================================================================
--- DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/BaseResult.pm	                        (rev 0)
+++ DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/BaseResult.pm	2009-05-16 07:35:47 UTC (rev 6282)
@@ -0,0 +1,14 @@
+package #hide from pause
+  DBICTest::BaseResult;
+
+use strict;
+use warnings;
+
+use base qw/DBIx::Class/;
+use DBICTest::BaseResultSet;
+
+__PACKAGE__->load_components (qw/Core/);
+__PACKAGE__->table ('bogus');
+__PACKAGE__->resultset_class ('DBICTest::BaseResultSet');
+
+1;

Added: DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/BaseResultSet.pm
===================================================================
--- DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/BaseResultSet.pm	                        (rev 0)
+++ DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/BaseResultSet.pm	2009-05-16 07:35:47 UTC (rev 6282)
@@ -0,0 +1,13 @@
+package #hide from pause
+  DBICTest::BaseResultSet;
+
+use strict;
+use warnings;
+
+use base qw/DBIx::Class::ResultSet/;
+
+sub hri_dump {
+  return shift->search ({}, { result_class => 'DBIx::Class::ResultClass::HashRefInflator' });
+}
+
+1;

Modified: DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/Schema/Artist.pm
===================================================================
--- DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/Schema/Artist.pm	2009-05-16 07:34:21 UTC (rev 6281)
+++ DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/Schema/Artist.pm	2009-05-16 07:35:47 UTC (rev 6282)
@@ -1,7 +1,7 @@
 package # hide from PAUSE 
     DBICTest::Schema::Artist;
 
-use base 'DBIx::Class::Core';
+use base qw/DBICTest::BaseResult/;
 
 __PACKAGE__->table('artist');
 __PACKAGE__->source_info({

Modified: DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/Schema/ArtistUndirectedMap.pm
===================================================================
--- DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/Schema/ArtistUndirectedMap.pm	2009-05-16 07:34:21 UTC (rev 6281)
+++ DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/Schema/ArtistUndirectedMap.pm	2009-05-16 07:35:47 UTC (rev 6282)
@@ -1,7 +1,7 @@
 package # hide from PAUSE 
     DBICTest::Schema::ArtistUndirectedMap;
 
-use base 'DBIx::Class::Core';
+use base qw/DBICTest::BaseResult/;
 
 __PACKAGE__->table('artist_undirected_map');
 __PACKAGE__->add_columns(

Modified: DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/Schema/Artwork.pm
===================================================================
--- DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/Schema/Artwork.pm	2009-05-16 07:34:21 UTC (rev 6281)
+++ DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/Schema/Artwork.pm	2009-05-16 07:35:47 UTC (rev 6282)
@@ -1,7 +1,7 @@
 package # hide from PAUSE
     DBICTest::Schema::Artwork;
 
-use base qw/DBIx::Class::Core/;
+use base qw/DBICTest::BaseResult/;
 
 __PACKAGE__->table('cd_artwork');
 __PACKAGE__->add_columns(

Modified: DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/Schema/Artwork_to_Artist.pm
===================================================================
--- DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/Schema/Artwork_to_Artist.pm	2009-05-16 07:34:21 UTC (rev 6281)
+++ DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/Schema/Artwork_to_Artist.pm	2009-05-16 07:35:47 UTC (rev 6282)
@@ -1,7 +1,7 @@
 package # hide from PAUSE
     DBICTest::Schema::Artwork_to_Artist;
 
-use base qw/DBIx::Class::Core/;
+use base qw/DBICTest::BaseResult/;
 
 __PACKAGE__->table('artwork_to_artist');
 __PACKAGE__->add_columns(

Modified: DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/Schema/BindType.pm
===================================================================
--- DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/Schema/BindType.pm	2009-05-16 07:34:21 UTC (rev 6281)
+++ DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/Schema/BindType.pm	2009-05-16 07:35:47 UTC (rev 6282)
@@ -1,7 +1,7 @@
 package # hide from PAUSE 
     DBICTest::Schema::BindType;
 
-use base 'DBIx::Class::Core';
+use base qw/DBICTest::BaseResult/;
 
 __PACKAGE__->table('bindtype_test');
 

Modified: DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/Schema/Bookmark.pm
===================================================================
--- DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/Schema/Bookmark.pm	2009-05-16 07:34:21 UTC (rev 6281)
+++ DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/Schema/Bookmark.pm	2009-05-16 07:35:47 UTC (rev 6282)
@@ -1,7 +1,7 @@
 package # hide from PAUSE
     DBICTest::Schema::Bookmark;
 
-    use base 'DBIx::Class::Core';
+    use base qw/DBICTest::BaseResult/;
 
 
 use strict;

Modified: DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/Schema/BooksInLibrary.pm
===================================================================
--- DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/Schema/BooksInLibrary.pm	2009-05-16 07:34:21 UTC (rev 6281)
+++ DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/Schema/BooksInLibrary.pm	2009-05-16 07:35:47 UTC (rev 6282)
@@ -1,7 +1,7 @@
 package # hide from PAUSE 
     DBICTest::Schema::BooksInLibrary;
 
-use base qw/DBIx::Class::Core/;
+use base qw/DBICTest::BaseResult/;
 
 __PACKAGE__->table('books');
 __PACKAGE__->add_columns(

Modified: DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/Schema/CD.pm
===================================================================
--- DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/Schema/CD.pm	2009-05-16 07:34:21 UTC (rev 6281)
+++ DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/Schema/CD.pm	2009-05-16 07:35:47 UTC (rev 6282)
@@ -1,7 +1,7 @@
 package # hide from PAUSE 
     DBICTest::Schema::CD;
 
-use base 'DBIx::Class::Core';
+use base qw/DBICTest::BaseResult/;
 
 __PACKAGE__->table('cd');
 __PACKAGE__->add_columns(

Modified: DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/Schema/CD_to_Producer.pm
===================================================================
--- DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/Schema/CD_to_Producer.pm	2009-05-16 07:34:21 UTC (rev 6281)
+++ DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/Schema/CD_to_Producer.pm	2009-05-16 07:35:47 UTC (rev 6282)
@@ -1,7 +1,7 @@
 package # hide from PAUSE 
     DBICTest::Schema::CD_to_Producer;
 
-use base 'DBIx::Class::Core';
+use base qw/DBICTest::BaseResult/;
 
 __PACKAGE__->table('cd_to_producer');
 __PACKAGE__->add_columns(

Modified: DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/Schema/Collection.pm
===================================================================
--- DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/Schema/Collection.pm	2009-05-16 07:34:21 UTC (rev 6281)
+++ DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/Schema/Collection.pm	2009-05-16 07:35:47 UTC (rev 6282)
@@ -1,7 +1,7 @@
 package # hide from PAUSE 
     DBICTest::Schema::Collection;
 
-use base qw/DBIx::Class::Core/;
+use base qw/DBICTest::BaseResult/;
 
 __PACKAGE__->table('collection');
 __PACKAGE__->add_columns(

Modified: DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/Schema/CollectionObject.pm
===================================================================
--- DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/Schema/CollectionObject.pm	2009-05-16 07:34:21 UTC (rev 6281)
+++ DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/Schema/CollectionObject.pm	2009-05-16 07:35:47 UTC (rev 6282)
@@ -1,7 +1,7 @@
 package # hide from PAUSE 
     DBICTest::Schema::CollectionObject;
 
-use base qw/DBIx::Class::Core/;
+use base qw/DBICTest::BaseResult/;
 
 __PACKAGE__->table('collection_object');
 __PACKAGE__->add_columns(

Modified: DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/Schema/Dummy.pm
===================================================================
--- DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/Schema/Dummy.pm	2009-05-16 07:34:21 UTC (rev 6281)
+++ DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/Schema/Dummy.pm	2009-05-16 07:35:47 UTC (rev 6282)
@@ -1,7 +1,7 @@
 package # hide from PAUSE
     DBICTest::Schema::Dummy;
 
-use base 'DBIx::Class::Core';
+use base qw/DBICTest::BaseResult/;
 
 use strict;
 use warnings;

Modified: DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/Schema/Employee.pm
===================================================================
--- DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/Schema/Employee.pm	2009-05-16 07:34:21 UTC (rev 6281)
+++ DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/Schema/Employee.pm	2009-05-16 07:35:47 UTC (rev 6282)
@@ -1,7 +1,7 @@
 package # hide from PAUSE 
     DBICTest::Schema::Employee;
 
-use base 'DBIx::Class::Core';
+use base qw/DBICTest::BaseResult/;
 
 __PACKAGE__->load_components(qw( Ordered ));
 

Modified: DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/Schema/Encoded.pm
===================================================================
--- DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/Schema/Encoded.pm	2009-05-16 07:34:21 UTC (rev 6281)
+++ DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/Schema/Encoded.pm	2009-05-16 07:35:47 UTC (rev 6282)
@@ -1,7 +1,7 @@
 package # hide from PAUSE
     DBICTest::Schema::Encoded;
 
-use base 'DBIx::Class::Core';
+use base qw/DBICTest::BaseResult/;
 
 use strict;
 use warnings;

Modified: DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/Schema/Event.pm
===================================================================
--- DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/Schema/Event.pm	2009-05-16 07:34:21 UTC (rev 6281)
+++ DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/Schema/Event.pm	2009-05-16 07:35:47 UTC (rev 6282)
@@ -2,7 +2,7 @@
 
 use strict;
 use warnings;
-use base qw/DBIx::Class::Core/;
+use base qw/DBICTest::BaseResult/;
 
 __PACKAGE__->load_components(qw/InflateColumn::DateTime/);
 

Modified: DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/Schema/EventTZ.pm
===================================================================
--- DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/Schema/EventTZ.pm	2009-05-16 07:34:21 UTC (rev 6281)
+++ DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/Schema/EventTZ.pm	2009-05-16 07:35:47 UTC (rev 6282)
@@ -2,7 +2,7 @@
 
 use strict;
 use warnings;
-use base qw/DBIx::Class::Core/;
+use base qw/DBICTest::BaseResult/;
 
 __PACKAGE__->load_components(qw/InflateColumn::DateTime/);
 

Modified: DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/Schema/EventTZDeprecated.pm
===================================================================
--- DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/Schema/EventTZDeprecated.pm	2009-05-16 07:34:21 UTC (rev 6281)
+++ DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/Schema/EventTZDeprecated.pm	2009-05-16 07:35:47 UTC (rev 6282)
@@ -2,7 +2,7 @@
 
 use strict;
 use warnings;
-use base qw/DBIx::Class::Core/;
+use base qw/DBICTest::BaseResult/;
 
 __PACKAGE__->load_components(qw/InflateColumn::DateTime/);
 

Modified: DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/Schema/FileColumn.pm
===================================================================
--- DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/Schema/FileColumn.pm	2009-05-16 07:34:21 UTC (rev 6281)
+++ DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/Schema/FileColumn.pm	2009-05-16 07:35:47 UTC (rev 6282)
@@ -3,7 +3,7 @@
 
 use strict;
 use warnings;
-use base qw/DBIx::Class::Core/;
+use base qw/DBICTest::BaseResult/;
 use File::Temp qw/tempdir/;
 
 __PACKAGE__->load_components(qw/InflateColumn::File/);

Modified: DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/Schema/ForceForeign.pm
===================================================================
--- DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/Schema/ForceForeign.pm	2009-05-16 07:34:21 UTC (rev 6281)
+++ DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/Schema/ForceForeign.pm	2009-05-16 07:35:47 UTC (rev 6282)
@@ -1,7 +1,7 @@
 package # hide from PAUSE
     DBICTest::Schema::ForceForeign;
 
-use base 'DBIx::Class::Core';
+use base qw/DBICTest::BaseResult/;
 
 __PACKAGE__->table('forceforeign');
 __PACKAGE__->add_columns(

Modified: DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/Schema/FourKeys.pm
===================================================================
--- DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/Schema/FourKeys.pm	2009-05-16 07:34:21 UTC (rev 6281)
+++ DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/Schema/FourKeys.pm	2009-05-16 07:35:47 UTC (rev 6282)
@@ -1,7 +1,7 @@
 package # hide from PAUSE 
     DBICTest::Schema::FourKeys;
 
-use base 'DBIx::Class::Core';
+use base qw/DBICTest::BaseResult/;
 
 __PACKAGE__->table('fourkeys');
 __PACKAGE__->add_columns(

Modified: DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/Schema/FourKeys_to_TwoKeys.pm
===================================================================
--- DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/Schema/FourKeys_to_TwoKeys.pm	2009-05-16 07:34:21 UTC (rev 6281)
+++ DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/Schema/FourKeys_to_TwoKeys.pm	2009-05-16 07:35:47 UTC (rev 6282)
@@ -1,7 +1,7 @@
 package # hide from PAUSE 
     DBICTest::Schema::FourKeys_to_TwoKeys;
 
-use base 'DBIx::Class::Core';
+use base qw/DBICTest::BaseResult/;
 
 __PACKAGE__->table('fourkeys_to_twokeys');
 __PACKAGE__->add_columns(

Modified: DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/Schema/Genre.pm
===================================================================
--- DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/Schema/Genre.pm	2009-05-16 07:34:21 UTC (rev 6281)
+++ DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/Schema/Genre.pm	2009-05-16 07:35:47 UTC (rev 6282)
@@ -2,7 +2,7 @@
 
 use strict;
 
-use base 'DBIx::Class::Core';
+use base qw/DBICTest::BaseResult/;
 
 __PACKAGE__->table('genre');
 __PACKAGE__->add_columns(

Modified: DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/Schema/Image.pm
===================================================================
--- DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/Schema/Image.pm	2009-05-16 07:34:21 UTC (rev 6281)
+++ DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/Schema/Image.pm	2009-05-16 07:35:47 UTC (rev 6282)
@@ -1,7 +1,7 @@
 package # hide from PAUSE 
     DBICTest::Schema::Image;
 
-use base qw/DBIx::Class::Core/;
+use base qw/DBICTest::BaseResult/;
 
 __PACKAGE__->table('images');
 __PACKAGE__->add_columns(

Modified: DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/Schema/LinerNotes.pm
===================================================================
--- DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/Schema/LinerNotes.pm	2009-05-16 07:34:21 UTC (rev 6281)
+++ DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/Schema/LinerNotes.pm	2009-05-16 07:35:47 UTC (rev 6282)
@@ -1,7 +1,7 @@
 package # hide from PAUSE 
     DBICTest::Schema::LinerNotes;
 
-use base qw/DBIx::Class::Core/;
+use base qw/DBICTest::BaseResult/;
 
 __PACKAGE__->table('liner_notes');
 __PACKAGE__->add_columns(

Modified: DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/Schema/Link.pm
===================================================================
--- DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/Schema/Link.pm	2009-05-16 07:34:21 UTC (rev 6281)
+++ DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/Schema/Link.pm	2009-05-16 07:35:47 UTC (rev 6282)
@@ -1,7 +1,7 @@
 package # hide from PAUSE
     DBICTest::Schema::Link;
 
-use base 'DBIx::Class::Core';
+use base qw/DBICTest::BaseResult/;
 
 use strict;
 use warnings;

Modified: DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/Schema/LyricVersion.pm
===================================================================
--- DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/Schema/LyricVersion.pm	2009-05-16 07:34:21 UTC (rev 6281)
+++ DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/Schema/LyricVersion.pm	2009-05-16 07:35:47 UTC (rev 6282)
@@ -1,7 +1,7 @@
 package # hide from PAUSE
     DBICTest::Schema::LyricVersion;
 
-use base qw/DBIx::Class::Core/;
+use base qw/DBICTest::BaseResult/;
 
 __PACKAGE__->table('lyric_versions');
 __PACKAGE__->add_columns(

Modified: DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/Schema/Lyrics.pm
===================================================================
--- DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/Schema/Lyrics.pm	2009-05-16 07:34:21 UTC (rev 6281)
+++ DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/Schema/Lyrics.pm	2009-05-16 07:35:47 UTC (rev 6282)
@@ -1,7 +1,7 @@
 package # hide from PAUSE 
     DBICTest::Schema::Lyrics;
 
-use base qw/DBIx::Class::Core/;
+use base qw/DBICTest::BaseResult/;
 
 __PACKAGE__->table('lyrics');
 __PACKAGE__->add_columns(

Modified: DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/Schema/NoPrimaryKey.pm
===================================================================
--- DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/Schema/NoPrimaryKey.pm	2009-05-16 07:34:21 UTC (rev 6281)
+++ DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/Schema/NoPrimaryKey.pm	2009-05-16 07:35:47 UTC (rev 6282)
@@ -1,7 +1,7 @@
 package # hide from PAUSE 
     DBICTest::Schema::NoPrimaryKey;
 
-use base 'DBIx::Class::Core';
+use base qw/DBICTest::BaseResult/;
 
 __PACKAGE__->table('noprimarykey');
 __PACKAGE__->add_columns(

Modified: DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/Schema/OneKey.pm
===================================================================
--- DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/Schema/OneKey.pm	2009-05-16 07:34:21 UTC (rev 6281)
+++ DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/Schema/OneKey.pm	2009-05-16 07:35:47 UTC (rev 6282)
@@ -1,7 +1,7 @@
 package # hide from PAUSE 
     DBICTest::Schema::OneKey;
 
-use base 'DBIx::Class::Core';
+use base qw/DBICTest::BaseResult/;
 
 __PACKAGE__->table('onekey');
 __PACKAGE__->add_columns(

Modified: DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/Schema/Owners.pm
===================================================================
--- DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/Schema/Owners.pm	2009-05-16 07:34:21 UTC (rev 6281)
+++ DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/Schema/Owners.pm	2009-05-16 07:35:47 UTC (rev 6282)
@@ -1,7 +1,7 @@
 package # hide from PAUSE 
     DBICTest::Schema::Owners;
 
-use base qw/DBIx::Class::Core/;
+use base qw/DBICTest::BaseResult/;
 
 __PACKAGE__->table('owners');
 __PACKAGE__->add_columns(

Modified: DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/Schema/Producer.pm
===================================================================
--- DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/Schema/Producer.pm	2009-05-16 07:34:21 UTC (rev 6281)
+++ DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/Schema/Producer.pm	2009-05-16 07:35:47 UTC (rev 6282)
@@ -1,7 +1,7 @@
 package # hide from PAUSE 
     DBICTest::Schema::Producer;
 
-use base 'DBIx::Class::Core';
+use base qw/DBICTest::BaseResult/;
 
 __PACKAGE__->table('producer');
 __PACKAGE__->add_columns(

Modified: DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/Schema/SelfRef.pm
===================================================================
--- DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/Schema/SelfRef.pm	2009-05-16 07:34:21 UTC (rev 6281)
+++ DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/Schema/SelfRef.pm	2009-05-16 07:35:47 UTC (rev 6282)
@@ -1,7 +1,7 @@
 package # hide from PAUSE 
     DBICTest::Schema::SelfRef;
 
-use base 'DBIx::Class::Core';
+use base qw/DBICTest::BaseResult/;
 
 __PACKAGE__->table('self_ref');
 __PACKAGE__->add_columns(

Modified: DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/Schema/SelfRefAlias.pm
===================================================================
--- DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/Schema/SelfRefAlias.pm	2009-05-16 07:34:21 UTC (rev 6281)
+++ DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/Schema/SelfRefAlias.pm	2009-05-16 07:35:47 UTC (rev 6282)
@@ -1,7 +1,7 @@
 package # hide from PAUSE 
     DBICTest::Schema::SelfRefAlias;
 
-use base 'DBIx::Class::Core';
+use base qw/DBICTest::BaseResult/;
 
 __PACKAGE__->table('self_ref_alias');
 __PACKAGE__->add_columns(

Modified: DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/Schema/SequenceTest.pm
===================================================================
--- DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/Schema/SequenceTest.pm	2009-05-16 07:34:21 UTC (rev 6281)
+++ DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/Schema/SequenceTest.pm	2009-05-16 07:35:47 UTC (rev 6282)
@@ -1,7 +1,7 @@
 package # hide from PAUSE 
     DBICTest::Schema::SequenceTest;
 
-use base 'DBIx::Class::Core';
+use base qw/DBICTest::BaseResult/;
 
 __PACKAGE__->table('sequence_test');
 __PACKAGE__->source_info({

Modified: DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/Schema/Serialized.pm
===================================================================
--- DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/Schema/Serialized.pm	2009-05-16 07:34:21 UTC (rev 6281)
+++ DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/Schema/Serialized.pm	2009-05-16 07:35:47 UTC (rev 6282)
@@ -1,7 +1,7 @@
 package # hide from PAUSE 
     DBICTest::Schema::Serialized;
 
-use base 'DBIx::Class::Core';
+use base qw/DBICTest::BaseResult/;
 
 __PACKAGE__->table('serialized');
 __PACKAGE__->add_columns(

Modified: DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/Schema/Tag.pm
===================================================================
--- DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/Schema/Tag.pm	2009-05-16 07:34:21 UTC (rev 6281)
+++ DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/Schema/Tag.pm	2009-05-16 07:35:47 UTC (rev 6282)
@@ -1,7 +1,7 @@
 package # hide from PAUSE 
     DBICTest::Schema::Tag;
 
-use base qw/DBIx::Class::Core/;
+use base qw/DBICTest::BaseResult/;
 
 __PACKAGE__->table('tags');
 __PACKAGE__->add_columns(

Modified: DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/Schema/Track.pm
===================================================================
--- DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/Schema/Track.pm	2009-05-16 07:34:21 UTC (rev 6281)
+++ DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/Schema/Track.pm	2009-05-16 07:35:47 UTC (rev 6282)
@@ -1,7 +1,7 @@
 package # hide from PAUSE 
     DBICTest::Schema::Track;
 
-use base 'DBIx::Class::Core';
+use base qw/DBICTest::BaseResult/;
 __PACKAGE__->load_components(qw/InflateColumn::DateTime Ordered/);
 
 __PACKAGE__->table('track');

Modified: DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/Schema/TreeLike.pm
===================================================================
--- DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/Schema/TreeLike.pm	2009-05-16 07:34:21 UTC (rev 6281)
+++ DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/Schema/TreeLike.pm	2009-05-16 07:35:47 UTC (rev 6282)
@@ -1,7 +1,7 @@
 package # hide from PAUSE 
     DBICTest::Schema::TreeLike;
 
-use base qw/DBIx::Class::Core/;
+use base qw/DBICTest::BaseResult/;
 
 __PACKAGE__->table('treelike');
 __PACKAGE__->add_columns(

Modified: DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/Schema/TwoKeyTreeLike.pm
===================================================================
--- DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/Schema/TwoKeyTreeLike.pm	2009-05-16 07:34:21 UTC (rev 6281)
+++ DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/Schema/TwoKeyTreeLike.pm	2009-05-16 07:35:47 UTC (rev 6282)
@@ -1,7 +1,7 @@
 package # hide from PAUSE 
     DBICTest::Schema::TwoKeyTreeLike;
 
-use base qw/DBIx::Class::Core/;
+use base qw/DBICTest::BaseResult/;
 
 __PACKAGE__->table('twokeytreelike');
 __PACKAGE__->add_columns(

Modified: DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/Schema/TwoKeys.pm
===================================================================
--- DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/Schema/TwoKeys.pm	2009-05-16 07:34:21 UTC (rev 6281)
+++ DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/Schema/TwoKeys.pm	2009-05-16 07:35:47 UTC (rev 6282)
@@ -1,7 +1,7 @@
 package # hide from PAUSE
     DBICTest::Schema::TwoKeys;
 
-use base 'DBIx::Class::Core';
+use base qw/DBICTest::BaseResult/;
 
 __PACKAGE__->table('twokeys');
 __PACKAGE__->add_columns(

Modified: DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/Schema/TypedObject.pm
===================================================================
--- DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/Schema/TypedObject.pm	2009-05-16 07:34:21 UTC (rev 6281)
+++ DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/Schema/TypedObject.pm	2009-05-16 07:35:47 UTC (rev 6282)
@@ -1,7 +1,7 @@
 package # hide from PAUSE 
     DBICTest::Schema::TypedObject;
 
-use base qw/DBIx::Class::Core/;
+use base qw/DBICTest::BaseResult/;
 
 __PACKAGE__->table('typed_object');
 __PACKAGE__->add_columns(

Modified: DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/Schema/Year1999CDs.pm
===================================================================
--- DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/Schema/Year1999CDs.pm	2009-05-16 07:34:21 UTC (rev 6281)
+++ DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/Schema/Year1999CDs.pm	2009-05-16 07:35:47 UTC (rev 6282)
@@ -2,7 +2,7 @@
     DBICTest::Schema::Year1999CDs;
 ## Used in 104view.t
 
-use base 'DBIx::Class::Core';
+use base qw/DBICTest::BaseResult/;
 use DBIx::Class::ResultSource::View;
 
 __PACKAGE__->table_class('DBIx::Class::ResultSource::View');

Modified: DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/Schema/Year2000CDs.pm
===================================================================
--- DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/Schema/Year2000CDs.pm	2009-05-16 07:34:21 UTC (rev 6281)
+++ DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest/Schema/Year2000CDs.pm	2009-05-16 07:35:47 UTC (rev 6282)
@@ -2,7 +2,7 @@
     DBICTest::Schema::Year2000CDs;
 ## Used in 104view.t
 
-use base 'DBIx::Class::Core';
+use base qw/DBICTest::BaseResult/;
 use DBIx::Class::ResultSource::View;
 
 __PACKAGE__->table_class('DBIx::Class::ResultSource::View');

Modified: DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest.pm
===================================================================
--- DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest.pm	2009-05-16 07:34:21 UTC (rev 6281)
+++ DBIx-Class/0.08/branches/joined_count/t/lib/DBICTest.pm	2009-05-16 07:35:47 UTC (rev 6282)
@@ -75,7 +75,7 @@
     my $dbuser = $ENV{"DBICTEST_DBUSER"} || '';
     my $dbpass = $ENV{"DBICTEST_DBPASS"} || '';
 
-    my @connect_info = ($dsn, $dbuser, $dbpass, { AutoCommit => 1 });
+    my @connect_info = ($dsn, $dbuser, $dbpass, { AutoCommit => 1, %args });
 
     return @connect_info;
 }

Modified: DBIx-Class/0.08/branches/joined_count/t/prefetch/attrs_untouched.t
===================================================================
--- DBIx-Class/0.08/branches/joined_count/t/prefetch/attrs_untouched.t	2009-05-16 07:34:21 UTC (rev 6281)
+++ DBIx-Class/0.08/branches/joined_count/t/prefetch/attrs_untouched.t	2009-05-16 07:35:47 UTC (rev 6282)
@@ -19,18 +19,6 @@
         : ( tests => 3 );
 }
 
-# figure out if we've got a version of sqlite that is older than 3.2.6, in
-# which case COUNT(DISTINCT()) doesn't work
-my $is_broken_sqlite = 0;
-my ($sqlite_major_ver,$sqlite_minor_ver,$sqlite_patch_ver) =
-    split /\./, $schema->storage->dbh->get_info(18);
-if( $schema->storage->dbh->get_info(17) eq 'SQLite' &&
-    ( ($sqlite_major_ver < 3) ||
-      ($sqlite_major_ver == 3 && $sqlite_minor_ver < 2) ||
-      ($sqlite_major_ver == 3 && $sqlite_minor_ver == 2 && $sqlite_patch_ver < 6) ) ) {
-    $is_broken_sqlite = 1;
-}
-
 # bug in 0.07000 caused attr (join/prefetch) to be modifed by search
 # so we check the search & attr arrays are not modified
 my $search = { 'artist.name' => 'Caterwauler McCrae' };

Modified: DBIx-Class/0.08/branches/joined_count/t/prefetch/multiple_hasmany.t
===================================================================
--- DBIx-Class/0.08/branches/joined_count/t/prefetch/multiple_hasmany.t	2009-05-16 07:34:21 UTC (rev 6281)
+++ DBIx-Class/0.08/branches/joined_count/t/prefetch/multiple_hasmany.t	2009-05-16 07:35:47 UTC (rev 6282)
@@ -20,18 +20,6 @@
         : ( tests => 16 );
 }
 
-# figure out if we've got a version of sqlite that is older than 3.2.6, in
-# which case COUNT(DISTINCT()) doesn't work
-my $is_broken_sqlite = 0;
-my ($sqlite_major_ver,$sqlite_minor_ver,$sqlite_patch_ver) =
-    split /\./, $schema->storage->dbh->get_info(18);
-if( $schema->storage->dbh->get_info(17) eq 'SQLite' &&
-    ( ($sqlite_major_ver < 3) ||
-      ($sqlite_major_ver == 3 && $sqlite_minor_ver < 2) ||
-      ($sqlite_major_ver == 3 && $sqlite_minor_ver == 2 && $sqlite_patch_ver < 6) ) ) {
-    $is_broken_sqlite = 1;
-}
-
 # once the following TODO is complete, remove the 2 warning tests immediately
 # after the TODO block
 # (the TODO block itself contains tests ensuring that the warns are removed)

Modified: DBIx-Class/0.08/branches/joined_count/t/prefetch/pollute_already_joined.t
===================================================================
--- DBIx-Class/0.08/branches/joined_count/t/prefetch/pollute_already_joined.t	2009-05-16 07:34:21 UTC (rev 6281)
+++ DBIx-Class/0.08/branches/joined_count/t/prefetch/pollute_already_joined.t	2009-05-16 07:35:47 UTC (rev 6282)
@@ -20,18 +20,6 @@
         : ( tests => 10 );
 }
 
-# figure out if we've got a version of sqlite that is older than 3.2.6, in
-# which case COUNT(DISTINCT()) doesn't work
-my $is_broken_sqlite = 0;
-my ($sqlite_major_ver,$sqlite_minor_ver,$sqlite_patch_ver) =
-    split /\./, $schema->storage->dbh->get_info(18);
-if( $schema->storage->dbh->get_info(17) eq 'SQLite' &&
-    ( ($sqlite_major_ver < 3) ||
-      ($sqlite_major_ver == 3 && $sqlite_minor_ver < 2) ||
-      ($sqlite_major_ver == 3 && $sqlite_minor_ver == 2 && $sqlite_patch_ver < 6) ) ) {
-    $is_broken_sqlite = 1;
-}
-
 # A search() with prefetch seems to pollute an already joined resultset
 # in a way that offsets future joins (adapted from a test case by Debolaz)
 {

Modified: DBIx-Class/0.08/branches/joined_count/t/prefetch/standard.t
===================================================================
--- DBIx-Class/0.08/branches/joined_count/t/prefetch/standard.t	2009-05-16 07:34:21 UTC (rev 6281)
+++ DBIx-Class/0.08/branches/joined_count/t/prefetch/standard.t	2009-05-16 07:35:47 UTC (rev 6282)
@@ -20,18 +20,6 @@
         : ( tests => 45 );
 }
 
-# figure out if we've got a version of sqlite that is older than 3.2.6, in
-# which case COUNT(DISTINCT()) doesn't work
-my $is_broken_sqlite = 0;
-my ($sqlite_major_ver,$sqlite_minor_ver,$sqlite_patch_ver) =
-    split /\./, $schema->storage->dbh->get_info(18);
-if( $schema->storage->dbh->get_info(17) eq 'SQLite' &&
-    ( ($sqlite_major_ver < 3) ||
-      ($sqlite_major_ver == 3 && $sqlite_minor_ver < 2) ||
-      ($sqlite_major_ver == 3 && $sqlite_minor_ver == 2 && $sqlite_patch_ver < 6) ) ) {
-    $is_broken_sqlite = 1;
-}
-
 my $queries = 0;
 $schema->storage->debugcb(sub { $queries++; });
 $schema->storage->debug(1);
@@ -160,11 +148,7 @@
   { group_by => [qw/ title me.cdid /] }
 );
 
-SKIP: {
-    skip "SQLite < 3.2.6 doesn't understand COUNT(DISTINCT())", 1
-        if $is_broken_sqlite;
-    cmp_ok( $rs->count, '==', 5, "count() ok after group_by on main pk" );
-}
+cmp_ok( $rs->count, '==', 5, "count() ok after group_by on main pk" );
 
 cmp_ok( scalar $rs->all, '==', 5, "all() returns same count as count() after group_by on main pk" );
 
@@ -173,11 +157,7 @@
   { join => [qw/ artist /], group_by => [qw/ artist.name /] }
 );
 
-SKIP: {
-    skip "SQLite < 3.2.6 doesn't understand COUNT(DISTINCT())", 1
-        if $is_broken_sqlite;
-    cmp_ok( $rs->count, '==', 3, "count() ok after group_by on related column" );
-}
+cmp_ok( $rs->count, '==', 3, "count() ok after group_by on related column" );
 
 $rs = $schema->resultset("Artist")->search(
   {},
@@ -195,11 +175,7 @@
           'cds_2.title' => 'Forkful of bees' },
         { join => [ 'cds', 'cds' ] });
 
-SKIP: {
-    skip "SQLite < 3.2.6 doesn't understand COUNT(DISTINCT())", 1
-        if $is_broken_sqlite;
-    cmp_ok($rs->count, '==', 1, "single artist returned from multi-join");
-}
+cmp_ok($rs->count, '==', 1, "single artist returned from multi-join");
 
 is($rs->next->name, 'Caterwauler McCrae', "Correct artist returned");
 

Modified: DBIx-Class/0.08/branches/joined_count/t/resultset_class.t
===================================================================
--- DBIx-Class/0.08/branches/joined_count/t/resultset_class.t	2009-05-16 07:34:21 UTC (rev 6281)
+++ DBIx-Class/0.08/branches/joined_count/t/resultset_class.t	2009-05-16 07:35:47 UTC (rev 6282)
@@ -11,7 +11,7 @@
 
 use DBICTest;
 
-is(DBICTest::Schema->source('Artist')->resultset_class, 'DBIx::Class::ResultSet', 'default resultset class');
+is(DBICTest::Schema->source('Artist')->resultset_class, 'DBICTest::BaseResultSet', 'default resultset class');
 ok(!Class::Inspector->loaded('DBICNSTest::ResultSet::A'), 'custom resultset class not loaded');
 DBICTest::Schema->source('Artist')->resultset_class('DBICNSTest::ResultSet::A');
 ok(Class::Inspector->loaded('DBICNSTest::ResultSet::A'), 'custom resultset class loaded automatically');




More information about the Bast-commits mailing list