8 years agoAccount for 'poor man role application' method plumbing on 5.8
Peter Rabbitson [Tue, 14 Jun 2016 06:18:35 +0000]
Account for 'poor man role application' method plumbing on 5.8

This also has the effect of greatly simplifying the OLD_MRO case

8 years agoProperly handle UNIVERSAL ancestry in describe_class_methods
Peter Rabbitson [Mon, 13 Jun 2016 16:43:31 +0000]
Properly handle UNIVERSAL ancestry in describe_class_methods

Obscure but possible nevertheless.

8 years agoFix describe_class_methods on non-mergeable DFS mro
Peter Rabbitson [Tue, 14 Jun 2016 16:05:51 +0000]
Fix describe_class_methods on non-mergeable DFS mro

Instead of trying to deduplicate - simply track which methods are locally
defined, and use that info combined with a reverse ISA-per-select-MRO to
build the final stack.

As a result the code is even more efficient and can now deal with real-life
insane hierarchies like:

https://metacpan.org/source/MJFLICK/DBIx-Class-Bootstrap-Simple-0.03/lib/DBIx/Class/Bootstrap/Simple.pm#L93

8 years agoName describe_class_methods arguments earlier
Peter Rabbitson [Tue, 14 Jun 2016 07:18:48 +0000]
Name describe_class_methods arguments earlier

The attribute::get() caching seems to only add noise in benchmarks,
so remove that. Same for the pre-check on recursion - remove that as well

8 years agoFix m2m regression from 8a67d9cf (simple but deadly)
Peter Rabbitson [Fri, 10 Jun 2016 06:22:38 +0000]
Fix m2m regression from 8a67d9cf (simple but deadly)

8 years agoAdd extra maint tooling - got tired of writing this smoke cmd by hand
Peter Rabbitson [Thu, 9 Jun 2016 09:06:39 +0000]
Add extra maint tooling - got tired of writing this smoke cmd by hand

8 years ago(travis) Temporarily disable {halt_on_failure} for cperl
Peter Rabbitson [Fri, 10 Jun 2016 06:31:56 +0000]
(travis) Temporarily disable {halt_on_failure} for cperl

It is not clear whether there is a way around the root cause:
https://github.com/rurban/distroprefs/commit/30792f7e95ca76ac1c1e73d0662dce22168c9df9#commitcomment-17817389

8 years ago(travis) Revert parts of e66f0ee0 and ee3a37d3
Peter Rabbitson [Fri, 10 Jun 2016 06:13:30 +0000]
(travis) Revert parts of e66f0ee0 and ee3a37d3

The typing of @array * $int got relaxed, and it turns out c5.22.2 worked
just fine *without* distroprefs, so I never noticed them being ignored

8 years ago(travis) Work around a bad tradeoff in cperl-5.24-to-be
Peter Rabbitson [Wed, 8 Jun 2016 07:47:56 +0000]
(travis) Work around a bad tradeoff in cperl-5.24-to-be

https://github.com/perl11/cperl/issues/153#issuecomment-224515895
http://irclog.perlgeek.de/perl11/2016-06-08#i_12624951

8 years ago(travis) Add cperl master to the smoke roster, bump to 5.22.3
Peter Rabbitson [Thu, 2 Jun 2016 17:55:31 +0000]
(travis) Add cperl master to the smoke roster, bump to 5.22.3

8 years ago(travis) Report the perl (and vm state) early before deps can fail
Peter Rabbitson [Tue, 7 Jun 2016 17:21:54 +0000]
(travis) Report the perl (and vm state) early before deps can fail

8 years ago(travis) Mini-utility to download travis reports
Peter Rabbitson [Tue, 7 Jun 2016 15:22:11 +0000]
(travis) Mini-utility to download travis reports

I've had enough waiting for their shit site :/

8 years agoBase more tests on DBICTest::BaseSchema (needed further up)
Peter Rabbitson [Sun, 5 Jun 2016 10:00:43 +0000]
Base more tests on DBICTest::BaseSchema (needed further up)

8 years agoAnd yet another INDIRECT guard missed in both e5053694 and d99f2db7
Peter Rabbitson [Mon, 6 Jun 2016 12:59:44 +0000]
And yet another INDIRECT guard missed in both e5053694 and d99f2db7

8 years agoIntroduce the describe_class_methods() utility function
Peter Rabbitson [Wed, 1 Jun 2016 08:46:28 +0000]
Introduce the describe_class_methods() utility function

This code will be needed several commits later to tie together the hierarchy
validation work.

Returns a comprehensive list of methods and related trivia. This required
way more code than one would hope, this part of perl is *really* hateful.

Read test changes under -w

Everything is implemented on "bare metal" (no Package::Stash, very aggressive
caching) as this needs to be as efficient as possible. Currently timings on
old and new MRO are roughly such on a downclocked X201 / M540:

~/devel/dbic$ perlbrew exec --with 5.8.5,5.16.2,5.24.0_rc1 \
  perl -T -Ilib -It/lib -MDBICTest -MTime::HiRes=time -e '
    my $t0 = time;
    sub tstamp {
      printf "%.6f\n", time - $t0;
      $t0 = time;
    }

    tstamp();

    for ( (qw(
      DBICTest::Schema::Artist
      DBICTest::Schema::CD
      DBICTest::Schema::Track
      main
    )) x 2 ) {
      print "describing $_\n";
      DBIx::Class::_Util::describe_class_methods($_);
      tstamp();
    }
  '

5.8.5
==========
0.000005
describing DBICTest::Schema::Artist
0.224748
describing DBICTest::Schema::CD
0.066118
describing DBICTest::Schema::Track
0.090433
describing main
0.003152
describing DBICTest::Schema::Artist
0.038846
describing DBICTest::Schema::CD
0.038390
describing DBICTest::Schema::Track
0.043453
describing main
0.002128

5.16.2
==========
0.000005
describing DBICTest::Schema::Artist
0.077804
describing DBICTest::Schema::CD
0.007684
describing DBICTest::Schema::Track
0.013071
describing main
0.001073
describing DBICTest::Schema::Artist
0.000109
describing DBICTest::Schema::CD
0.000096
describing DBICTest::Schema::Track
0.000098
describing main
0.000041

5.24.0_rc1
==========
0.000005
describing DBICTest::Schema::Artist
0.044058
describing DBICTest::Schema::CD
0.006093
describing DBICTest::Schema::Track
0.011004
describing main
0.000735
describing DBICTest::Schema::Artist
0.000118
describing DBICTest::Schema::CD
0.000114
describing DBICTest::Schema::Track
0.000113
describing main
0.000059

