Merge branch 'master' into topic/constructor_rewrite
Fix the silly mistake responsible for the drama around c9733800

A perlcritic policy to catch this stuff in the future is under consideration
Reverting a48693f42e - the test is a fat duplicate of t/prefetch/false_colvalues.t
Hit an MC hash-order bug - simplify create, and solve it another time
(test saved and augmented in another branch)
Fixups for 5.17.6+ hash randomization
Unset collapse in even more cases
Added test for join and empty prefetch exception

(Now passing after previous commit)
Write correct odd (not even) relchain depth on primary joins
ETOOMANYARGS - change _resolve_collapse to take a couple hashes

No functional changes
Fix _resolve_collapse to always consider the entire chain of parent ids

Instead of relying on a "local column based" resolution for a particular
node, always add all the "collapsers" of the left-side "parents".

In the process cleanup the return of _resolve_collapse, and make it more
generic (after all we are hoping to CPAN the collapser generator some
day).

The change above  solves the following problem: think of an artist with
3 CDs A, B & C:

$cd_rs->search(
  [
    { 'me.title' => 'A', 'cds.title' => { '!=' => 'B' } },
    { 'me.title' => { '!=', => 'A' }, 'cds.title' => 'B' },
  ],
  { prefetch => { artist => 'cds' } },
);

Since an artist is fully defined by its PK (which we already fetch),
an all() run will keep accumulating all 3 CDs under the same already
known hash, representing said artist, because we do not create two
distinct pigeon-hole-hashes for "artist of A" and "artist of non-A".
Test for restricted prefetch (now passing again after previous commit)
Restore ability to handle underdefined root (t/prefetch/incomplete.t)

In addition make things work when multiple has_many-inheriting branches
are present on the root. This squeezes in the last thing I could think
of into the row_parser maker, and allows to *properly* collapse stuff
like this:

$rs = $schema->resultset ('CD')->search ({}, {
  join => [ 'tracks', { single_track => { cd => { artist => { cds => 'tracks' } } } }  ],
  collapse => 1,
  columns => [
    { 'single_track.trackid'                    => 'single_track.trackid' },  # definitive link to root from 1:1:1:1:M:M chain
    { 'year'                                    => 'me.year' },               # non-unique
    { 'tracks.cd'                               => 'tracks.cd' },             # \ together both uniqueness for second multirel
    { 'tracks.title'                            => 'tracks.title' },          # / and definitive link back to root
    { 'single_track.cd.artist.cds.cdid'         => 'cds.cdid' },              # to give uniquiness to ...tracks.title below
    { 'single_track.cd.artist.cds.year'         => 'cds.year' },              # non-unique
    { 'single_track.cd.artist.artistid'         => 'artist.artistid' },       # uniqufies entire parental chain
    { 'single_track.cd.artist.cds.genreid'      => 'cds.genreid' },           # nullable
    { 'single_track.cd.artist.cds.tracks.title' => 'tracks_2.title' },        # unique when combined with ...cds.cdid above
  ],
  order_by => \ 'RANDOM()'
});

Which DBIC sees like this ( produced by `prove -l t/prefetch/manual.t -v` ):

 sngl_tr.trackid #        me.year #       tracks.cd #    tracks.title #        cds.cdid #        cds.year # artist.artistid #     cds.genreid #  tracks_2.title
