When the estimated sorting cost overwhelms the estimated lookup cost, ensure
that lookup costs are still taken into account when selecting a lookup
algorithm.
Reworking the documentation on integer result codes.  This is a comment
and documentation change only.  There are no changes to code.
The SQLITE_IOERR_BLOCKED extended error code is not longer used, so remove
assert() statements and documentation for that error code.  Also make other
documentation improvements.
Because SQLite internally calculates query plan costs using a logarithmic scale, very large estimated sorting costs can cause all other estimated costs to be rounded down to zero. In these cases break ties between plans with the same total cost by comparing the costs with sorting excluded. This is an alternative fix for the same problem as addressed by [2af630c572].
Fix a buffer overrun in the previous commit.