Additional sanity-checking of this deceptively simple code was performed by
sad brute-forcing of the entire test schema set ( at the time of this commit
the cumulative sum output was 0x1a65e78e316348104ab9cdc3e474c79096 )

perlbrew exec --with 5.8.5,5.10.0,5.16.2,5.18.0,5.20.0,5.24.0_rc1 \
perl -T -Ilib -It/lib -MDBICTest -e '
  use Math::BigInt;
  use Digest::MD5 "md5_hex";
  use List::Util 'shuffle';
  use Data::Dumper::Concise;
  use DBIx::Class::_Util qw( describe_class_methods uniq );

  my $sum = Math::BigInt->new(0);

  for ( shuffle uniq sort map { ( defined Scalar::Util::blessed $_ ) ? ref $_ : $_ } (
    qw(
      DBIx::Class::ResultSource
      DBIx::Class::Core
      DBIx::Class::ResultSet
      DBICTest::Schema
    ),
    ( map {
      $_,
      $_->result_class,
      $_->resultset_class,
    } map { DBICTest::Schema->source($_) } DBICTest::Schema->sources ),
  ) ) {
    my $desc = describe_class_methods($_);

    # unstable between invocations
    delete $desc->{cumulative_gen};

    # only available on 5.10+
    delete $desc->{methods}{DOES};

    # only available on 5.18+
    delete $desc->{methods}{"(("};

    $sum += Math::BigInt->new( "0x" . md5_hex(Dumper($desc)) );
  }

  print $sum->as_hex;
'

8 years agoIntroduce DBIC-specific method attribute support
Peter Rabbitson [Wed, 25 May 2016 09:44:20 +0000]
Introduce DBIC-specific method attribute support

When attribute support was added back in ed28f830 it was done in a weird
roundabout manner, with the only way to access the attributes via a chained
class accessor __attr_cache hidden behind a cascading method _attr_cache.

This is wasteful and rather inelegant. To mitigate this, and the propensity
of DBIC to eat any attribute it can lay its hands on, introduce special
handling for attributes prefixed with DBIC_

Any such attributes are handled by a much simpler storage system, and are
not made available to the legacy _attr_cache interface.

8 years agoAttribute handling got too complex - move it into a component
Peter Rabbitson [Sun, 29 May 2016 14:50:02 +0000]
Attribute handling got too complex - move it into a component

No functional changes, just c/p code around
For some reason git diff -C -C -M doesn't work here...

8 years agoProper attribute support under ithreads (fix 7bd921c0)
Peter Rabbitson [Sun, 29 May 2016 14:00:22 +0000]
Proper attribute support under ithreads (fix 7bd921c0)

The previous implementation was rushed (for decidedly non-technical reasons)
and is predictably completely wrong :/

Properly fix renumbering of the registry, and add a double-thread test to
catch future problems

Read under --color-words

8 years agoExpand the c3 mro test from d009cb7d
Peter Rabbitson [Mon, 30 May 2016 09:04:54 +0000]
Expand the c3 mro test from d009cb7d

No functional changes

8 years agoCorrect mistake in t/00describe_environment.t reporting of _TempExtlib
Peter Rabbitson [Mon, 30 May 2016 14:44:05 +0000]
Correct mistake in t/00describe_environment.t reporting of _TempExtlib

This isn't actually correct, but is a reasonable approximation. The entire
thing needs to be rewritten, but that's another fight

8 years agoRevert c9f4555e - I did not see a mistake I made in the skip-regex
Peter Rabbitson [Thu, 26 May 2016 19:21:05 +0000]
Revert c9f4555e - I did not see a mistake I made in the skip-regex

ribasushi-- # get your fucking act together...

8 years agoExpand/fortify the handling of attributes
Peter Rabbitson [Wed, 25 May 2016 08:00:58 +0000]
Expand/fortify the handling of attributes

Now works properly under ithreads, and allows multiple attributes->import()
calls to be made on the same cref

8 years agoMove even more utils into DBIC::_Util (see next commit)
Peter Rabbitson [Wed, 25 May 2016 12:19:13 +0000]
Move even more utils into DBIC::_Util (see next commit)

Zero functional changes

8 years agoPrevent CLONE from potentially running more than once
Peter Rabbitson [Thu, 26 May 2016 15:02:06 +0000]
Prevent CLONE from potentially running more than once

Argh, another thing I didn't know about iThreads: CLONE will run for every
package defining *or inheriting* it. Sigh...

8 years agoFix more taint.t failures under local::lib
Peter Rabbitson [Wed, 25 May 2016 15:14:23 +0000]
Fix more taint.t failures under local::lib

Add a CI run under l::l (when POISON_ENV is set) to weed this problem out
once and for all

Also relegate the test to xt/ - it will still run on smokers given 554484cb
and has no value failing on an end-user system (CI runs the entire suite
under prove -T anyhow)

8 years agoSkip lean_startup.t entirely on cperl for now
Peter Rabbitson [Thu, 26 May 2016 11:51:57 +0000]
Skip lean_startup.t entirely on cperl for now

8 years agoCouple things forgotten during 399b9455/b46b8537
Peter Rabbitson [Wed, 25 May 2016 10:54:31 +0000]
Couple things forgotten during 399b9455/b46b8537

8 years agoBetter lean startup skip in require override
Peter Rabbitson [Thu, 26 May 2016 10:17:29 +0000]
Better lean startup skip in require override

ribasushi-- # didn't think through this kind of thing can happen more widely

8 years agoAdd preliminary non-core attribute support
Peter Rabbitson [Tue, 24 May 2016 10:38:16 +0000]
Add preliminary non-core attribute support

This is done in such a "cargocult" way to unblock the rsrc work.
Will be gutted out once Moo 2.002 ships

8 years agoForce no_defer on DBIC-internal quote_sub() invocations
Peter Rabbitson [Mon, 23 May 2016 17:42:56 +0000]
Force no_defer on DBIC-internal quote_sub() invocations

8 years agoBring back _TempExtlib (d0435d75), this time for Sub::Quote
Peter Rabbitson [Tue, 24 May 2016 11:16:34 +0000]
Bring back _TempExtlib (d0435d75), this time for Sub::Quote

And this is the part that brings back the to-be-removed portion (unlike the
previous 399b9455 which is here to stay)

See next commit for why we need this, to be removed once Moo $next ships

