[Bast-commits] r7264 - in
DBIx-Class/0.08/branches/_abandoned_but_possibly_useful/table_name_ref:
. lib/DBIx/Class lib/DBIx/Class/Storage
lib/DBIx/Class/Storage/DBI lib/DBIx/Class/Storage/DBI/Oracle
lib/DBIx/Class/Storage/DBI/Sybase t
ribasushi at dev.catalyst.perl.org
ribasushi at dev.catalyst.perl.org
Sat Aug 8 15:51:24 GMT 2009
Author: ribasushi
Date: 2009-08-08 15:51:23 +0000 (Sat, 08 Aug 2009)
New Revision: 7264
Added:
DBIx-Class/0.08/branches/_abandoned_but_possibly_useful/table_name_ref/t/92storage_ping_count.t
Modified:
DBIx-Class/0.08/branches/_abandoned_but_possibly_useful/table_name_ref/
DBIx-Class/0.08/branches/_abandoned_but_possibly_useful/table_name_ref/Changes
DBIx-Class/0.08/branches/_abandoned_but_possibly_useful/table_name_ref/Makefile.PL
DBIx-Class/0.08/branches/_abandoned_but_possibly_useful/table_name_ref/lib/DBIx/Class/Ordered.pm
DBIx-Class/0.08/branches/_abandoned_but_possibly_useful/table_name_ref/lib/DBIx/Class/PK.pm
DBIx-Class/0.08/branches/_abandoned_but_possibly_useful/table_name_ref/lib/DBIx/Class/Row.pm
DBIx-Class/0.08/branches/_abandoned_but_possibly_useful/table_name_ref/lib/DBIx/Class/Schema.pm
DBIx-Class/0.08/branches/_abandoned_but_possibly_useful/table_name_ref/lib/DBIx/Class/Storage/DBI.pm
DBIx-Class/0.08/branches/_abandoned_but_possibly_useful/table_name_ref/lib/DBIx/Class/Storage/DBI/MSSQL.pm
DBIx-Class/0.08/branches/_abandoned_but_possibly_useful/table_name_ref/lib/DBIx/Class/Storage/DBI/ODBC.pm
DBIx-Class/0.08/branches/_abandoned_but_possibly_useful/table_name_ref/lib/DBIx/Class/Storage/DBI/Oracle.pm
DBIx-Class/0.08/branches/_abandoned_but_possibly_useful/table_name_ref/lib/DBIx/Class/Storage/DBI/Oracle/Generic.pm
DBIx-Class/0.08/branches/_abandoned_but_possibly_useful/table_name_ref/lib/DBIx/Class/Storage/DBI/Pg.pm
DBIx-Class/0.08/branches/_abandoned_but_possibly_useful/table_name_ref/lib/DBIx/Class/Storage/DBI/Sybase.pm
DBIx-Class/0.08/branches/_abandoned_but_possibly_useful/table_name_ref/lib/DBIx/Class/Storage/DBI/Sybase/Base.pm
DBIx-Class/0.08/branches/_abandoned_but_possibly_useful/table_name_ref/lib/DBIx/Class/Storage/DBI/Sybase/Microsoft_SQL_Server.pm
DBIx-Class/0.08/branches/_abandoned_but_possibly_useful/table_name_ref/lib/DBIx/Class/Storage/DBI/mysql.pm
DBIx-Class/0.08/branches/_abandoned_but_possibly_useful/table_name_ref/t/87ordered.t
DBIx-Class/0.08/branches/_abandoned_but_possibly_useful/table_name_ref/t/93storage_replication.t
Log:
r7256 at Thesaurus (orig r7253): ribasushi | 2009-08-07 11:19:35 +0200
r7232 at Thesaurus (orig r7229): jnapiorkowski | 2009-08-05 16:56:32 +0200
added test for the new default force pool behavior in PK->discard_changes and cleaned up the related tests a bit to give more meaningful info
r7233 at Thesaurus (orig r7230): jnapiorkowski | 2009-08-05 16:57:45 +0200
opps typo in test status messages
r7234 at Thesaurus (orig r7231): jnapiorkowski | 2009-08-05 17:03:46 +0200
added the default attrs to solve the failing test recently commited
r7235 at Thesaurus (orig r7232): jnapiorkowski | 2009-08-05 17:58:44 +0200
added test to make sure you can override the default attributes to discard_changes
r7241 at Thesaurus (orig r7238): jnapiorkowski | 2009-08-05 22:00:58 +0200
added replication as an optional feature to make installing it easier
r7253 at Thesaurus (orig r7250): ribasushi | 2009-08-07 11:06:41 +0200
Streamline makefile dep handling
r7254 at Thesaurus (orig r7251): ribasushi | 2009-08-07 11:07:14 +0200
Switch to done_testing
r7255 at Thesaurus (orig r7252): ribasushi | 2009-08-07 11:19:13 +0200
Move discard_changes code to Row.pm, better docs
r7257 at Thesaurus (orig r7254): ribasushi | 2009-08-07 11:21:35 +0200
Remove merged branch
r7259 at Thesaurus (orig r7256): ribasushi | 2009-08-07 14:16:13 +0200
Fix bogus POD
r7261 at Thesaurus (orig r7258): ribasushi | 2009-08-07 17:22:58 +0200
per mst: no optional deps
r7262 at Thesaurus (orig r7259): ribasushi | 2009-08-08 17:02:39 +0200
Stop using discard_changes() in Ordered (if I knew it will be *that* complex I would not touch it)
r7265 at Thesaurus (orig r7262): ribasushi | 2009-08-08 17:49:19 +0200
r7032 at Thesaurus (orig r7031): caelum | 2009-07-11 11:28:52 +0200
new branch to reduce connected() calls
r7033 at Thesaurus (orig r7032): caelum | 2009-07-11 13:07:41 +0200
added failing test
r7034 at Thesaurus (orig r7033): caelum | 2009-07-11 14:36:53 +0200
minor optimization
r7048 at Thesaurus (orig r7047): caelum | 2009-07-14 15:09:47 +0200
substantially reduced ping count, dynamic cursors support for mssql through odbc
r7050 at Thesaurus (orig r7049): caelum | 2009-07-14 16:06:39 +0200
a couple more options for odbc/mssql
r7052 at Thesaurus (orig r7051): caelum | 2009-07-15 00:14:09 +0200
unfuck ensure_connected for odbc/mssql
r7055 at Thesaurus (orig r7054): caelum | 2009-07-15 21:10:27 +0200
rename _scope_identity to _identity for odbc/mssql
r7056 at Thesaurus (orig r7055): caelum | 2009-07-16 00:41:45 +0200
add IC::DT tests for odbc/mssql
r7069 at Thesaurus (orig r7068): caelum | 2009-07-17 11:47:31 +0200
don't run connection actions if ->_rebless does not connect
r7108 at Thesaurus (orig r7105): caelum | 2009-07-24 07:26:13 +0200
moving test to another branch
r7110 at Thesaurus (orig r7107): caelum | 2009-07-24 07:52:33 +0200
revert odbc/mssql code to trunk and move it to another branch
r7111 at Thesaurus (orig r7108): caelum | 2009-07-24 08:13:35 +0200
revert t/746mssql.t to trunk and move to another branch
r7224 at Thesaurus (orig r7221): caelum | 2009-08-05 11:48:04 +0200
update branch after pull
r7225 at Thesaurus (orig r7222): ribasushi | 2009-08-05 12:09:07 +0200
Rename last_dbh and turn it into a public method
r7226 at Thesaurus (orig r7223): ribasushi | 2009-08-05 12:12:20 +0200
Whoopsie - more renames
r7227 at Thesaurus (orig r7224): ribasushi | 2009-08-05 12:32:09 +0200
Changes and a deploy() fix
r7228 at Thesaurus (orig r7225): ribasushi | 2009-08-05 12:36:01 +0200
We do not count pings during deploy - they are expected
r7229 at Thesaurus (orig r7226): ribasushi | 2009-08-05 12:49:06 +0200
Clarify autocommit default
r7238 at Thesaurus (orig r7235): caelum | 2009-08-05 20:39:47 +0200
fix up txn_begin and the ping_count test
r7263 at Thesaurus (orig r7260): ribasushi | 2009-08-08 17:40:19 +0200
A more straightforward txn_begin fix, some more test fixes
Property changes on: DBIx-Class/0.08/branches/_abandoned_but_possibly_useful/table_name_ref
___________________________________________________________________
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:7237
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:11788
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/count_rs:6741
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/DBIx-Class/0.08/branches/diamond_relationships:6310
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/grouped_prefetch:6885
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/DBIx-Class/0.08/branches/joined_count:6323
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/DBIx-Class/0.08/branches/mssql_money_type:7096
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/DBIx-Class/0.08/branches/mssql_storage_minor_refactor:7210
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/DBIx-Class/0.08/branches/mssql_top_fixes:6971
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/DBIx-Class/0.08/branches/multi_stuff:5565
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/DBIx-Class/0.08/branches/mysql_ansi:7175
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/DBIx-Class/0.08/branches/mystery_join:6589
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/DBIx-Class/0.08/branches/new_replication_transaction_fixup:7058
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/DBIx-Class/0.08/branches/on_connect_call:6854
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/order_by_refactor:6475
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/prefetch_limit:6724
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/DBIx-Class/0.08/branches/prefetch_redux:7206
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/DBIx-Class/0.08/branches/replication_dedux:4600
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/DBIx-Class/0.08/branches/rsrc_in_storage:6577
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/search_related_prefetch:6818
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/syb_connected:6919
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/top_limit_altfix:6429
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/DBIx-Class/0.08/branches/type_aware_update:6619
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/DBIx-Class/0.08/branches/unresolvable_prefetch:6949
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/tags/0.08108_prerelease_please_do_not_pull_into_it:7008
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/DBIx-Class/0.08/trunk:7237
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:7237
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:11788
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/count_rs:6741
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/DBIx-Class/0.08/branches/diamond_relationships:6310
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/DBIx-Class/0.08/branches/discard_changes_replication_fix:7252
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/grouped_prefetch:6885
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/DBIx-Class/0.08/branches/joined_count:6323
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/DBIx-Class/0.08/branches/mssql_money_type:7096
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/DBIx-Class/0.08/branches/mssql_storage_minor_refactor:7210
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/DBIx-Class/0.08/branches/mssql_top_fixes:6971
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/DBIx-Class/0.08/branches/multi_stuff:5565
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/DBIx-Class/0.08/branches/mysql_ansi:7175
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/DBIx-Class/0.08/branches/mystery_join:6589
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/DBIx-Class/0.08/branches/new_replication_transaction_fixup:7058
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/DBIx-Class/0.08/branches/on_connect_call:6854
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/order_by_refactor:6475
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/prefetch_limit:6724
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/DBIx-Class/0.08/branches/prefetch_redux:7206
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/DBIx-Class/0.08/branches/reduce_pings:7261
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/DBIx-Class/0.08/branches/replication_dedux:4600
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/DBIx-Class/0.08/branches/rsrc_in_storage:6577
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/search_related_prefetch:6818
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/syb_connected:6919
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/top_limit_altfix:6429
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/DBIx-Class/0.08/branches/type_aware_update:6619
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/DBIx-Class/0.08/branches/unresolvable_prefetch:6949
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/tags/0.08108_prerelease_please_do_not_pull_into_it:7008
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/DBIx-Class/0.08/trunk:7262
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
Name: svn:mergeinfo
+
Modified: DBIx-Class/0.08/branches/_abandoned_but_possibly_useful/table_name_ref/Changes
===================================================================
--- DBIx-Class/0.08/branches/_abandoned_but_possibly_useful/table_name_ref/Changes 2009-08-08 15:50:11 UTC (rev 7263)
+++ DBIx-Class/0.08/branches/_abandoned_but_possibly_useful/table_name_ref/Changes 2009-08-08 15:51:23 UTC (rev 7264)
@@ -10,6 +10,8 @@
- Fixed the way we detect transaction to make this more reliable
and forward looking.
- Fixed some trouble with the way Moose Types are used.
+ - Made discard_chages/get_from_storage replication aware (they
+ now read from the master storage by default)
- Refactor of MSSQL storage drivers, with some new features:
- Support for placeholders for MSSQL via DBD::Sybase with proper
autodetection
@@ -29,9 +31,13 @@
problems with search_related chaining
- Deal with the distinct => 1 attribute properly when using
prefetch
+ - Massive optimization of the DBI storage layer - reduce the
+ amount of connected() calls
+ - New ::Storage::DBI method last_dbh() - it will still return a
+ newly connected $dbh if we start unconnected, but will not ping
+ the server on every invocation unlike dbh()
- Multiple POD improvements
-
0.08108 2009-07-05 23:15:00 (UTC)
- Fixed the has_many prefetch with limit/group deficiency -
it is now possible to select "top 5 commenters" while
Modified: DBIx-Class/0.08/branches/_abandoned_but_possibly_useful/table_name_ref/Makefile.PL
===================================================================
--- DBIx-Class/0.08/branches/_abandoned_but_possibly_useful/table_name_ref/Makefile.PL 2009-08-08 15:50:11 UTC (rev 7263)
+++ DBIx-Class/0.08/branches/_abandoned_but_possibly_useful/table_name_ref/Makefile.PL 2009-08-08 15:51:23 UTC (rev 7264)
@@ -18,6 +18,7 @@
test_requires 'File::Temp' => 0.22;
+
# Core
requires 'List::Util' => 0;
requires 'Scalar::Util' => 0;
@@ -45,23 +46,17 @@
recommends 'SQL::Translator' => 0.09004;
-install_script (qw|
- script/dbicadmin
-|);
+my %replication_requires = (
+ 'Moose', => 0.87,
+ 'MooseX::AttributeHelpers' => 0.21,
+ 'MooseX::Types', => 0.16,
+ 'namespace::clean' => 0.11,
+ 'Hash::Merge', => 0.11,
+);
-tests_recursive (qw|
- t
-|);
+my %force_requires_if_author = (
+ %replication_requires,
-resources 'IRC' => 'irc://irc.perl.org/#dbix-class';
-resources 'license' => 'http://dev.perl.org/licenses/';
-resources 'repository' => 'http://dev.catalyst.perl.org/svnweb/bast/browse/DBIx-Class/';
-resources 'MailingList' => 'http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class';
-
-
-# re-build README and require extra modules for testing if we're in a checkout
-
-my %force_requires_if_author = (
# 'Module::Install::Pod::Inherit' => 0.01,
'Test::Pod::Coverage' => 1.04,
'SQL::Translator' => 0.09007,
@@ -85,13 +80,6 @@
# t/96_is_deteministic_value.t
'DateTime::Format::Strptime'=> 0,
- # t/93storage_replication.t
- 'Moose', => 0.87,
- 'MooseX::AttributeHelpers' => 0.21,
- 'MooseX::Types', => 0.16,
- 'namespace::clean' => 0.11,
- 'Hash::Merge', => 0.11,
-
# database-dependent reqs
#
$ENV{DBICTEST_PG_DSN}
@@ -115,6 +103,23 @@
,
);
+
+install_script (qw|
+ script/dbicadmin
+|);
+
+tests_recursive (qw|
+ t
+|);
+
+resources 'IRC' => 'irc://irc.perl.org/#dbix-class';
+resources 'license' => 'http://dev.perl.org/licenses/';
+resources 'repository' => 'http://dev.catalyst.perl.org/svnweb/bast/browse/DBIx-Class/';
+resources 'MailingList' => 'http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class';
+
+
+# re-build README and require extra modules for testing if we're in a checkout
+
if ($Module::Install::AUTHOR) {
warn <<'EOW';
******************************************************************************
@@ -139,8 +144,8 @@
unlink 'MANIFEST';
}
-# eval { require Module::Install::Pod::Inherit };
-# PodInherit() if !$@;
+# require Module::Install::Pod::Inherit;
+# PodInherit();
}
auto_install();
Modified: DBIx-Class/0.08/branches/_abandoned_but_possibly_useful/table_name_ref/lib/DBIx/Class/Ordered.pm
===================================================================
--- DBIx-Class/0.08/branches/_abandoned_but_possibly_useful/table_name_ref/lib/DBIx/Class/Ordered.pm 2009-08-08 15:50:11 UTC (rev 7263)
+++ DBIx-Class/0.08/branches/_abandoned_but_possibly_useful/table_name_ref/lib/DBIx/Class/Ordered.pm 2009-08-08 15:51:23 UTC (rev 7264)
@@ -362,38 +362,58 @@
my( $self, $to_position ) = @_;
return 0 if ( $to_position < 1 );
- my $from_position = $self->_position;
- return 0 if ( $from_position == $to_position );
-
my $position_column = $self->position_column;
- {
- my $guard = $self->result_source->schema->txn_scope_guard;
+ my $guard;
- my ($direction, @between);
- if ( $from_position < $to_position ) {
- $direction = -1;
- @between = map { $self->_position_value ($_) } ( $from_position + 1, $to_position );
- }
- else {
- $direction = 1;
- @between = map { $self->_position_value ($_) } ( $to_position, $from_position - 1 );
- }
+ if ($self->is_column_changed ($position_column) ) {
+ # something changed our position, we have no idea where we
+ # used to be - requery without using discard_changes
+ # (we need only a specific column back)
- my $new_pos_val = $self->_position_value ($to_position); # record this before the shift
+ $guard = $self->result_source->schema->txn_scope_guard;
- # we need to null-position the moved row if the position column is part of a constraint
- if (grep { $_ eq $position_column } ( map { @$_ } (values %{{ $self->result_source->unique_constraints }} ) ) ) {
- $self->_ordered_internal_update({ $position_column => $self->null_position_value });
- }
+ my $cursor = $self->result_source->resultset->search(
+ $self->ident_condition,
+ { select => $position_column },
+ )->cursor;
- $self->_shift_siblings ($direction, @between);
- $self->_ordered_internal_update({ $position_column => $new_pos_val });
+ my ($pos) = $cursor->next;
+ $self->$position_column ($pos);
+ delete $self->{_dirty_columns}{$position_column};
+ }
- $guard->commit;
+ my $from_position = $self->_position;
- return 1;
+ if ( $from_position == $to_position ) { # FIXME this will not work for non-numeric order
+ $guard->commit if $guard;
+ return 0;
}
+
+ $guard ||= $self->result_source->schema->txn_scope_guard;
+
+ my ($direction, @between);
+ if ( $from_position < $to_position ) {
+ $direction = -1;
+ @between = map { $self->_position_value ($_) } ( $from_position + 1, $to_position );
+ }
+ else {
+ $direction = 1;
+ @between = map { $self->_position_value ($_) } ( $to_position, $from_position - 1 );
+ }
+
+ my $new_pos_val = $self->_position_value ($to_position); # record this before the shift
+
+ # we need to null-position the moved row if the position column is part of a constraint
+ if (grep { $_ eq $position_column } ( map { @$_ } (values %{{ $self->result_source->unique_constraints }} ) ) ) {
+ $self->_ordered_internal_update({ $position_column => $self->null_position_value });
+ }
+
+ $self->_shift_siblings ($direction, @between);
+ $self->_ordered_internal_update({ $position_column => $new_pos_val });
+
+ $guard->commit;
+ return 1;
}
=head2 move_to_group
@@ -428,43 +448,71 @@
my $position_column = $self->position_column;
return 0 if ( defined($to_position) and $to_position < 1 );
+
+ # check if someone changed the _grouping_columns - this will
+ # prevent _is_in_group working, so we need to requery the db
+ # for the original values
+ my (@dirty_cols, %values, $guard);
+ for ($self->_grouping_columns) {
+ $values{$_} = $self->get_column ($_);
+ push @dirty_cols, $_ if $self->is_column_changed ($_);
+ }
+
+ # re-query only the dirty columns, and restore them on the
+ # object (subsequent code will update them to the correct
+ # after-move values)
+ if (@dirty_cols) {
+ $guard = $self->result_source->schema->txn_scope_guard;
+
+ my $cursor = $self->result_source->resultset->search(
+ $self->ident_condition,
+ { select => \@dirty_cols },
+ )->cursor;
+
+ my @original_values = $cursor->next;
+ $self->set_inflated_columns ({ %values, map { $_ => shift @original_values } (@dirty_cols) });
+ }
+
if ($self->_is_in_group ($to_group) ) {
- return 0 if not defined $to_position;
- return $self->move_to ($to_position);
+ my $ret;
+ if (defined $to_position) {
+ $ret = $self->move_to ($to_position);
+ }
+
+ $guard->commit if $guard;
+ return $ret||0;
}
- {
- my $guard = $self->result_source->schema->txn_scope_guard;
+ $guard ||= $self->result_source->schema->txn_scope_guard;
- # Move to end of current group to adjust siblings
- $self->move_last;
+ # Move to end of current group to adjust siblings
+ $self->move_last;
- $self->set_inflated_columns({ %$to_group, $position_column => undef });
- my $new_group_last_posval = $self->_last_sibling_posval;
- my $new_group_last_position = $self->_position_from_value (
- $new_group_last_posval
- );
+ $self->set_inflated_columns({ %$to_group, $position_column => undef });
+ my $new_group_last_posval = $self->_last_sibling_posval;
+ my $new_group_last_position = $self->_position_from_value (
+ $new_group_last_posval
+ );
- if ( not defined($to_position) or $to_position > $new_group_last_position) {
- $self->set_column(
- $position_column => $new_group_last_position
- ? $self->_next_position_value ( $new_group_last_posval )
- : $self->_initial_position_value
- );
- }
- else {
- my $bumped_pos_val = $self->_position_value ($to_position);
- my @between = ($to_position, $new_group_last_position);
- $self->_shift_siblings (1, @between); #shift right
- $self->set_column( $position_column => $bumped_pos_val );
- }
+ if ( not defined($to_position) or $to_position > $new_group_last_position) {
+ $self->set_column(
+ $position_column => $new_group_last_position
+ ? $self->_next_position_value ( $new_group_last_posval )
+ : $self->_initial_position_value
+ );
+ }
+ else {
+ my $bumped_pos_val = $self->_position_value ($to_position);
+ my @between = ($to_position, $new_group_last_position);
+ $self->_shift_siblings (1, @between); #shift right
+ $self->set_column( $position_column => $bumped_pos_val );
+ }
- $self->_ordered_internal_update;
+ $self->_ordered_internal_update;
- $guard->commit;
+ $guard->commit;
- return 1;
- }
+ return 1;
}
=head2 insert
@@ -508,16 +556,47 @@
# this is set by _ordered_internal_update()
return $self->next::method(@_) if $self->{_ORDERED_INTERNAL_UPDATE};
- my $upd = shift;
- $self->set_inflated_columns($upd) if $upd;
- my %changes = $self->get_dirty_columns;
- $self->discard_changes;
-
my $position_column = $self->position_column;
+ my @ordering_columns = ($self->_grouping_columns, $position_column);
+
+ # these steps are necessary to keep the external appearance of
+ # ->update($upd) so that other things overloading update() will
+ # work properly
+ my %original_values = $self->get_inflated_columns;
+ my %existing_changes = $self->get_dirty_columns;
+
+ # See if any of the *supplied* changes would affect the ordering
+ # The reason this is so contrived, is that we want to leverage
+ # the datatype aware value comparing, while at the same time
+ # keep the original value intact (it will be updated later by the
+ # corresponding routine)
+
+ my %upd = %{shift || {}};
+ my %changes = %existing_changes;
+
+ for (@ordering_columns) {
+ next unless exists $upd{$_};
+
+ # we do not want to keep propagating this to next::method
+ # as it will be a done deal by the time get there
+ my $value = delete $upd{$_};
+ $self->set_inflated_columns ({ $_ => $value });
+
+ # see if an update resulted in a dirty column
+ # it is important to preserve the old value, as it
+ # will be needed to carry on a successfull move()
+ # operation without re-querying the database
+ if ($self->is_column_changed ($_) && not exists $existing_changes{$_}) {
+ $changes{$_} = $value;
+ $self->set_inflated_columns ({ $_ => $original_values{$_} });
+ delete $self->{_dirty_columns}{$_};
+ }
+ }
+
# if nothing group/position related changed - short circuit
- if (not grep { exists $changes{$_} } ($self->_grouping_columns, $position_column) ) {
- return $self->next::method( \%changes, @_ );
+ if (not grep { exists $changes{$_} } ( @ordering_columns ) ) {
+ return $self->next::method( \%upd, @_ );
}
{
@@ -529,37 +608,37 @@
# create new_group by taking the current group and inserting changes
my $new_group = {$self->_grouping_clause};
foreach my $col (keys %$new_group) {
- if (exists $changes{$col}) {
- $new_group->{$col} = delete $changes{$col}; # don't want to pass this on to next::method
- }
+ $new_group->{$col} = $changes{$col} if exists $changes{$col};
}
$self->move_to_group(
$new_group,
(exists $changes{$position_column}
- # The FIXME bit contradicts the documentation: when changing groups without supplying explicit
- # positions in move_to_group(), we push the item to the end of the group.
- # However when I was rewriting this, the position from the old group was clearly passed to the new one
+ # The FIXME bit contradicts the documentation: POD states that
+ # when changing groups without supplying explicit positions in
+ # move_to_group(), we push the item to the end of the group.
+ # However when I was rewriting this, the position from the old
+ # group was clearly passed to the new one
# Probably needs to go away (by ribasushi)
- ? delete $changes{$position_column} # means there was a position change supplied with the update too
- : $self->_position # FIXME!
+ ? $changes{$position_column} # means there was a position change supplied with the update too
+ : $self->_position # FIXME! (replace with undef)
),
);
}
elsif (exists $changes{$position_column}) {
- $self->move_to(delete $changes{$position_column});
+ $self->move_to($changes{$position_column});
}
my @res;
my $want = wantarray();
if (not defined $want) {
- $self->next::method( \%changes, @_ );
+ $self->next::method( \%upd, @_ );
}
elsif ($want) {
- @res = $self->next::method( \%changes, @_ );
+ @res = $self->next::method( \%upd, @_ );
}
else {
- $res[0] = $self->next::method( \%changes, @_ );
+ $res[0] = $self->next::method( \%upd, @_ );
}
$guard->commit;
@@ -790,8 +869,8 @@
=head2 _grouping_clause
This method returns one or more name=>value pairs for limiting a search
-by the grouping column(s). If the grouping column is not
-defined then this will return an empty list.
+by the grouping column(s). If the grouping column is not defined then
+this will return an empty list.
=cut
sub _grouping_clause {
Modified: DBIx-Class/0.08/branches/_abandoned_but_possibly_useful/table_name_ref/lib/DBIx/Class/PK.pm
===================================================================
--- DBIx-Class/0.08/branches/_abandoned_but_possibly_useful/table_name_ref/lib/DBIx/Class/PK.pm 2009-08-08 15:50:11 UTC (rev 7263)
+++ DBIx-Class/0.08/branches/_abandoned_but_possibly_useful/table_name_ref/lib/DBIx/Class/PK.pm 2009-08-08 15:51:23 UTC (rev 7264)
@@ -20,45 +20,6 @@
=cut
-sub _ident_values {
- my ($self) = @_;
- return (map { $self->{_column_data}{$_} } $self->primary_columns);
-}
-
-=head2 discard_changes ($attrs)
-
-Re-selects the row from the database, losing any changes that had
-been made.
-
-This method can also be used to refresh from storage, retrieving any
-changes made since the row was last read from storage.
-
-$attrs is expected to be a hashref of attributes suitable for passing as the
-second argument to $resultset->search($cond, $attrs);
-
-=cut
-
-sub discard_changes {
- my ($self, $attrs) = @_;
- delete $self->{_dirty_columns};
- return unless $self->in_storage; # Don't reload if we aren't real!
-
- if( my $current_storage = $self->get_from_storage($attrs)) {
-
- # Set $self to the current.
- %$self = %$current_storage;
-
- # Avoid a possible infinite loop with
- # sub DESTROY { $_[0]->discard_changes }
- bless $current_storage, 'Do::Not::Exist';
-
- return $self;
- } else {
- $self->in_storage(0);
- return $self;
- }
-}
-
=head2 id
Returns the primary key(s) for a row. Can't be called as
@@ -74,12 +35,28 @@
return (wantarray ? @pk : $pk[0]);
}
+sub _ident_values {
+ my ($self) = @_;
+ return (map { $self->{_column_data}{$_} } $self->primary_columns);
+}
+
=head2 ID
Returns a unique id string identifying a row object by primary key.
Used by L<DBIx::Class::CDBICompat::LiveObjectIndex> and
L<DBIx::Class::ObjectCache>.
+=over
+
+=item WARNING
+
+The default C<_create_ID> method used by this function orders the returned
+values by the alphabetical order of the primary column names, B<unlike>
+the L</id> method, which follows the same order in which columns were fed
+to L<DBIx::Class::ResultSource/set_primary_key>.
+
+=back
+
=cut
sub ID {
Modified: DBIx-Class/0.08/branches/_abandoned_but_possibly_useful/table_name_ref/lib/DBIx/Class/Row.pm
===================================================================
--- DBIx-Class/0.08/branches/_abandoned_but_possibly_useful/table_name_ref/lib/DBIx/Class/Row.pm 2009-08-08 15:50:11 UTC (rev 7263)
+++ DBIx-Class/0.08/branches/_abandoned_but_possibly_useful/table_name_ref/lib/DBIx/Class/Row.pm 2009-08-08 15:51:23 UTC (rev 7264)
@@ -1277,12 +1277,51 @@
my $resultset = $self->result_source->resultset;
if(defined $attrs) {
- $resultset = $resultset->search(undef, $attrs);
+ $resultset = $resultset->search(undef, $attrs);
}
return $resultset->find($self->{_orig_ident} || $self->ident_condition);
}
+=head2 discard_changes ($attrs)
+
+Re-selects the row from the database, losing any changes that had
+been made.
+
+This method can also be used to refresh from storage, retrieving any
+changes made since the row was last read from storage.
+
+$attrs is expected to be a hashref of attributes suitable for passing as the
+second argument to $resultset->search($cond, $attrs);
+
+=cut
+
+sub discard_changes {
+ my ($self, $attrs) = @_;
+ delete $self->{_dirty_columns};
+ return unless $self->in_storage; # Don't reload if we aren't real!
+
+ # add a replication default to read from the master only
+ $attrs = { force_pool => 'master', %{$attrs||{}} };
+
+ if( my $current_storage = $self->get_from_storage($attrs)) {
+
+ # Set $self to the current.
+ %$self = %$current_storage;
+
+ # Avoid a possible infinite loop with
+ # sub DESTROY { $_[0]->discard_changes }
+ bless $current_storage, 'Do::Not::Exist';
+
+ return $self;
+ }
+ else {
+ $self->in_storage(0);
+ return $self;
+ }
+}
+
+
=head2 throw_exception
See L<DBIx::Class::Schema/throw_exception>.
Modified: DBIx-Class/0.08/branches/_abandoned_but_possibly_useful/table_name_ref/lib/DBIx/Class/Schema.pm
===================================================================
--- DBIx-Class/0.08/branches/_abandoned_but_possibly_useful/table_name_ref/lib/DBIx/Class/Schema.pm 2009-08-08 15:50:11 UTC (rev 7263)
+++ DBIx-Class/0.08/branches/_abandoned_but_possibly_useful/table_name_ref/lib/DBIx/Class/Schema.pm 2009-08-08 15:51:23 UTC (rev 7264)
@@ -42,7 +42,7 @@
$dsn,
$user,
$password,
- { AutoCommit => 0 },
+ { AutoCommit => 1 },
);
my $schema2 = Library::Schema->connect($coderef_returning_dbh);
Modified: DBIx-Class/0.08/branches/_abandoned_but_possibly_useful/table_name_ref/lib/DBIx/Class/Storage/DBI/MSSQL.pm
===================================================================
--- DBIx-Class/0.08/branches/_abandoned_but_possibly_useful/table_name_ref/lib/DBIx/Class/Storage/DBI/MSSQL.pm 2009-08-08 15:50:11 UTC (rev 7263)
+++ DBIx-Class/0.08/branches/_abandoned_but_possibly_useful/table_name_ref/lib/DBIx/Class/Storage/DBI/MSSQL.pm 2009-08-08 15:51:23 UTC (rev 7264)
@@ -30,14 +30,14 @@
if ($identity_insert) {
my $table = $source->from;
- $self->dbh->do("SET IDENTITY_INSERT $table ON");
+ $self->last_dbh->do("SET IDENTITY_INSERT $table ON");
}
$self->next::method(@_);
if ($identity_insert) {
my $table = $source->from;
- $self->dbh->do("SET IDENTITY_INSERT $table OFF");
+ $self->last_dbh->do("SET IDENTITY_INSERT $table OFF");
}
}
@@ -68,7 +68,7 @@
grep { not exists $to_insert->{$_} } (@pk_guids, @auto_guids);
for my $guid_col (@get_guids_for) {
- my ($new_guid) = $self->dbh->selectrow_array('SELECT NEWID()');
+ my ($new_guid) = $self->last_dbh->selectrow_array('SELECT NEWID()');
$updated_cols->{$guid_col} = $to_insert->{$guid_col} = $new_guid;
}
@@ -145,7 +145,7 @@
sub _svp_begin {
my ($self, $name) = @_;
- $self->dbh->do("SAVE TRANSACTION $name");
+ $self->last_dbh->do("SAVE TRANSACTION $name");
}
# A new SAVE TRANSACTION with the same name releases the previous one.
@@ -154,7 +154,7 @@
sub _svp_rollback {
my ($self, $name) = @_;
- $self->dbh->do("ROLLBACK TRANSACTION $name");
+ $self->last_dbh->do("ROLLBACK TRANSACTION $name");
}
sub build_datetime_parser {
Modified: DBIx-Class/0.08/branches/_abandoned_but_possibly_useful/table_name_ref/lib/DBIx/Class/Storage/DBI/ODBC.pm
===================================================================
--- DBIx-Class/0.08/branches/_abandoned_but_possibly_useful/table_name_ref/lib/DBIx/Class/Storage/DBI/ODBC.pm 2009-08-08 15:50:11 UTC (rev 7263)
+++ DBIx-Class/0.08/branches/_abandoned_but_possibly_useful/table_name_ref/lib/DBIx/Class/Storage/DBI/ODBC.pm 2009-08-08 15:51:23 UTC (rev 7264)
@@ -8,7 +8,8 @@
sub _rebless {
my ($self) = @_;
- my $dbtype = eval { $self->dbh->get_info(17) };
+ my $dbtype = eval { $self->last_dbh->get_info(17) };
+
unless ( $@ ) {
# Translate the backend name into a perl identifier
$dbtype =~ s/\W/_/gi;
Modified: DBIx-Class/0.08/branches/_abandoned_but_possibly_useful/table_name_ref/lib/DBIx/Class/Storage/DBI/Oracle/Generic.pm
===================================================================
--- DBIx-Class/0.08/branches/_abandoned_but_possibly_useful/table_name_ref/lib/DBIx/Class/Storage/DBI/Oracle/Generic.pm 2009-08-08 15:50:11 UTC (rev 7263)
+++ DBIx-Class/0.08/branches/_abandoned_but_possibly_useful/table_name_ref/lib/DBIx/Class/Storage/DBI/Oracle/Generic.pm 2009-08-08 15:51:23 UTC (rev 7264)
@@ -76,7 +76,7 @@
sub _sequence_fetch {
my ( $self, $type, $seq ) = @_;
- my ($id) = $self->dbh->selectrow_array("SELECT ${seq}.${type} FROM DUAL");
+ my ($id) = $self->last_dbh->selectrow_array("SELECT ${seq}.${type} FROM DUAL");
return $id;
}
@@ -209,7 +209,7 @@
sub _svp_begin {
my ($self, $name) = @_;
- $self->dbh->do("SAVEPOINT $name");
+ $self->last_dbh->do("SAVEPOINT $name");
}
=head2 source_bind_attributes
@@ -263,7 +263,7 @@
sub _svp_rollback {
my ($self, $name) = @_;
- $self->dbh->do("ROLLBACK TO SAVEPOINT $name")
+ $self->last_dbh->do("ROLLBACK TO SAVEPOINT $name")
}
=head1 AUTHOR
Modified: DBIx-Class/0.08/branches/_abandoned_but_possibly_useful/table_name_ref/lib/DBIx/Class/Storage/DBI/Oracle.pm
===================================================================
--- DBIx-Class/0.08/branches/_abandoned_but_possibly_useful/table_name_ref/lib/DBIx/Class/Storage/DBI/Oracle.pm 2009-08-08 15:50:11 UTC (rev 7263)
+++ DBIx-Class/0.08/branches/_abandoned_but_possibly_useful/table_name_ref/lib/DBIx/Class/Storage/DBI/Oracle.pm 2009-08-08 15:51:23 UTC (rev 7264)
@@ -9,7 +9,7 @@
sub _rebless {
my ($self) = @_;
- my $version = eval { $self->dbh->get_info(18); };
+ my $version = eval { $self->last_dbh->get_info(18); };
if ( !$@ ) {
my ($major, $minor, $patchlevel) = split(/\./, $version);
Modified: DBIx-Class/0.08/branches/_abandoned_but_possibly_useful/table_name_ref/lib/DBIx/Class/Storage/DBI/Pg.pm
===================================================================
--- DBIx-Class/0.08/branches/_abandoned_but_possibly_useful/table_name_ref/lib/DBIx/Class/Storage/DBI/Pg.pm 2009-08-08 15:50:11 UTC (rev 7263)
+++ DBIx-Class/0.08/branches/_abandoned_but_possibly_useful/table_name_ref/lib/DBIx/Class/Storage/DBI/Pg.pm 2009-08-08 15:51:23 UTC (rev 7264)
@@ -15,7 +15,7 @@
sub with_deferred_fk_checks {
my ($self, $sub) = @_;
- $self->dbh->do('SET CONSTRAINTS ALL DEFERRED');
+ $self->last_dbh->do('SET CONSTRAINTS ALL DEFERRED');
$sub->();
}
@@ -90,26 +90,26 @@
sub _sequence_fetch {
my ( $self, $type, $seq ) = @_;
- my ($id) = $self->dbh->selectrow_array("SELECT nextval('${seq}')");
+ my ($id) = $self->last_dbh->selectrow_array("SELECT nextval('${seq}')");
return $id;
}
sub _svp_begin {
my ($self, $name) = @_;
- $self->dbh->pg_savepoint($name);
+ $self->last_dbh->pg_savepoint($name);
}
sub _svp_release {
my ($self, $name) = @_;
- $self->dbh->pg_release($name);
+ $self->last_dbh->pg_release($name);
}
sub _svp_rollback {
my ($self, $name) = @_;
- $self->dbh->pg_rollback_to($name);
+ $self->last_dbh->pg_rollback_to($name);
}
1;
Modified: DBIx-Class/0.08/branches/_abandoned_but_possibly_useful/table_name_ref/lib/DBIx/Class/Storage/DBI/Sybase/Base.pm
===================================================================
--- DBIx-Class/0.08/branches/_abandoned_but_possibly_useful/table_name_ref/lib/DBIx/Class/Storage/DBI/Sybase/Base.pm 2009-08-08 15:50:11 UTC (rev 7263)
+++ DBIx-Class/0.08/branches/_abandoned_but_possibly_useful/table_name_ref/lib/DBIx/Class/Storage/DBI/Sybase/Base.pm 2009-08-08 15:51:23 UTC (rev 7264)
@@ -29,7 +29,7 @@
sub _placeholders_supported {
my $self = shift;
- my $dbh = $self->_dbh;
+ my $dbh = $self->last_dbh;
return eval {
# There's also $dbh->{syb_dynamic_supported} but it can be inaccurate for this
Modified: DBIx-Class/0.08/branches/_abandoned_but_possibly_useful/table_name_ref/lib/DBIx/Class/Storage/DBI/Sybase/Microsoft_SQL_Server.pm
===================================================================
--- DBIx-Class/0.08/branches/_abandoned_but_possibly_useful/table_name_ref/lib/DBIx/Class/Storage/DBI/Sybase/Microsoft_SQL_Server.pm 2009-08-08 15:50:11 UTC (rev 7263)
+++ DBIx-Class/0.08/branches/_abandoned_but_possibly_useful/table_name_ref/lib/DBIx/Class/Storage/DBI/Sybase/Microsoft_SQL_Server.pm 2009-08-08 15:51:23 UTC (rev 7264)
@@ -11,7 +11,7 @@
sub _rebless {
my $self = shift;
- my $dbh = $self->_dbh;
+ my $dbh = $self->last_dbh;
if (not $self->_placeholders_supported) {
bless $self,
Modified: DBIx-Class/0.08/branches/_abandoned_but_possibly_useful/table_name_ref/lib/DBIx/Class/Storage/DBI/Sybase.pm
===================================================================
--- DBIx-Class/0.08/branches/_abandoned_but_possibly_useful/table_name_ref/lib/DBIx/Class/Storage/DBI/Sybase.pm 2009-08-08 15:50:11 UTC (rev 7263)
+++ DBIx-Class/0.08/branches/_abandoned_but_possibly_useful/table_name_ref/lib/DBIx/Class/Storage/DBI/Sybase.pm 2009-08-08 15:51:23 UTC (rev 7264)
@@ -12,7 +12,11 @@
sub _rebless {
my $self = shift;
- my $dbtype = eval { @{$self->dbh->selectrow_arrayref(qq{sp_server_info \@attribute_id=1})}[2] };
+ my $dbtype = eval {
+ @{$self->last_dbh
+ ->selectrow_arrayref(qq{sp_server_info \@attribute_id=1})
+ }[2]
+ };
unless ( $@ ) {
$dbtype =~ s/\W/_/gi;
my $subclass = "DBIx::Class::Storage::DBI::Sybase::${dbtype}";
Modified: DBIx-Class/0.08/branches/_abandoned_but_possibly_useful/table_name_ref/lib/DBIx/Class/Storage/DBI/mysql.pm
===================================================================
--- DBIx-Class/0.08/branches/_abandoned_but_possibly_useful/table_name_ref/lib/DBIx/Class/Storage/DBI/mysql.pm 2009-08-08 15:50:11 UTC (rev 7263)
+++ DBIx-Class/0.08/branches/_abandoned_but_possibly_useful/table_name_ref/lib/DBIx/Class/Storage/DBI/mysql.pm 2009-08-08 15:51:23 UTC (rev 7264)
@@ -40,28 +40,28 @@
sub _svp_begin {
my ($self, $name) = @_;
- $self->dbh->do("SAVEPOINT $name");
+ $self->last_dbh->do("SAVEPOINT $name");
}
sub _svp_release {
my ($self, $name) = @_;
- $self->dbh->do("RELEASE SAVEPOINT $name");
+ $self->last_dbh->do("RELEASE SAVEPOINT $name");
}
sub _svp_rollback {
my ($self, $name) = @_;
- $self->dbh->do("ROLLBACK TO SAVEPOINT $name")
+ $self->last_dbh->do("ROLLBACK TO SAVEPOINT $name")
}
sub is_replicating {
- my $status = shift->dbh->selectrow_hashref('show slave status');
+ my $status = shift->last_dbh->selectrow_hashref('show slave status');
return ($status->{Slave_IO_Running} eq 'Yes') && ($status->{Slave_SQL_Running} eq 'Yes');
}
sub lag_behind_master {
- return shift->dbh->selectrow_hashref('show slave status')->{Seconds_Behind_Master};
+ return shift->last_dbh->selectrow_hashref('show slave status')->{Seconds_Behind_Master};
}
# MySql can not do subquery update/deletes, only way is slow per-row operations.
@@ -81,7 +81,7 @@
Storage::DBI autodetects the underlying MySQL database, and re-blesses the
C<$storage> object into this class.
- my $schema = MyDb::Schema->connect( $dsn, $user, $pass, { set_strict_mode => 1 } );
+ my $schema = MyDb::Schema->connect( $dsn, $user, $pass, { on_connect_call => 'set_strict_mode' } );
=head1 DESCRIPTION
Modified: DBIx-Class/0.08/branches/_abandoned_but_possibly_useful/table_name_ref/lib/DBIx/Class/Storage/DBI.pm
===================================================================
--- DBIx-Class/0.08/branches/_abandoned_but_possibly_useful/table_name_ref/lib/DBIx/Class/Storage/DBI.pm 2009-08-08 15:50:11 UTC (rev 7263)
+++ DBIx-Class/0.08/branches/_abandoned_but_possibly_useful/table_name_ref/lib/DBIx/Class/Storage/DBI.pm 2009-08-08 15:51:23 UTC (rev 7264)
@@ -437,12 +437,24 @@
}
}
- %attrs = () if (ref $args[0] eq 'CODE'); # _connect() never looks past $args[0] in this case
+ if (ref $args[0] eq 'CODE') {
+ # _connect() never looks past $args[0] in this case
+ %attrs = ()
+ } else {
+ %attrs = (
+ %{ $self->_default_dbi_connect_attributes || {} },
+ %attrs,
+ );
+ }
$self->_dbi_connect_info([@args, keys %attrs ? \%attrs : ()]);
$self->_connect_info;
}
+sub _default_dbi_connect_attributes {
+ return { AutoCommit => 1 };
+}
+
=head2 on_connect_do
This method is deprecated in favour of setting via L</connect_info>.
@@ -589,7 +601,7 @@
my $exception = $@;
if(!$exception) { return $want_array ? @result : $result[0] }
- if($tried++ > 0 || $self->connected) {
+ if($tried++ || $self->connected) {
eval { $self->txn_rollback };
my $rollback_exception = $@;
if($rollback_exception) {
@@ -621,7 +633,7 @@
sub disconnect {
my ($self) = @_;
- if( $self->connected ) {
+ if( $self->_dbh ) {
my @actions;
push @actions, ( $self->on_disconnect_call || () );
@@ -658,6 +670,22 @@
$sub->();
}
+=head2 connected
+
+=over
+
+=item Arguments: none
+
+=item Return Value: 1|0
+
+=back
+
+Verifies that the the current database handle is active and ready to execute
+an SQL statement (i.e. the connection did not get stale, server is still
+answering, etc.) This method is used internally by L</dbh>.
+
+=cut
+
sub connected {
my ($self) = @_;
@@ -709,21 +737,48 @@
=head2 dbh
-Returns the dbh - a data base handle of class L<DBI>.
+Returns a C<$dbh> - a data base handle of class L<DBI>. The returned handle
+is guaranteed to be healthy by implicitly calling L</connected>, and if
+necessary performing a reconnection before returning.
=cut
sub dbh {
my ($self) = @_;
- $self->ensure_connected;
+ if (not $self->_dbh) {
+ $self->_populate_dbh;
+ } else {
+ $self->ensure_connected;
+ }
return $self->_dbh;
}
+=head2 last_dbh
+
+This returns the B<last> available C<$dbh> if any, or attempts to
+connect and returns the resulting handle. This method differs from
+L</dbh> by not validating if a preexisting handle is still healthy
+via L</connected>. Make sure you take appropriate precautions
+when using this method, as the C<$dbh> may be useless at this point.
+
+=cut
+
+sub last_dbh {
+ my $self = shift;
+ $self->_populate_dbh unless $self->_dbh;
+ return $self->_dbh;
+}
+
sub _sql_maker_args {
my ($self) = @_;
- return ( bindtype=>'columns', array_datatypes => 1, limit_dialect => $self->dbh, %{$self->_sql_maker_opts} );
+ return (
+ bindtype=>'columns',
+ array_datatypes => 1,
+ limit_dialect => $self->last_dbh,
+ %{$self->_sql_maker_opts}
+ );
}
sub sql_maker {
@@ -740,6 +795,7 @@
sub _populate_dbh {
my ($self) = @_;
+
my @info = @{$self->_dbi_connect_info || []};
$self->_dbh($self->_connect(@info));
@@ -752,6 +808,11 @@
# there is no transaction in progress by definition
$self->{transaction_depth} = $self->_dbh_autocommit ? 0 : 1;
+ $self->_run_connection_actions unless $self->{_in_determine_driver};
+}
+
+sub _run_connection_actions {
+ my $self = shift;
my @actions;
push @actions, ( $self->on_connect_call || () );
@@ -764,15 +825,18 @@
my ($self) = @_;
if (not $self->_driver_determined) {
+ my $started_unconnected = 0;
+ local $self->{_in_determine_driver} = 1;
+
if (ref($self) eq __PACKAGE__) {
my $driver;
-
if ($self->_dbh) { # we are connected
$driver = $self->_dbh->{Driver}{Name};
} else {
# try to use dsn to not require being connected, the driver may still
# force a connection in _rebless to determine version
($driver) = $self->_dbi_connect_info->[0] =~ /dbi:([^:]+):/i;
+ $started_unconnected = 1;
}
my $storage_class = "DBIx::Class::Storage::DBI::${driver}";
@@ -784,6 +848,9 @@
}
$self->_driver_determined(1);
+
+ $self->_run_connection_actions
+ if $started_unconnected && defined $self->_dbh;
}
}
@@ -983,14 +1050,17 @@
sub txn_begin {
my $self = shift;
- $self->ensure_connected();
if($self->{transaction_depth} == 0) {
$self->debugobj->txn_begin()
if $self->debug;
- # this isn't ->_dbh-> because
- # we should reconnect on begin_work
- # for AutoCommit users
- $self->dbh->begin_work;
+
+ # being here implies we have AutoCommit => 1
+ # if the user is utilizing txn_do - good for
+ # him, otherwise we need to ensure that the
+ # $dbh is healthy on BEGIN
+ my $dbh_method = $self->{_in_dbh_do} ? '_dbh' : 'dbh';
+ $self->$dbh_method->begin_work;
+
} elsif ($self->auto_savepoint) {
$self->svp_begin;
}
@@ -1162,7 +1232,11 @@
my $col_info = $source->column_info($col);
if ( $col_info->{auto_nextval} ) {
- $updated_cols->{$col} = $to_insert->{$col} = $self->_sequence_fetch( 'nextval', $col_info->{sequence} || $self->_dbh_get_autoinc_seq($self->dbh, $source) );
+ $updated_cols->{$col} = $to_insert->{$col} = $self->_sequence_fetch(
+ 'nextval',
+ $col_info->{sequence} ||
+ $self->_dbh_get_autoinc_seq($self->last_dbh, $source)
+ );
}
}
}
@@ -1183,6 +1257,8 @@
@colvalues{@$cols} = (0..$#$cols);
my ($sql, @bind) = $self->sql_maker->insert($table, \%colvalues);
+ $self->_determine_driver;
+
$self->_query_start( $sql, @bind );
my $sth = $self->sth($sql);
@@ -1242,6 +1318,7 @@
sub update {
my $self = shift @_;
my $source = shift @_;
+ $self->_determine_driver;
my $bind_attributes = $self->source_bind_attributes($source);
return $self->_execute('update' => [], $source, $bind_attributes, @_);
@@ -1251,7 +1328,7 @@
sub delete {
my $self = shift @_;
my $source = shift @_;
-
+ $self->_determine_driver;
my $bind_attrs = $self->source_bind_attributes($source);
return $self->_execute('delete' => [], $source, $bind_attrs, @_);
@@ -1948,7 +2025,7 @@
=cut
-sub sqlt_type { shift->dbh->{Driver}->{Name} }
+sub sqlt_type { shift->last_dbh->{Driver}->{Name} }
=head2 bind_attribute_by_data_type
@@ -2195,7 +2272,7 @@
sub deployment_statements {
my ($self, $schema, $type, $version, $dir, $sqltargs) = @_;
# Need to be connected to get the correct sqlt_type
- $self->ensure_connected() unless $type;
+ $self->last_dbh() unless $type;
$type ||= $self->sqlt_type;
$version ||= $schema->schema_version || '1.x';
$dir ||= './';
@@ -2240,7 +2317,10 @@
return if $line =~ /^\s+$/; # skip whitespace only
$self->_query_start($line);
eval {
- $self->dbh->do($line); # shouldn't be using ->dbh ?
+ # a previous error may invalidate $dbh - thus we need to use dbh()
+ # to guarantee a healthy $dbh (this is temporary until we get
+ # proper error handling on deploy() )
+ $self->dbh->do($line);
};
if ($@) {
carp qq{$@ (running "${line}")};
@@ -2269,7 +2349,7 @@
sub datetime_parser {
my $self = shift;
return $self->{datetime_parser} ||= do {
- $self->ensure_connected;
+ $self->last_dbh;
$self->build_datetime_parser(@_);
};
}
@@ -2353,7 +2433,7 @@
DBIx::Class can do some wonderful magic with handling exceptions,
disconnections, and transactions when you use C<< AutoCommit => 1 >>
-combined with C<txn_do> for transaction support.
+(the default) combined with C<txn_do> for transaction support.
If you set C<< AutoCommit => 0 >> in your connect info, then you are always
in an assumed transaction between commits, and you're telling us you'd
@@ -2365,7 +2445,6 @@
be with raw DBI.
-
=head1 AUTHORS
Matt S. Trout <mst at shadowcatsystems.co.uk>
Modified: DBIx-Class/0.08/branches/_abandoned_but_possibly_useful/table_name_ref/t/87ordered.t
===================================================================
--- DBIx-Class/0.08/branches/_abandoned_but_possibly_useful/table_name_ref/t/87ordered.t 2009-08-08 15:50:11 UTC (rev 7263)
+++ DBIx-Class/0.08/branches/_abandoned_but_possibly_useful/table_name_ref/t/87ordered.t 2009-08-08 15:51:23 UTC (rev 7264)
@@ -10,8 +10,6 @@
my $schema = DBICTest->init_schema();
-plan tests => 1269;
-
my $employees = $schema->resultset('Employee');
$employees->delete();
@@ -42,11 +40,9 @@
my $group_3 = $employees->search({group_id=>3});
my $to_group = 1;
my $to_pos = undef;
-# now that we have transactions we need to work around stupid sqlite
{
my @empl = $group_3->all;
while (my $employee = shift @empl) {
- $employee->discard_changes; # since we are effective shift()ing the $rs while doing this
$employee->move_to_group($to_group, $to_pos);
$to_pos++;
$to_group = $to_group==1 ? 2 : 1;
@@ -54,7 +50,6 @@
}
foreach my $group_id (1..4) {
my $group_employees = $employees->search({group_id=>$group_id});
- $group_employees->all();
ok( check_rs($group_employees), "group positions after move_to_group" );
}
@@ -129,7 +124,6 @@
my $to_group_2 = 1;
$to_pos = undef;
-# now that we have transactions we need to work around stupid sqlite
{
my @empl = $group_3->all;
while (my $employee = shift @empl) {
@@ -143,7 +137,6 @@
foreach my $group_id_2 (1..4) {
foreach my $group_id_3 (1..4) {
my $group_employees = $employees->search({group_id_2=>$group_id_2,group_id_3=>$group_id_3});
- $group_employees->all();
ok( check_rs($group_employees), "group positions after move_to_group" );
}
}
@@ -275,3 +268,4 @@
return 1;
}
+done_testing;
Added: DBIx-Class/0.08/branches/_abandoned_but_possibly_useful/table_name_ref/t/92storage_ping_count.t
===================================================================
--- DBIx-Class/0.08/branches/_abandoned_but_possibly_useful/table_name_ref/t/92storage_ping_count.t (rev 0)
+++ DBIx-Class/0.08/branches/_abandoned_but_possibly_useful/table_name_ref/t/92storage_ping_count.t 2009-08-08 15:51:23 UTC (rev 7264)
@@ -0,0 +1,63 @@
+use strict;
+use warnings;
+
+use Test::More;
+use lib qw(t/lib);
+use DBICTest;
+use Data::Dumper;
+use DBIC::SqlMakerTest;
+
+my $ping_count = 0;
+
+{
+ local $SIG{__WARN__} = sub {};
+ require DBIx::Class::Storage::DBI;
+
+ my $ping = \&DBIx::Class::Storage::DBI::_ping;
+
+ *DBIx::Class::Storage::DBI::_ping = sub {
+ $ping_count++;
+ goto &$ping;
+ };
+}
+
+
+# We do not count pings during deploy() because of the flux
+# around sqlt. Eventually there should be no pings at all
+my $schema = DBICTest->init_schema( sqlite_use_file => 1, no_populate => 1 );
+
+TODO: {
+ local $TODO = 'Unable to fix before proper deploy() error handling';
+ is ($ping_count, 0, 'no _ping() calls during deploy');
+ $ping_count = 0;
+}
+
+DBICTest->populate_schema ($schema);
+
+# perform some operations and make sure they don't ping
+
+$schema->resultset('CD')->create({
+ cdid => 6, artist => 3, title => 'mtfnpy', year => 2009
+});
+
+$schema->resultset('CD')->create({
+ cdid => 7, artist => 3, title => 'mtfnpy2', year => 2009
+});
+
+$schema->storage->_dbh->disconnect;
+
+$schema->resultset('CD')->create({
+ cdid => 8, artist => 3, title => 'mtfnpy3', year => 2009
+});
+
+$schema->storage->_dbh->disconnect;
+
+$schema->txn_do(sub {
+ $schema->resultset('CD')->create({
+ cdid => 9, artist => 3, title => 'mtfnpy4', year => 2009
+ });
+});
+
+is $ping_count, 0, 'no _ping() calls';
+
+done_testing;
Modified: DBIx-Class/0.08/branches/_abandoned_but_possibly_useful/table_name_ref/t/93storage_replication.t
===================================================================
--- DBIx-Class/0.08/branches/_abandoned_but_possibly_useful/table_name_ref/t/93storage_replication.t 2009-08-08 15:50:11 UTC (rev 7263)
+++ DBIx-Class/0.08/branches/_abandoned_but_possibly_useful/table_name_ref/t/93storage_replication.t 2009-08-08 15:51:23 UTC (rev 7264)
@@ -11,9 +11,7 @@
BEGIN {
eval "use DBIx::Class::Storage::DBI::Replicated; use Test::Moose";
- plan $@
- ? ( skip_all => "Deps not installed: $@" )
- : ( tests => 126 );
+ plan skip_all => "Deps not installed: $@" if $@;
}
use_ok 'DBIx::Class::Storage::DBI::Replicated::Pool';
@@ -766,6 +764,20 @@
is $debug{storage_type}, 'MASTER', "got last query from a master: $debug{dsn}";
+ ok $artist->discard_changes({force_pool=>'master'})
+ => 'properly called discard_changes against master (manual attrs)';
+
+ is $debug{storage_type}, 'MASTER', "got last query from a master: $debug{dsn}";
+
+ ok $artist->discard_changes()
+ => 'properly called discard_changes against master (default attrs)';
+
+ is $debug{storage_type}, 'MASTER', "got last query from a master: $debug{dsn}";
+
+ ok $artist->discard_changes({force_pool=>$replicant_names[0]})
+ => 'properly able to override the default attributes';
+
+ is $debug{storage_type}, 'REPLICANT', "got last query from a replicant: $debug{dsn}"
}
## Test some edge cases, like trying to do a transaction inside a transaction, etc
@@ -836,4 +848,6 @@
## Delete the old database files
$replicated->cleanup;
+done_testing;
+
# vim: sw=4 sts=4 :
More information about the Bast-commits
mailing list