---------------------------------------------------------------------------------------------------------------------------------------------------------------
               6 #           1978 #               3 #              e2 #               1 #            1981 #               1 #               1 #              m3
            NULL #           1977 #            NULL #            NULL #            NULL #            NULL #            NULL #            NULL #            NULL
               6 #           1978 #               3 #              e3 #               5 #            1977 #               1 #            NULL #            NULL
               6 #           1978 #               3 #              e1 #               1 #            1981 #               1 #               1 #              m1
               6 #           1978 #               3 #              e2 #               3 #            1978 #               1 #               1 #              e1
            NULL #           1981 #               1 #              m1 #            NULL #            NULL #            NULL #            NULL #            NULL
               6 #           1978 #               3 #              e2 #               1 #            1981 #               1 #               1 #              m1
               6 #           1978 #               3 #              e3 #               3 #            1978 #               1 #               1 #              e3
               6 #           1978 #               3 #              e3 #               2 #            1976 #               1 #            NULL #              o2
               6 #           1978 #               3 #              e2 #               6 #            1977 #               1 #            NULL #            NULL
            NULL #           1981 #               1 #              m3 #            NULL #            NULL #            NULL #            NULL #            NULL
               6 #           1978 #               3 #              e3 #               1 #            1981 #               1 #               1 #              m1
               6 #           1978 #               3 #              e1 #               2 #            1976 #               1 #            NULL #              o2
               6 #           1978 #               3 #              e3 #               1 #            1981 #               1 #               1 #              m3
               6 #           1978 #               3 #              e2 #               3 #            1978 #               1 #               1 #              e2
               6 #           1978 #               3 #              e2 #               4 #            1977 #               1 #            NULL #            NULL
               6 #           1978 #               3 #              e1 #               6 #            1977 #               1 #            NULL #            NULL
               6 #           1978 #               3 #              e2 #               5 #            1977 #               1 #            NULL #            NULL
               6 #           1978 #               3 #              e1 #               3 #            1978 #               1 #               1 #              e2
               6 #           1978 #               3 #              e1 #               3 #            1978 #               1 #               1 #              e1
            NULL #           1976 #               2 #              o1 #            NULL #            NULL #            NULL #            NULL #            NULL
            NULL #           1976 #               2 #              o2 #            NULL #            NULL #            NULL #            NULL #            NULL
               6 #           1978 #               3 #              e1 #               1 #            1981 #               1 #               1 #              m2
               6 #           1978 #               3 #              e1 #               5 #            1977 #               1 #            NULL #            NULL
               6 #           1978 #               3 #              e2 #               2 #            1976 #               1 #            NULL #              o1
               6 #           1978 #               3 #              e2 #               1 #            1981 #               1 #               1 #              m2
               6 #           1978 #               3 #              e1 #               1 #            1981 #               1 #               1 #              m4
               6 #           1978 #               3 #              e3 #               1 #            1981 #               1 #               1 #              m2
               6 #           1978 #               3 #              e2 #               2 #            1976 #               1 #            NULL #              o2
               6 #           1978 #               3 #              e3 #               3 #            1978 #               1 #               1 #              e1
               6 #           1978 #               3 #              e3 #               1 #            1981 #               1 #               1 #              m4
               6 #           1978 #               3 #              e1 #               3 #            1978 #               1 #               1 #              e3
            NULL #           1977 #            NULL #            NULL #            NULL #            NULL #            NULL #            NULL #            NULL
               6 #           1978 #               3 #              e1 #               1 #            1981 #               1 #               1 #              m3
               6 #           1978 #               3 #              e3 #               2 #            1976 #               1 #            NULL #              o1
               6 #           1978 #               3 #              e1 #               2 #            1976 #               1 #            NULL #              o1
               6 #           1978 #               3 #              e2 #               1 #            1981 #               1 #               1 #              m4
               6 #           1978 #               3 #              e3 #               3 #            1978 #               1 #               1 #              e2
            NULL #           1977 #            NULL #            NULL #            NULL #            NULL #            NULL #            NULL #            NULL
            NULL #           1981 #               1 #              m2 #            NULL #            NULL #            NULL #            NULL #            NULL
               6 #           1978 #               3 #              e3 #               6 #            1977 #               1 #            NULL #            NULL
               6 #           1978 #               3 #              e2 #               3 #            1978 #               1 #               1 #              e3
               6 #           1978 #               3 #              e3 #               4 #            1977 #               1 #            NULL #            NULL
               6 #           1978 #               3 #              e1 #               4 #            1977 #               1 #            NULL #            NULL
            NULL #           1981 #               1 #              m4 #            NULL #            NULL #            NULL #            NULL #            NULL
Massively optimize ->cursor->next while fixing some bugs along the way

Cursor access was previously wrapped in a dbh_do() block with the intent to
restart the connection and the cursor upon a handle error. However this
arrangement overlooks our inability to restart the cursor from the same
spot (or for that matter guarantee the same dataset). Instead we remove
the dbh_do wrap entirely, and just let the exception propagate to whatever
esle might be ready to catch it (and potentially properly retry the select).

As a side effect (because anonsubs are sloooooooow) the end result
yields astonishing speed gains - one of the test cases mentioned in [1]
went (on my test rig) from 9.61058 to 0.64960 due to this commit alone.

A particular detail - the cursor private methods _dbh_next/_dbh_all are no
more as they are unused indirection now. All storage drivers (well their
respective cursors) have been adjusted, but not yet tested due to lack of
a proper environment.

[1] http://lists.scsys.co.uk/pipermail/dbix-class/2012-July/010595.html
Switch the cursor iterator to pull data via bind_columns

While this does not help us irectly in any way (we still copy by value like
there is no tomorrow) - it will help with the software_limit fast-forwards
Remove ResultSourceHandle check in inflate_result

A isa() check is expensive, and it seems like the work in 4376a1574 made
it entirely superfluous
Move the infmap verification/exception way earlier

The thing deliberately is not a method on the source, because I am not
entirely sure where it belongs *YET*. Just knew it does not belong
in the (hopefully) extractable parser-gens.
Simplify collapse map contents, shuffle things around, rename most vars

There are almost no functional changes, just better organize what goes where
Yet another collapser oversight

One can't reuse collapsers across a left join
And another collapser issue

One can not infer definedness from the presence of a parent *unles* we have
a 'belongs_to'-like relationship to that parent
hohum