8 years agoAdd permanent plumbing for _TempExtlib (d0435d75)
Peter Rabbitson [Tue, 24 May 2016 12:36:41 +0000]
Add permanent plumbing for _TempExtlib (d0435d75)

Since this is the second time we need this, there likely will be more down the
road. Split the permanenet and temporary parts into two commits so reverting
is less of a PITA.

This commit contains the pieces that are perfectly fine to lay dormant until
times we need _TempExtlib

8 years agoRemove last active reference to List::Util from lib/
Peter Rabbitson [Tue, 24 May 2016 08:40:12 +0000]
Remove last active reference to List::Util from lib/

This makes zero difference right now that List::Util/Scalar::Util/Sub::Util
are one disgusting ball of mud, but hopefully it will make sense soon after
@haarg's refactor finally ships

8 years agoBetter lean startup check
Peter Rabbitson [Sun, 28 Feb 2016 12:27:25 +0000]
Better lean startup check

Instead of stupidly loading DBICTest right away, delay to examine the actual
bare DBIC startup

8 years agoSimplify the find-test-temp-dir codepath a bit
Peter Rabbitson [Tue, 24 May 2016 06:54:18 +0000]
Simplify the find-test-temp-dir codepath a bit

8 years agoFix incorrect whitespace test outside of checkouts
Peter Rabbitson [Tue, 24 May 2016 11:55:31 +0000]
Fix incorrect whitespace test outside of checkouts

I stupidly broke it in 1fb834df

8 years agoThis piece of doc has been incorrect since c354902c
Peter Rabbitson [Tue, 24 May 2016 08:43:18 +0000]
This piece of doc has been incorrect since c354902c

8 years agoHarmonize time zone spelling in InflateColumn::DateTime
Dagfinn Ilmari Mannsåker [Tue, 17 May 2016 15:33:27 +0000]
Harmonize time zone spelling in InflateColumn::DateTime

The rest of the DateTime ecosystem consistently uses "time zone" and
"time_zone", so use that in InflateColumn::DateTime too

"timezone" is still accepted for backwards compatibility

8 years agoProperly fix corner case of non-comparing overload
Peter Rabbitson [Thu, 19 May 2016 18:49:55 +0000]
Properly fix corner case of non-comparing overload

Back in 096ab902a I stupidly introduced a distinction between blessed and
non-blessed structures in store_column. In retrospect this makes absolutely
no sense. It took me an embarrasingly long time to get my clue on, including
sending a bogus bugrport (with a patch FFS!!!) and wasting SYBER's time:
https://rt.cpan.org/Ticket/Display.html?id=114424

At least that shit never shipped :/

8 years ago(travis) Bump to Cperl 5.22.2
Peter Rabbitson [Thu, 19 May 2016 14:49:41 +0000]
(travis) Bump to Cperl 5.22.2

@miyagawa++ # YAML api - allows for trivial grep/sed slicing and dicing

Read under -w

8 years ago(travis) Test::Strict needs Devel::Cover which fails on blead
Peter Rabbitson [Thu, 19 May 2016 08:25:36 +0000]
(travis) Test::Strict needs Devel::Cover which fails on blead

To work around https://github.com/pjcj/Devel--Cover/issues/161 provide a fake
Devel::Cover satisfying https://github.com/Manwar/Test-Strict/issues/17

8 years ago(travis) Clear out some resolved FIXMEs
Peter Rabbitson [Thu, 19 May 2016 07:23:55 +0000]
(travis) Clear out some resolved FIXMEs

8 years ago(travis) Poorman updated their offerings
Peter Rabbitson [Thu, 19 May 2016 07:19:00 +0000]
(travis) Poorman updated their offerings

As a bonus sidesteps https://github.com/travis-ci/travis-ci/issues/5944

8 years agoStart known issues changelog section - place it on top for clarity
Peter Rabbitson [Sun, 15 May 2016 20:52:18 +0000]
Start known issues changelog section - place it on top for clarity

Aside from the 3 pieces listed in Changes, everything else tested on the list
below passes on 5.16.2 as of the date of this commit

Note: slight nudging (cpanm -n) was necessary to get some intra-deps

reset; set -o pipefail; for d in \
  RapidApp \
  App::DBCritic \
  App::DH \
  Catalyst::Controller::DBIC::API \
  Catalyst::Model::DBIC::Schema \
  Catalyst::Model::DBIC::Schema::PerRequest \
  Catalyst::Plugin::Authorization::RoleAbilities \
  Catalyst::TraitFor::Model::DBIC::Schema::Result \
  Catalyst::TraitFor::Model::DBIC::Shortcut \
  CatalystX::CRUD::ModelAdapter::DBIC \
  CatalystX::Eta \
  CatalystX::Resource \
  CatalystX::SimpleLogin \
  Dancer2::Plugin::DBIC \
  Dancer2::Session::DBIC \
  Dancer::Plugin::DBIC \
  Dancer::Session::DBIC \
  DBICx::Modeler \
  DBICx::Sugar \
  DBIx::Class::AlwaysUpdate \
  DBIx::Class::AuditAny \
  DBIx::Class::AuditLog \
  DBIx::Class::BatchUpdate \
  DBIx::Class::Candy \
  DBIx::Class::DeploymentHandler \
  DBIx::Class::DynamicDefault \
  DBIx::Class::DynamicSubclass \
  DBIx::Class::EasyFixture \
  DBIx::Class::Fixtures \
  DBIx::Class::Helpers \
  DBIx::Class::HTMLWidget \
  DBIx::Class::InflateColumn::Boolean \
  DBIx::Class::InflateColumn::DateTimeX::Immutable \
  DBIx::Class::InflateColumn::Math::Currency \
  DBIx::Class::InflateColumn::Serializer::Role::HashContentAccessor \
  DBIx::Class::InflateColumn::Time \
  DBIx::Class::InflateColumn::TimeMoment \
  DBIx::Class::Journal \
  DBIx::Class::Migration \
  DBIx::Class::MooseColumns \
  DBIx::Class::Objects \
  DBIx::Class::ParameterizedJoinHack \
  DBIx::Class::PgLog \
  DBIx::Class::QueryLog \
  DBIx::Class::RandomColumns \
  DBIx::Class::Result::ColumnData \
  DBIx::Class::ResultSet::AccessorsEverywhere \
  DBIx::Class::ResultSet::AuditLog \
  DBIx::Class::ResultSet::RecursiveUpdate \
  DBIx::Class::ResultSource::MultipleTableInheritance \
  DBIx::Class::Result::Validation \
  DBIx::Class::Schema::Config \
  DBIx::Class::Schema::Diff \
  DBIx::Class::Schema::Loader \
  DBIx::Class::Schema::Loader::Dynamic \
  DBIx::Class::Schema::PopulateMore \
  DBIx::Class::Schema::RestrictWithObject \
  DBIx::Class::Schema::TxnEndHook \
  DBIx::Class::Schema::Versioned::Inline \
  DBIx::Class::Sims \
  DBIx::Class::TimeStamp \
  DBIx::Class::TopoSort \
  DBIx::Class::Tree \
  DBIx::Class::Tree::Mobius \
  DBIx::Class::UnicornLogger \
  DBIx::Class::UserStamp \
  DBIx::Class::Validation \
  DBIx::Class::Validation::Structure \
  DBIx::Class::VirtualColumns \
  DBIx::Class::Wrapper \
  DBIx::Schema::Changelog \
  DBIx::Table::TestDataGenerator \
  Galileo \
  HTML::FormHandler::Model::DBIC \
  HTML::FormHandler::TraitFor::Model::DBIC \
  Interchange6::Schema \
  KiokuDB::Backend::DBI \
  MooseX::Meta::Method::Transactional \
  MooseX::Role::DBIC \
  MooseX::Storage::DBIC \
  MooseX::Types::DBIx::Class \
  Reaction \
  Tapper::Schema \
  Test::DBIC::Schema::Connector \
  Test::DBIC::Versioned \
  Test::DBIx::Class \
  WebAPI::DBIC \
  Yeb::Plugin::DBIC \
  "DBD::SQLite@1.35 Handel Catalyst::ActionRole::BuildDBICResult" \
