Remove use of Try::Tiny entirely (the missing part of ddcc02d1) While at the time it seemed expedient to keep relying on Try::Tiny::catch and only replace Try::Tiny::try internally, it turns out that the current naming behavior of T::T [1] means we can not get DBIC::Carp to report a friendly callsite, as finding which catch{} frames are skippable becomes problematic. Additionally this drops a flurry of runtime Sub::Name calls which in turn is likely to take less time ( note - this has not been explicitly timed, but seems to pop up often in profiles: https://youtu.be/PYCbumw0Fis?t=1919 ) In any case - one less dep that we do not really use is always a win Despite the large changeset there should be zero functional changes This essentially reverts the entirety of 9b58d129 Read under -w [1] https://metacpan.org/diff/file?source=DOY/Try-Tiny-0.14&target=DOY/Try-Tiny-0.15#lib/Try/Tiny.pm
Remove dead code from DBI::Replicated This was originally introduced in fecb38cba, without tests nor justification. Subsequently it got modified a bit in 7da56142c, and then got completely broken by bbdda2810 which designated _dbh_details() as an off-limits internal method. Given nothing has been heard since (6 years), and there is no effective change of behavior (the snippet below fails identically below and after this change) go ahead and burninate. Also adjust the "can't touch this" exception text a bit. DBICTEST_VIA_REPLICATED=1 perl -Ilib -It/lib -MDBICTest -e ' eval { DBICTest->init_schema->storage->$_ }, warn $@ for qw( _dbh_details _server_info _get_server_version _describe_connection ) '
Protect DBIC as best we can from the failure mode in 7cb35852 The main idea is that while exception_action works just like $SIG{__DIE__}, this is less than ideal as non-sufficiently-careful software can completely abort a callstack by goto()-ing out of it (not to mention the annoyance of users when receiving callbacks on exceptions that DBIC later handles). So this changeset makes exception_action() behave *better* than $SIG{__DIE__} by meticlously annotating every DBIC-internal recoverable-exception site and ensuring that exception_action (and any $SIG{__DIE__} callback) is not invoked in this case ( see the diff of t/61findnot.t specifically ) This is a rather heavy and involved set of changes, but there seems to be no other way to go around this. There were complaints already due to firing o handlers on recoverable errors, but this is the first time the integrity of the actul DBIC code flow was broken. Thus an executive decision was made to solve this for good (took about 2 full days of work, sigh...) The main part of this changset is in ::Schema.pm and ::_Util.pm, the rest is simply switching from try/eval => dbic_internal_try. Some codepaths can not be executed due to lack of RDBMS, but afaict it all works. The changes were audited by a combination of: watch -x grep -rnP --exclude='*.pod' '^(?!\s*\#).*?(\beval\b|\btry\b)' lib git diff HEAD^ \ | perl -0777 -e 'my $str = <>; while( $str =~ /(?:\A|^index)(.+?)(?:^diff|\z)/gsm) { my $substr = $1; warn $substr if ( $substr =~ /dbic_internal_try/ and $substr !~ /DBIx::Class::_Util/ ) }' 2>&1 \ | less And a BaseSchema.pm exception_action hook which registers failures on any invocation which is not paired with an eval/thows_ok/etc in a t/**.t frame. In other words we make sure when exception_action is invoked - a test is there waiting for the resulting exception, assuming any other exception is transient ( needs DBICTEST_ASSERT_NO_SPURIOUS_EXCEPTION_ACTION to be set ). Additionally there is a global CI-enabled Try::Tiny::try override which fails on calls from within the DBIx::Class namespace.
Another overhaul (hopefully one of the last ones) of the rollback handling This subsystem has seen several passes (most notably 90d7422fc), all of them utterly misguided and of rather terrible quality :( Lay groundwork for a saner system by consolidating the "rollback after exception, with potential rewrite" mechanism. There should be no notably changes in behavior (aside from several transaction texts), for that see next commit. Contains a rather hideous piece of code propagated over several years. Not tackling that yet, as too many things are in motion. Read under -w
Fix exception on complex update/delete under a replicated setup THIS COMMIT IS A HACK!!! The actual fix is migration of the logic to the SQLMaker subclass and deal with it there. However the entire class hierarchy is currently in flux, so go with the least invasive change until the storage rewrite settles. Testing for this will show up in the next commit
Clarify licensing, ensure footers are consistent throughout the project Note - this *DOES NOT CHANGE* the licensing of the project in any way, it is still dual-licensed like perl5, just as it was before this commit. All additions are for clarifying purposes only. The way licensing is presented is an amalgamation of information and prior art found at the following sources: - http://www.perlfoundation.org/cpan_licensing_guidelines - https://metacpan.org/source/ETHER/Moose-2.1212/LICENSE - `git log --color -w -p v5.20.0 ^perl-5.000^ -- Artistic`
A massive amount of link fixes (just links, almost no rewording) kryde++ for the insanely useful tool App::PodLinkCheck. It is a bit heavy and way too noisy for automated use, but with some handholding it is scarily effective (as can be seen by the sheer size of this commit)
Streamline connection codepath, fix $ENV{DBI_DSN} regression from d87929a4 Break out _dbi_connect_info to always take into account $ENV{DBI_DSN} on a case-by-case basis. This allows to centralize handling of "whose driver is this anyway" and let more exotic configs still function properly. As a side effect need to move the _dbi_connect_info() population earlier in the connect_info() codepath Also break out the DBI_DRIVER reader, and use it if possible in the _describe_connection codepath Additionaly refactor of _connect since there is no point passing the DSN when we can grab it from $self (this also fixed ::Replicated's _connect() loop never actually having worked)
Replace $row with $result in all docs to be consistent and to clarify various return values for example: $result->update() returns $result before the example was $row->update() returns $result which doesn't make clear that it's the same object the method was called on
Refactor sth preparation/binding - no functional changes Notable internal changes: - _dbi_attrs_for_bind call is moved out of _dbh_execute - there is no point recalculating these on retry - _dbh_execute changed signature: $ident => $bind_attrs - sth, _sth and _dbh_sth are no more - instead we now have _prepare_sth and _bind_sth_params The test in t/storage/base.t has not been actually working for years (it did not register a spurious success with $count == 0). Removing it is safe as t/storage/reconnect.t tests the same codepath more thoroughly