100 check-ins occurring around 2982725e12715fba.

Remove one unreachable branch and add asserts() to dupedExprStructSize().
New asserts verify that removed branch is unused and that constants that are
ORed together in the output do not overlap.
(check-in: 86ad358b user: drh tags: trunk)

Adjust the query planner to take into account WHERE clause terms that do not
drive indices. Add the unlikely() and likelihood() functions used to give
hints to the query planner about the selectivity of WHERE clause terms.
(check-in: bc446449 user: drh tags: trunk)

For error log messages generated by the Win32 native allocator, make sure the correct format specifier is used for the value returned by GetLastError().
(check-in: 75a8a8c1 user: mistachkin tags: trunk)

Deterministically initialize the PRNG used as a tie-breaker in the ANALYZE
command, so that the analysis is always the same given the same database.
This simplifies testing.
(check-in: 48ed8b56 user: drh tags: trunk)

Make sure that the transitive constraint optimization does not cause
WHERE clause terms to be disabled prematurely. We are unable to find a test
case that fails because of this, but it seems prudent to make this
preventative change nevertheless.
(check-in: d6e361d7 user: drh tags: trunk)

Continuing refinements of the logic to take WHERE clause terms not used for
indexing into account when computing the number of output rows from each
table.
(check-in: b65dc534 user: drh tags: unlikely-func)

When preparing an UPDATE statement, avoid generating VDBE code for those foreign key related actions and constraint checks that may be seen to be unnecessary by considering the subset of table columns potentially modified by the UPDATE.
(check-in: e940b5de user: dan tags: trunk)

Make sure the omit-noop-left-join optimization is not applied if columns
of the LEFT JOIN are used in the ORDER BY clause.
Ticket [be84e357c035]. Increase version number to 3.8.0.2.
(check-in: cce54186 user: drh tags: branch-3.8.0)

Fix a problem with using stat4 data to estimate the number of rows scanned by a range constraint on the second or subsequent column of any index where an affinity transformation must be applied to the constraint argument.
(check-in: c21f58d8 user: dan tags: trunk)

Revise the amalgamation tool to allow 'duplicate' include files to be retained manually while still preserving the existing line numbers.
(Closed-Leaf
check-in: aa482846 user: mistachkin tags: cygwinTempPath)

Fix a problem causing SQLite not to use stat4 or stat3 data to analyze constraints of the form "column = expr COLLATE collation" (those with an explicit COLLATE on the non-column side of the comparison operator).
(check-in: 1e86d81d user: dan tags: trunk)

If the cost of two whereLoop objects is the same in every way except that
one has fewer expected output rows than the other, then choose the one with
fewer output rows.
(check-in: 79e458ef user: drh tags: trunk)

Improvements to the robust_open() logic in the unix VFS so that if an attempt
is made to open a repository on file descriptors 0, 1, or 2, and blocking
that file descriptor by opening it on /dev/null fails, then the open will
fail.
(check-in: d9c018f8 user: drh tags: trunk)

Make the unix VFS defensive against the error of having a database file open
on file descriptors 1 or 2, as an error message might easily be written onto
those file descriptors and thus overwrite and corrupt the database.
(check-in: 30d38cc4 user: drh tags: trunk)

Fix an off-by-one error that causes a quoted empty string at the end of
a CRNL-terminated line of CSV input to be misread by the shell.
Cherrypick of [b5617e4fdadc4c].
(check-in: 43aa7d23 user: drh tags: branch-3.8.0)

In the query optimizer, when converting BETWEEN and LIKE/GLOB expressions
into simpler forms for processing, be sure to transfer the LEFT JOIN markings.
Fix for ticket [bc878246eafe0f52c]. Cherrypick of [caab361ebe].
(check-in: cb667449 user: drh tags: branch-3.8.0)

In the query optimizer, when converting BETWEEN and LIKE/GLOB expressions
into simpler forms for processing, be sure to transfer the LEFT JOIN markings.
Fix for ticket [bc878246eafe0f52c].
(check-in: caab361e user: drh tags: trunk)