; do \
  PERL5LIB=/home/rabbit/devel/dbic/lib \
  DBIC_ASSERT_NO_ERRONEOUS_METAINSTANCE_USAGE=1 \
  cpanm -v --reinstall $d 2>&1 \
| tee -a /dev/shm/umpfh \
| grep -P -B1 '^(Building and testing|Result:)' || break \
; done

8 years agoAdd a few more indirect call guards missed in e5053694
Peter Rabbitson [Tue, 17 May 2016 15:43:30 +0000]
Add a few more indirect call guards missed in e5053694

No notable code changes were required as a result

8 years agoRollback some mistaken indirect-call-elisions from e5053694
Peter Rabbitson [Sun, 15 May 2016 20:52:18 +0000]
Rollback some mistaken indirect-call-elisions from e5053694

The ::Realtionship::Base calls perform result-instance adjustments, thus
they CAN NOT be omitted

That would have been *really* embarrassing, good thing dependent smoking
caught this crap. Not adding an extra test at this point, but probably
should :/

Audit was performed by scrutinizing each line of:
grep -- '->' \
 <(git diff -U0 e50536940^..e50536940) \
 <(git diff -U0 77c3a5dca^..77c3a5dca) \
> argh.log

8 years agoEnsure the component_class override require()s its value in a pipeline
Peter Rabbitson [Sun, 15 May 2016 15:01:32 +0000]
Ensure the component_class override require()s its value in a pipeline

8 years agoStreamline ::ResultSource::* inheritance, similar to d009cb7d
Peter Rabbitson [Sun, 15 May 2016 13:54:30 +0000]
Streamline ::ResultSource::* inheritance, similar to d009cb7d

There should be zero functional changes

8 years agoClean up the mess around $rsrc->sqlt_deploy_callback
Peter Rabbitson [Sun, 15 May 2016 14:38:59 +0000]
Clean up the mess around $rsrc->sqlt_deploy_callback

Back in f89bb832 nothingmuch introduced a hook point used to better integrate
with KiokuDB::Backend::DBI. It was properly implemented as a $rsrc instance
attribute, though somewhat undocmented.

Then in 880c075b castaway came along and incorrectly documented the attribute
as settable from a class, without it ever becoming a member of the list in
DBIC::ResultSourceProxy.

Then in 3b4e619d1 yours truly came along and (either misled by the docs, or
by drugs, or both) switched the accessor to classdata (CAG inherited) even
though rsrc-class-level operations were never a thing.

Revert part of 3b4e619d1 and fix the documentation to properly reflect the
state of affairs

8 years agoExplicit exception clarifying that $rsrc->from() is not a setter
Peter Rabbitson [Mon, 2 May 2016 11:35:40 +0000]
Explicit exception clarifying that $rsrc->from() is not a setter

This has always been the case, but previously from('foo') would just eat the
arguments silently

8 years agoPull apart a test section (no functional changes)
Peter Rabbitson [Fri, 29 Apr 2016 11:00:35 +0000]
Pull apart a test section (no functional changes)

8 years agoIn d009cb7d I stupidly created a "double around()"
Peter Rabbitson [Wed, 4 May 2016 16:10:33 +0000]
In d009cb7d I stupidly created a "double around()"

Consolidate all the logic in DBIC::Componentised instead

8 years agoBump Sub::Uplevel dep - too much breaks on <= 0.18
Peter Rabbitson [Fri, 29 Apr 2016 16:00:03 +0000]
Bump Sub::Uplevel dep - too much breaks on <= 0.18

