WL#7740: InnoDB GIS: Enhance Check Table for InnoDB Spatial index

Status: Complete

We currently just do minimum checks on InnoDB spatial indexes. There should be
more works related to the R-tree index when comes consistency check.

Here are some notable work items are following:

1. When check parent/child entry relations, the parent entry contains a MBR
(minimum bounding rectangle) that covers all entries in the child page. So it is
NOT the first entry of the child page. So the check should be on this MBR, to
see if covers all items in the child page, rather than assert it is identical to
the first entry of child.

2. There is no ordering relationship between rows in neighboring pages. So the
last entry of left page could be smaller than the right page first item.

3. There is no ordering relationship between rows in parent and child page
layout (how they are linked). So as you walk the entries in the parent pages,
the child page they pointed might not directly linked.

4. In the leaf level, it does not contain any data, but a MBR covers the data in
the primary index, plus the primary key. This needs to be checked. We also need
to check no 2 NON-DELETED index entries pointed to the same PK entry.

5. For checking index entry count, since the leaf level recs of spatial index
are not ordered, so, we can't do consistent read leaf level recs like btree,
because this consistent read need store/restore cursor based on the recs 
ordering.
We can use current rtree search mechanism to do the rtree scan. The plan is
build a search key which contains all mbrs in rtree, and do rtree search, then
we can get the rtree entry count.

6. For minimal rec flag REC_INFO_MIN_REC_FLAG, we still need to keep the current
check, that is  to check if it's be marked on the first rec of each non-leaf 
level. This is already be done in previous related Btree code.

7. And in this worklog, we also want to optimize the non-leaf level node store 
of R-tree. Currently, like B-tree, in non-leaf level, for each rec, we still 
store as this format:
key(which is MBR for R-tree) + PK(which is the PK from first rec of child 
page) + page_no.
But, actually, we don't need to store PK, since it's useless. For every search,
we only need MBR + page_no to find the right leaf page. So, if we removed the PK 
field from non-leaf page rec, we not only can save space, especially for 
variable length PK, we also don't need to handle the recursive modify the PK 
field.