Cleanup/improve the leaktest a bit
[dbsrgits/DBIx-Class.git] / lib / DBIx / Class / Storage / DBI / Replicated.pm
index 3162d81..9a9e05f 100644 (file)
@@ -1,9 +1,8 @@
 package DBIx::Class::Storage::DBI::Replicated;
 
 BEGIN {
-  use Carp::Clan qw/^DBIx::Class/;
   use DBIx::Class;
-  croak('The following modules are required for Replication ' . DBIx::Class::Optional::Dependencies->req_missing_for ('replicated') )
+  die('The following modules are required for Replication ' . DBIx::Class::Optional::Dependencies->req_missing_for ('replicated') . "\n" )
     unless DBIx::Class::Optional::Dependencies->req_ok_for ('replicated');
 }
 
@@ -269,7 +268,6 @@ my $method_dispatch = {
     txn_commit
     txn_rollback
     txn_scope_guard
-    sth
     deploy
     with_deferred_fk_checks
     dbh_do
@@ -282,26 +280,26 @@ my $method_dispatch = {
     svp_release
     relname_to_table_alias
     _dbh_last_insert_id
-    _fix_bind_params
     _default_dbi_connect_attributes
     _dbi_connect_info
     _dbic_connect_attributes
     auto_savepoint
+    _query_start
     _query_end
+    _format_for_trace
+    _dbi_attrs_for_bind
     bind_attribute_by_data_type
     transaction_depth
     _dbh
     _select_args
     _dbh_execute_array
     _sql_maker
-    _query_start
     _per_row_update_delete
     _dbh_begin_work
     _dbh_execute_inserts_with_no_binds
     _select_args_to_query
     _svp_generate_name
     _multipk_update_delete
-    source_bind_attributes
     _normalize_connect_info
     _parse_connect_do
     _dbh_commit
@@ -323,6 +321,7 @@ my $method_dispatch = {
     _resolve_aliastypes_from_select_args
     _execute
     _do_query
+    _sth
     _dbh_sth
     _dbh_execute
   /],
@@ -337,6 +336,8 @@ my $method_dispatch = {
     _arm_global_destructor
     _verify_pid
 
+    source_bind_attributes
+
     get_use_dbms_capability
     set_use_dbms_capability
     get_dbms_capability
@@ -358,6 +359,8 @@ my $method_dispatch = {
     _is_lob_type
     _is_binary_lob_type
     _is_text_lob_type
+
+    sth
   /,(
     # the capability framework
     # not sure if CMOP->initialize does evil things to DBIC::S::DBI, fix if a problem
@@ -395,7 +398,8 @@ if (DBIx::Class::_ENV_::DBICTEST) {
 
 for my $method (@{$method_dispatch->{unimplemented}}) {
   __PACKAGE__->meta->add_method($method, sub {
-    croak "$method must not be called on ".(blessed shift).' objects';
+    my $self = shift;
+    $self->throw_exception("$method must not be called on ".(blessed $self).' objects');
   });
 }