Note that this is a kludge - the guts of ::Carp need to be protected much
better by a faulty caller() override (as was the case in RT#32640)

An attempt to do so in 821edc09 turned out insufficient - everything still
fails on `DBIC_TRACE=1 prove ...` if the older Sub::Uplevel is installed :(

8 years agoMore indirect call removals: the second part of 77c3a5dc
Peter Rabbitson [Fri, 15 Apr 2016 14:24:33 +0000]
More indirect call removals: the second part of 77c3a5dc

This may see like a random thing to do, especially given the late dev stage,
but it is needed for the clean fix of rsrc duality several commits later.

The spots were audited via "list all subs 10 lines or less":

~/devel/dbic$ find lib \
     -name '*.pod' -prune \
  -o -path lib/DBIx/Class/CDBICompat -prune \
  -o -path lib/DBIx/Class/Admin -prune \
  -o -path lib/DBIx/Class/Storage -prune \
  -o -path lib/DBIx/Class/SQLMaker -prune \
  -o -type f -exec perl -0777 -e '
    $_ =~ /\S/
      and
    $_ !~ /ASSERT_NO_INTERNAL_INDIRECT_CALLS and fail_on_internal_call/
      and
    print "\n=====\n$ARGV\n=====\n\n$_\n\n\n"
      for (<> =~ / (
        ^ (\s*) sub \s+ \w+ \s* \{ (?:
          [^\n]+? \} \s*? \n
            |
          (?: [^\n]* \n ){0,10}? ^ \2 \}
        )
      ) /xmg)
  ' {} \; \
| less

8 years agoCentralize remaining uses of Sub::Name within _Util
Peter Rabbitson [Wed, 27 Apr 2016 12:57:40 +0000]
Centralize remaining uses of Sub::Name within _Util

No functional changes

8 years agoMissed test spewing odd debug after fd2c6658f (slave-less replication)
Peter Rabbitson [Thu, 28 Apr 2016 07:07:08 +0000]
Missed test spewing odd debug after fd2c6658f (slave-less replication)

Disabling VIA_REPLICATED as it makes no sense here anyway

8 years agoSilly GitHub, Perl6 is not a real language :trollface:
Sebastian Riedel [Tue, 26 Apr 2016 22:04:38 +0000]
Silly GitHub, Perl6 is not a real language :trollface:

Port of https://github.com/kraih/mojo/commit/19cdf772
Before this clarification the project listed as 7% Perl6 code >.<

The explicit listing is needed, as there apparently won't be a fix
within Github itself any time soon:
https://github.com/github/linguist/issues/2149#issuecomment-108954064
https://github.com/github/linguist/issues/2781#issuecomment-167095903
https://github.com/github/linguist/issues/2074#issue-56431157

Language names sourced from:
https://github.com/github/linguist/blob/master/lib/linguist/languages.yml

8 years ago(travis) Work around RT#113740
Peter Rabbitson [Sun, 24 Apr 2016 16:49:46 +0000]
(travis) Work around RT#113740

8 years ago(travis) Make more helper functions available to subexecs
Peter Rabbitson [Sun, 24 Apr 2016 11:36:47 +0000]
(travis) Make more helper functions available to subexecs

8 years agoFix last remaining tests with -T under < 5.10
Peter Rabbitson [Sun, 24 Apr 2016 13:49:30 +0000]
Fix last remaining tests with -T under < 5.10

Model on https://github.com/p5sagit/namespace-clean/commit/acb1d694, this is
still a mega-kludge, as the FIXME in the file says

8 years agoFix ordering by 1:M prefetched boolean columns in Pg
Dagfinn Ilmari Mannsåker [Wed, 10 Dec 2014 18:04:06 +0000]
Fix ordering by 1:M prefetched boolean columns in Pg

PostgreSQL doesn't have min/max aggregates for the boolean type, but
it has and/or, which are equivalent. So, allow the storage to override
the aggregate used for constructing the order by clause based on the
column info.

8 years agoUse prepared statement from the start for populate on PostgreSQL
Dagfinn Ilmari Mannsåker [Wed, 20 Apr 2016 16:23:46 +0000]
Use prepared statement from the start for populate on PostgreSQL

DBD::Pg since version 3.0.0 by default only starts using server-side
prepared statements the second time ->execute is called on a given
statement handle.

Unless server-side prepared statements have been disabled (by setting
the threshold to zero), make it use them immediately to avoid parsing
the statement twice.

8 years agoFix Oracle _dbh_execute_for_fetch warning suppression
Dagfinn Ilmari Mannsåker [Wed, 20 Apr 2016 16:20:26 +0000]
Fix Oracle _dbh_execute_for_fetch warning suppression

Commit 52cef7e3 changed from using execute_array to execute_for_fetch,
but didn't update the signature of the override in
Storage::DBI::Oracle::Generic, so it was setting ->{PrintWarn} 0 on the
result source, not the statement handle.

The reason it was not detected since is that DBD::Oracle 1.28+ already
fixed the underlying warning.

8 years agoAfter 5e0eea35 we can actually test for cleaned namespaces within CDBI
Peter Rabbitson [Tue, 19 Apr 2016 10:54:46 +0000]
After 5e0eea35 we can actually test for cleaned namespaces within CDBI

8 years agoRemove Class::Data::Inheritable and use CAG 'inherited' style accessors
Peter Rabbitson [Tue, 19 Apr 2016 08:04:26 +0000]
Remove Class::Data::Inheritable and use CAG 'inherited' style accessors

This *is* a subtle change in behavior, as the CAG accessors could be overriden
by a rogue get/set_inherited in the stack. However keeping CDI in-place while
satisfying the requirements of the rsrc refactor is just too much work for a
miniscule risk avoidance. If something blows up - we'll think then.

8 years agoStart setting the 'c3' mro unambiguously everywhere
Peter Rabbitson [Tue, 19 Apr 2016 12:13:03 +0000]
Start setting the 'c3' mro unambiguously everywhere

This is a necessary part of the rsrc refactor, which there is no way around.
And yes - it is extremely invasive and dangerous, with very high chance of
fallout. Given the situation there is no other way :/

The implementation itself is rather simple: all we need to do is hook
inject_base (which is called by load_components via several levels of
indirection), and also (as a precaution) we set the mro on anything loaded
via a component-group accessor. This seems to nicely cover pretty much all
of the hierarchy (except ::Storage, but that is another matter/rewrite)

Also move the CAG compat pieces where they belong

8 years agoReorder a couple stray loads in ResultSource.pm
Peter Rabbitson [Wed, 20 Apr 2016 06:02:29 +0000]
Reorder a couple stray loads in ResultSource.pm

8 years agoFix obscure failure of CDBICompat accessor install on 5.8
Peter Rabbitson [Wed, 20 Apr 2016 10:31:23 +0000]
Fix obscure failure of CDBICompat accessor install on 5.8

CDBICompat has a bizarre override of the CAG logic, in a way that only works
reliably at compiletime due to Class::C3 "cache" slots

A test implicitly starts covering this failcase once Class::Data::Inheritable
is removed sever commits later

8 years agoAugment the infinite loop fix 4f52479b with the infra of ddcc02d1
Peter Rabbitson [Fri, 8 Apr 2016 14:36:22 +0000]
Augment the infinite loop fix 4f52479b with the infra of ddcc02d1

This also fixes a manifestation (but not the cause, this comes later) of a
bug where $result->result_source != $result->result_source_instance.

This commit is made early as it is rather efficient anyway, and it allows me
to test Handel (which was broken by 4f52479b) to validate subsequent rsrc
rewritering

8 years agoReduce duplicate ->result_source calls where sensible
Peter Rabbitson [Tue, 15 Dec 2015 22:22:51 +0000]
Reduce duplicate ->result_source calls where sensible

No functional changes

8 years agoThis was commented out in 2008 (5b0b4df8) and never used
Peter Rabbitson [Tue, 15 Dec 2015 21:30:10 +0000]
This was commented out in 2008 (5b0b4df8) and never used

8 years agoSlightly golf ::ResultSource::DESTROY and several weaken() calls
Peter Rabbitson [Thu, 14 Apr 2016 12:56:00 +0000]
Slightly golf ::ResultSource::DESTROY and several weaken() calls

No functional changes

8 years agoProxy the 'unsafe' attribute to the internal ::Versioned storage
Fabrice Gabolde [Wed, 13 Apr 2016 13:42:38 +0000]
Proxy the 'unsafe' attribute to the internal ::Versioned storage

8 years agoRemove one level of indirection in Versioned on_connect
Peter Rabbitson [Thu, 14 Apr 2016 08:34:30 +0000]
Remove one level of indirection in Versioned on_connect

No functional changes

8 years agoAdd a weaken() cycle forgotten in d63c9e64
Peter Rabbitson [Thu, 14 Apr 2016 07:19:15 +0000]
Add a weaken() cycle forgotten in d63c9e64

The reason this has not been a problem is because thread spawn in DESTROY is
practically unheard of. Nevertheless if one throws the following in, the
problem becomes apparent: ( not committing this test, because... just no. )

--- a/t/storage/txn_scope_guard.t
+++ b/t/storage/txn_scope_guard.t
@@ -247,5 +247,7 @@ require DBICTest::AntiPattern::NullObject;
   my @arg_capture;
   {
+    use threads;
     local $SIG{__WARN__} = sub {
+      threads->new(sub { sleep 1})->join;
       package DB;

8 years agoFix thinko from 10dd5c05 - make sure we actually sleep
Peter Rabbitson [Wed, 13 Apr 2016 17:43:30 +0000]
Fix thinko from 10dd5c05 - make sure we actually sleep

Under very tight concurrency it is possible that the test will not be given
sufficient timeshare before the scheduled 'point in the future', which would
result in us asking Time::HiRes to sleep for a negative amount of time, which
it "helpfully" converts to an obnoxious exception.

8 years agoAdd a proof of concept test for copy() with assymetric IC::DT
Tina Mueller [Fri, 14 Aug 2015 11:51:53 +0000]
Add a proof of concept test for copy() with assymetric IC::DT

What a mess. The core of the problem is that some of our IC::DT in/deflator
pairs are *not* symmetric. That is for things to roundtrip one needs values
to pass through the database, which is configured "just properly wrong" to
perform the second half of this evil dance.

Of course this break copy() and likely other things I do not know about.
Given there is nothing one can do about the core problem (huge install base)
a minimally invasive workaround has been devised and tested here. Refer to
`git show 993fa9b | perl -ne 'print if 110..134'` for the exact snippet you
need to place in your base result class to make everything work again.

This is terrible.
    -- ribasushi

For completeness: here is a full list of individual inflators (as of Apr
2016) and which ones are broken beyond repair:

ACCESS                         2016-04-13 07:42:58         2016-04-13T07:42:58   2016-04-13 07:42:58        (via DateTime::Format::MySQL)
DB2                            2016-04-13-07.42.58         2016-04-13T07:42:58   2016-04-13-07.42.58        (via DateTime::Format::DB2)
MSSQL                          2016-04-13 07:42:58.000     2016-04-13T07:42:58   2016-04-13 07:42:58.000    (via DBIx::Class::Storage::DBI::MSSQL::DateTime::Format)
Pg                             2016-04-13 07:42:58+0000    2016-04-13T07:42:58   2016-04-13 07:42:58+0000   (via DateTime::Format::Pg)
ADO                            2016-04-13 07:42:58         2016-04-13T07:42:58   2016-04-13 07:42:58        (via DateTime::Format::MySQL)
NoBindVars                     2016-04-13 07:42:58         2016-04-13T07:42:58   2016-04-13 07:42:58        (via DateTime::Format::MySQL)
SQLAnywhere                    2016-04-13 07:42:58.000000  2016-04-13T07:42:58   2016-04-13 07:42:58.000000 (via DateTime::Format::Strptime)
AutoCast                       2016-04-13 07:42:58         2016-04-13T07:42:58   2016-04-13 07:42:58        (via DateTime::Format::MySQL)
Firebird                       2016-04-13 07:42:58.0000    2016-04-13T07:42:58   2016-04-13 07:42:58.0000   (via DBIx::Class::Storage::DBI::InterBase::DateTime::Format)
Informix                       2016-04-13 07:42:58.00000   2016-04-13T07:42:58   2016-04-13 07:42:58.00000  (via DBIx::Class::Storage::DBI::Informix::DateTime::Format)
ODBC                           2016-04-13 07:42:58         2016-04-13T07:42:58   2016-04-13 07:42:58        (via DateTime::Format::MySQL)
Sybase                         2016-04-13 07:42:58         2016-04-13T07:42:58   2016-04-13 07:42:58        (via DateTime::Format::MySQL)
mysql                          2016-04-13 07:42:58         2016-04-13T07:42:58   2016-04-13 07:42:58        (via DateTime::Format::MySQL)
InterBase                      2016-04-13 07:42:58.0000    2016-04-13T07:42:58   2016-04-13 07:42:58.0000   (via DBIx::Class::Storage::DBI::InterBase::DateTime::Format)
Oracle                         2016-04-13 07:42:58         2016-04-13T07:42:58   2016-04-13 07:42:58        (via DateTime::Format::MySQL)
SQLite                         2016-04-13 07:42:58         2016-04-13T07:42:58   2016-04-13 07:42:58        (via DateTime::Format::SQLite)
Firebird::Common               2016-04-13 07:42:58.0000    2016-04-13T07:42:58   2016-04-13 07:42:58.0000   (via DBIx::Class::Storage::DBI::InterBase::DateTime::Format)
Sybase::FreeTDS                2016-04-13 07:42:58         2016-04-13T07:42:58   2016-04-13 07:42:58        (via DateTime::Format::MySQL)
Sybase::MSSQL                  2016-04-13 07:42:58.000     Your datetime does not match your pattern. at                             (via DBIx::Class::Storage::DBI::Sybase::Microsoft_SQL_Server::DateTime::Format)
Sybase::Microsoft_SQL_Server   2016-04-13 07:42:58.000     Your datetime does not match your pattern. at                             (via DBIx::Class::Storage::DBI::Sybase::Microsoft_SQL_Server::DateTime::Format)
Sybase::ASE                    04/13/2016 07:42:58.000     Your datetime does not match your pattern. at                             (via DBIx::Class::Storage::DBI::Sybase::ASE::DateTime::Format)
Sybase::Microsoft_SQL_Server::NoBindVars 2016-04-13 07:42:59.000     Your datetime does not match your pattern. at                             (via DBIx::Class::Storage::DBI::Sybase::Microsoft_SQL_Server::DateTime::Format)
Sybase::ASE::NoBindVars        04/13/2016 07:42:59.000     Your datetime does not match your pattern. at                             (via DBIx::Class::Storage::DBI::Sybase::ASE::DateTime::Format)
Oracle::WhereJoins             2016-04-13 07:42:59         2016-04-13T07:42:59   2016-04-13 07:42:59        (via DateTime::Format::Oracle)
Oracle::Generic                2016-04-13 07:42:59         2016-04-13T07:42:59   2016-04-13 07:42:59        (via DateTime::Format::Oracle)
ODBC::ACCESS                   2016-04-13 07:42:59         2016-04-13T07:42:59   2016-04-13 07:42:59        (via DBIx::Class::Storage::DBI::ODBC::ACCESS::DateTime::Format)
ODBC::DB2_400_SQL              2016-04-13-07.42.59         2016-04-13T07:42:59   2016-04-13-07.42.59        (via DateTime::Format::DB2)
ODBC::SQL_Anywhere             2016-04-13 07:42:59.000000  2016-04-13T07:42:59   2016-04-13 07:42:59.000000 (via DateTime::Format::Strptime)
ODBC::Firebird                 2016-04-13 07:42:59.0000    2016-04-13T07:42:59   2016-04-13 07:42:59.0000   (via DBIx::Class::Storage::DBI::InterBase::DateTime::Format)
ODBC::Microsoft_SQL_Server     2016-04-13 07:42:59.000     2016-04-13T07:42:59   2016-04-13 07:42:59.000    (via DBIx::Class::Storage::DBI::MSSQL::DateTime::Format)
ADO::MS_Jet                    04/13/2016 07:42:59 AM      2016-04-13T07:42:59   04/13/2016 07:42:59 AM     (via DBIx::Class::Storage::DBI::ADO::MS_Jet::DateTime::Format)
ADO::Microsoft_SQL_Server      04/13/2016 07:42:59 AM      2016-04-13T07:42:59   04/13/2016 07:42:59 AM     (via DBIx::Class::Storage::DBI::ADO::Microsoft_SQL_Server::DateTime::Format)

... and the program that produces the above ...

~$ perl -I lib -MDateTime -MFile::Find -e '

  find({ no_chdir => 1, follow_fast => 1, wanted => sub {

    -f _ or next;
    $_ =~ m{DBIx/Class/Storage/DBI/(?!Replicated|IdentityInsert|.*?Cursor|UniqueIdentifier)(.+)\.pm} or next;

    list_dt_state($1);

  }}, "lib" );

  sub list_dt_state {
    ( my $id = shift ) =~ s|/|::|g;

    my $s = "DBIx::Class::Storage::DBI::$id";

    my $p = eval "local \$SIG{__WARN__} = sub {}; require $s; $s->build_datetime_parser"
      or ( printf "%s: %s\n", $id, substr $@, 0, 45 and next );

    my $as_string = $p->format_datetime( DateTime->now );
    my $half_trip = eval { $p->parse_datetime( $as_string ) } || substr $@, 0, 45;
    my $full_trip = $@ ? "" : eval { $p->format_datetime( $half_trip ) } || substr $@, 0, 45;

    printf "%-30s %-26s  %-20s  %-26s (via %s)\n",
      $id,
      $as_string,
      $half_trip,
      $full_trip,
      ( ref $p || $p ),
    ;
  }
'

8 years agoFix t/746sybase.t failing under -T
Peter Rabbitson [Tue, 12 Apr 2016 14:28:25 +0000]
Fix t/746sybase.t failing under -T

8 years agoFix forgotten finally{} in Sybase::ASE (missed in ddcc02d14)
Peter Rabbitson [Tue, 12 Apr 2016 14:25:58 +0000]
Fix forgotten finally{} in Sybase::ASE (missed in ddcc02d14)

I guess my grep-fu failed me, the finally is right there...

As per the comment nothing seems to fail if I just remove this, but ASE is
so fragile that I'll just play it safe...

8 years agoAnd lose yet another dependency: List::Util (yes, I know it's core)
Peter Rabbitson [Mon, 11 Apr 2016 11:31:18 +0000]
And lose yet another dependency: List::Util (yes, I know it's core)

The main motivation for this is that first {} is an expensive subcall,
whereas grep is a native fast opcode. Within the entire codebase there
are pretty much no spots where we have so many elements to check, that
the "check everything" of grep will overwhelm the expense of entersub
(in fact 2 calls - one to first() itself, another to the block)

As a side effect the removal of first(), which was the only thing
we used that has known leaks prior to L::U 1.18, lets us drop the
"5.8.8+ or later" List::Util dep entirely (it doesn't matter much
for users, but it stresses the CI even more, which is a good thing)

This cangeset should introduce 0 functional changes

8 years agoLose another dependency: Class::Inspector
Peter Rabbitson [Mon, 11 Apr 2016 09:49:56 +0000]
Lose another dependency: Class::Inspector

It is either used in tests (where we cargocult a similar function), or in a
spot where Package::Stash will do

8 years agoRemove dead code from DBI::Replicated
Peter Rabbitson [Tue, 12 Apr 2016 11:27:14 +0000]
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 )
'

8 years agoHarmonize DBICTEST_VIA_REPLICATED detection in tests
Peter Rabbitson [Tue, 12 Apr 2016 10:09:03 +0000]
Harmonize DBICTEST_VIA_REPLICATED detection in tests

Back in 8b60b9211a I made a number of mistakes implementing the escape
checks: an envvar being set does not mean we are in fact running under
replication (e.g. the user requested explicitly use_file => 0 )

Fix that and also make sure we still run when use_file => 1 (and fix a
forgotten test failing this way)

8 years agoBring back constants excised in 08a8d8f1. FML.
Peter Rabbitson [Tue, 12 Apr 2016 11:52:04 +0000]
Bring back constants excised in 08a8d8f1. FML.

8 years ago(travis) Add a CLEANTEST run of RURBAN's cperl in the spirit of 62f2092b
Peter Rabbitson [Mon, 11 Apr 2016 13:53:04 +0000]
(travis) Add a CLEANTEST run of RURBAN's cperl in the spirit of 62f2092b

Refer to the (*really* small) patchset for info on how to run the same locally
TLDR: you need to activate distroprefs and use CPAN.pm

8 years ago(travis) Add 5.22.1 with quadmath testing
Peter Rabbitson [Mon, 11 Apr 2016 11:10:53 +0000]
(travis) Add 5.22.1 with quadmath testing

8 years ago(travis) Reorganize POISON_ENV mode
Peter Rabbitson [Mon, 11 Apr 2016 18:24:21 +0000]
(travis) Reorganize POISON_ENV mode

Allow MVDT and BREAK_CC to be separate settings, will make sense in further
commits. This adds extra testing of DEVREL_DEPS with no compiler, which
brings another round of exceptions etc... sigh

Read under -w

8 years ago(travis) Enhance the 'broken compiler' test
Peter Rabbitson [Mon, 11 Apr 2016 15:19:34 +0000]
(travis) Enhance the 'broken compiler' test

8 years agoFix another ::FilterColumn bug sigh...
Peter Rabbitson [Sat, 2 Apr 2016 15:41:52 +0000]
Fix another ::FilterColumn bug sigh...

This one is technically a regression introduced by dc6dadae, which aimed to
solve multiple runs on already-dirty columns. Unfortunately this very same
change broke update(). Overload get_dirty_columns to fix that, and add a
bunch of tests validating nothing crazy is going on.

I should have seen all of these problems when FC was initially considered,
but alas I was too damn inexperienced :/

8 years agoTest with explicitly readonly 'replicants' under DBICTEST_VIA_REPLICATED
Peter Rabbitson [Sat, 2 Apr 2016 13:21:37 +0000]
Test with explicitly readonly 'replicants' under DBICTEST_VIA_REPLICATED

8 years agoFix parsing DSN when the driver part includes DBI attributes
Fabrice Gabolde [Fri, 1 Apr 2016 13:05:42 +0000]
Fix parsing DSN when the driver part includes DBI attributes

8 years agoFix annoying warnings on innocent looking MSSQL code
Peter Rabbitson [Fri, 1 Apr 2016 10:19:51 +0000]
Fix annoying warnings on innocent looking MSSQL code

After several rounds of improvements in the retry logic (84efb6d7, 729656c5)
MSSQL code non-fatally aborting due to clashing multiple active resultsets
would emit an annoying warning. Such warnings are especially baffling when
encountered in innocent-looking code like:

   my $first_bar_of_first_foo = $schema->resultset('Foo')
                                        ->search({ foo => 'fa' })
                                         ->next
                                          ->related_resultset("bar")
                                           ->next;

Since no object destruction takes place until the = operator is executed, the
cursor returning "first foo matching fa" is still active when we run a second
search for the "bars". With default MSSQL settings (i.e. without an enabled
MARS[1] implementation) this leads to an exception on the second ->next().
The failed next() is properly retried, since we are not in transaction or some
similar complicating factor, and the entire thing executes correctly, except
the force-disconnect-before-reconnect-after-failed-ping warns about the first
cursor being still alive.

Add extra stack marker for this particular case, and teach the MSSQL driver to
hide the (at this stage spurious) warning

[1] http://p3rl.org/DBIx::Class::Storage::DBI::ODBC::Microsoft_SQL_Server#MULTIPLE-ACTIVE-STATEMENTS

8 years agoSilence spurious warnings from todoified test
Peter Rabbitson [Fri, 1 Apr 2016 10:05:51 +0000]
Silence spurious warnings from todoified test

8 years agoAvoid infinite loop if save point does not exist
Paul Mooney [Thu, 10 Mar 2016 10:50:57 +0000]
Avoid infinite loop if save point does not exist

8 years agoReally fix SQLite savepoints unlike the shortsighted 398215b1
Peter Rabbitson [Wed, 30 Mar 2016 18:24:49 +0000]
Really fix SQLite savepoints unlike the shortsighted 398215b1

8 years agoFix incorrect exception propagation in ::Replicated::execute_reliably
Peter Rabbitson [Wed, 30 Mar 2016 14:06:48 +0000]
Fix incorrect exception propagation in ::Replicated::execute_reliably

The code makes no sense in its current state, lapse left in after 1abccf54

8 years agoFix *stupid* silencing of exceptions introduced in 4e9fc3f3
Peter Rabbitson [Wed, 30 Mar 2016 13:44:15 +0000]
Fix *stupid* silencing of exceptions introduced in 4e9fc3f3

The reason this has not been detected is because it is virtually impossible
for the stock inflate_result() to throw, and pretty rare for custom ones.

ARGH!

Found and individually vetted all remaining eval()s as in:
grep -Pnr -B2 -A7 '^(?!\s*#).*?\beval\b' lib | less

8 years agoStore collapser source in the resultset private metadata as well
Peter Rabbitson [Wed, 23 Mar 2016 13:05:10 +0000]
Store collapser source in the resultset private metadata as well

After 05a5ca4b the deparse of the row-parser coderef is incomprehensible at
best. Add the source to the private cache structure to aid debugging if it
ever becomes necessary (fingercross it won't be). Aside from the explicit
evaluation package name, and the slight change of the return of _mk_row_parser
there are no functional changes

Read under -w

8 years agoStep up the error reporting on unexpected NULLs during collapse
Peter Rabbitson [Fri, 25 Mar 2016 13:28:42 +0000]
Step up the error reporting on unexpected NULLs during collapse

The collapser became so complex that it is practically impossible to debug
when things go sideways. Expand the rudimentary "just check root identifier"
to a comprehensive check of all identifier groups, at the expense of some
performance. This builds on top of the {nullchecks} metadata collected in
5ff6d603, generating maximally unrolled definedness checks which cause an
early return with no results and flagged unexpected-null-positions

The commit itself is relatively straightforward, though the meager changeset
in lib/ is misleading: the damned thing took almost 8 days to fully think
through and implement with several detours for bugfixing :/

8 years agoFirst part of changes for better unexpected NULL reporting
Peter Rabbitson [Thu, 24 Mar 2016 15:22:44 +0000]
First part of changes for better unexpected NULL reporting

Doing things in two parts to make it easier to reason about. This part only
changes the collapse_map visitor to collect more metadata, and uses a bit
of it to elide a couple of // ops.

Additionally we are now feeding the stash-arrayref to the collapser at all
times, it will become clear way in the next commit (where all the real
changes are)

Read under -w