From: Rafael Kitover Date: Wed, 5 Aug 2009 09:19:57 +0000 (+0000) Subject: Merge 'trunk' into 'reduce_pings' X-Git-Tag: v0.08109~30^2~8 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=84ccbc01107eeadbbac452d5368b4dd74f12ab8e;p=dbsrgits%2FDBIx-Class.git Merge 'trunk' into 'reduce_pings' r6389@hlagh (orig r7140): caelum | 2009-07-30 08:46:04 -0400 update sqlite test schema r6394@hlagh (orig r7145): robkinyon | 2009-07-30 10:13:21 -0400 Added prefetch caveats r6395@hlagh (orig r7146): robkinyon | 2009-07-30 10:20:02 -0400 Fixed caveats r6398@hlagh (orig r7149): caelum | 2009-07-30 11:56:01 -0400 make ::Oracle::Generic load without DBD::Oracle r6399@hlagh (orig r7150): caelum | 2009-07-30 12:04:47 -0400 make sure DBD::Oracle is loaded when using constants from it r6404@hlagh (orig r7154): castaway | 2009-07-30 16:17:33 -0400 Mangled Rob's example somewhat, still needs explaining whch circs exactly cause the borken results r6405@hlagh (orig r7158): mo | 2009-07-31 06:51:20 -0400 POD fix r6406@hlagh (orig r7159): mo | 2009-07-31 06:52:42 -0400 undo that attributes merge stuff r9037@hlagh (orig r7166): castaway | 2009-08-02 06:41:25 -0400 Mention ResultSet, ResultSource and Row in synopsis r9038@hlagh (orig r7167): castaway | 2009-08-02 08:10:53 -0400 Docs: Explainations of result sources and how to find them r9042@hlagh (orig r7172): ribasushi | 2009-08-03 05:01:44 -0400 Disable Pod::Inherit makefile calls, until we get to version 0.02 r9046@hlagh (orig r7176): ribasushi | 2009-08-03 05:51:42 -0400 r6983@Thesaurus (orig r6982): ribasushi | 2009-07-04 11:46:57 +0200 New branch to experiment with a sanifying mysql on_connect_call r6984@Thesaurus (orig r6983): ribasushi | 2009-07-04 11:49:44 +0200 Initial set_ansi_mode code - make sure to utilize _do_query instead of dbh->do, so the result is visible in the trace r6987@Thesaurus (orig r6986): ribasushi | 2009-07-04 12:40:47 +0200 Fix POD r7178@Thesaurus (orig r7175): ribasushi | 2009-08-03 11:51:15 +0200 Wrap up set_strict_mode for mysql r9048@hlagh (orig r7178): ribasushi | 2009-08-03 06:41:32 -0400 Sanify unqualified column bindtype handling Silence a warning when using a custom {from} r9068@hlagh (orig r7198): caelum | 2009-08-04 16:18:27 -0400 update Changes r9075@hlagh (orig r7205): ribasushi | 2009-08-05 02:34:25 -0400 Bump dependencies: Test::More for the new no_plan/done_testing goodies File::Temp as per RT#48431 r9077@hlagh (orig r7207): ribasushi | 2009-08-05 02:36:32 -0400 r7156@Thesaurus (orig r7153): robkinyon | 2009-07-30 20:06:04 +0200 Create prefetch_redux branch r7164@Thesaurus (orig r7161): robkinyon | 2009-07-31 22:41:01 +0200 Added MooseX::Traits to Makefile.PL r7172@Thesaurus (orig r7169): robkinyon | 2009-08-03 05:49:59 +0200 Added two tests and marked one todo_skip r7187@Thesaurus (orig r7184): ribasushi | 2009-08-03 17:24:41 +0200 Use goto to preserve correct error-at-line reporting r7189@Thesaurus (orig r7186): ribasushi | 2009-08-04 12:34:58 +0200 Add an extra test specifically for distinct/prefetch Remove duplicate test in count/prefetch Switch to as_query instead of debug overloading r7190@Thesaurus (orig r7187): ribasushi | 2009-08-04 12:35:57 +0200 Fix how a distinct-induced group_by is calculated, taking in consideration the new prefetch mechanism r7197@Thesaurus (orig r7194): ribasushi | 2009-08-04 17:31:33 +0200 Traits not needed by anything currently in dbic r7198@Thesaurus (orig r7195): ribasushi | 2009-08-04 17:41:14 +0200 Move around tests a bit r7199@Thesaurus (orig r7196): mo | 2009-08-04 21:10:57 +0200 prefetch-grouped fails, again r7204@Thesaurus (orig r7201): ribasushi | 2009-08-04 22:50:51 +0200 Split the search_related prefetch tests into a standalone testfile r7205@Thesaurus (orig r7202): ribasushi | 2009-08-04 23:05:03 +0200 Move norbi's test to prefetch_redux - it's the same idea r7209@Thesaurus (orig r7206): ribasushi | 2009-08-05 08:35:48 +0200 Tadaaaa (even more prefetch insanity) r9079@hlagh (orig r7209): ribasushi | 2009-08-05 02:38:41 -0400 r7107@Thesaurus (orig r7104): caelum | 2009-07-24 06:51:57 +0200 new branch to move common mssql functionality into the base class, and other tweaks r7109@Thesaurus (orig r7106): caelum | 2009-07-24 07:28:11 +0200 moved code to ::DBI::MSSQL and added DT inflation test r7112@Thesaurus (orig r7109): caelum | 2009-07-24 08:46:16 +0200 merge in some more MSSQL code, including odbc dynamic cursor support r7113@Thesaurus (orig r7110): caelum | 2009-07-24 08:49:54 +0200 fix a warning in SQLAHacks r7114@Thesaurus (orig r7111): caelum | 2009-07-24 09:22:33 +0200 add placeholder support detection for mssql through dbd::sybase r7118@Thesaurus (orig r7115): caelum | 2009-07-24 16:39:06 +0200 minor doc clarification r7122@Thesaurus (orig r7119): caelum | 2009-07-25 16:10:30 +0200 move placeholder support detection into ::Sybase::Base r7123@Thesaurus (orig r7120): caelum | 2009-07-25 16:12:01 +0200 add a comment r7127@Thesaurus (orig r7124): caelum | 2009-07-26 18:04:29 +0200 SAVEPOINT methods for MSSQL r7140@Thesaurus (orig r7137): caelum | 2009-07-30 10:12:45 +0200 better tests for "smalldatetime" support in MSSQL r7142@Thesaurus (orig r7139): caelum | 2009-07-30 13:29:19 +0200 MSSQL GUID support r7147@Thesaurus (orig r7144): caelum | 2009-07-30 15:38:33 +0200 update sqlite test schema r7150@Thesaurus (orig r7147): caelum | 2009-07-30 16:26:47 +0200 make sure the new mssql insert method works on an un-reblessed storage r7151@Thesaurus (orig r7148): caelum | 2009-07-30 16:55:35 +0200 better rebless check for insert r7154@Thesaurus (orig r7151): caelum | 2009-07-30 18:57:22 +0200 add missing file r7155@Thesaurus (orig r7152): caelum | 2009-07-30 19:00:40 +0200 fix syntax error r7163@Thesaurus (orig r7160): caelum | 2009-07-31 15:52:41 +0200 fix a bug in _determine_driver r7166@Thesaurus (orig r7163): caelum | 2009-08-01 18:10:23 +0200 default collist for storage _resolve_column_info r7182@Thesaurus (orig r7179): caelum | 2009-08-03 13:42:31 +0200 check that dynamic cursors are functional if enabled r7184@Thesaurus (orig r7181): ribasushi | 2009-08-03 14:23:37 +0200 Adjust expected sql to match the new 'Track' table definition r7186@Thesaurus (orig r7183): ribasushi | 2009-08-03 15:16:10 +0200 Simplify code and add some comments r7200@Thesaurus (orig r7197): caelum | 2009-08-04 21:31:16 +0200 update oracle tests for new "track" table r7203@Thesaurus (orig r7200): caelum | 2009-08-04 22:39:57 +0200 update Changes r9081@hlagh (orig r7211): ribasushi | 2009-08-05 02:40:39 -0400 r7213@Thesaurus (orig r7210): ribasushi | 2009-08-05 08:40:20 +0200 Really sanify _resolve_column_info r9083@hlagh (orig r7213): ribasushi | 2009-08-05 04:19:37 -0400 Reminder about discard_changes and friends r9084@hlagh (orig r7214): ribasushi | 2009-08-05 04:26:20 -0400 Reformat and fill-in changes r9085@hlagh (orig r7215): caelum | 2009-08-05 04:37:12 -0400 rename connect_call_use_mars to connect_call_use_MARS r9086@hlagh (orig r7216): ribasushi | 2009-08-05 04:38:14 -0400 Silence a TODO test r9087@hlagh (orig r7217): caelum | 2009-08-05 04:46:11 -0400 minor Changes update --- 84ccbc01107eeadbbac452d5368b4dd74f12ab8e diff --cc lib/DBIx/Class/Storage/DBI.pm index 040a388,32be00f..7a7bd60 --- a/lib/DBIx/Class/Storage/DBI.pm +++ b/lib/DBIx/Class/Storage/DBI.pm @@@ -796,29 -763,27 +796,33 @@@ sub _run_connection_actions sub _determine_driver { my ($self) = @_; - if (ref $self eq 'DBIx::Class::Storage::DBI') { - my $driver; + if (not $self->_driver_determined) { + if (ref($self) eq __PACKAGE__) { + my $driver; + my $started_unconnected = 0; + local $self->{_in_determine_driver} = 1; - 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; + 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; + } + + my $storage_class = "DBIx::Class::Storage::DBI::${driver}"; + if ($self->load_optional_class($storage_class)) { + mro::set_mro($storage_class, 'c3'); + bless $self, $storage_class; + $self->_rebless(); + } + $started_unconnected = 1; } - my $storage_class = "DBIx::Class::Storage::DBI::${driver}"; - if ($self->load_optional_class($storage_class)) { - mro::set_mro($storage_class, 'c3'); - bless $self, $storage_class; - $self->_rebless(); - } + $self->_driver_determined(1); + + $self->_run_connection_actions + if $started_unconnected && defined $self->_dbh; } }