This PR fixes two issues with creating secondary indexes for Doltgres types. The first deals with handlers, as we were not adding a nil handler for the additional hash type, which would cause a panic as the counts were not equal (all non-Extended types should have a matching nil handler).
The second issue was due to the reuse of an ExtendedTupleComparator. When creating a new ExtendedTupleComparator, we pass in the previous TupleTypeHandler to handle all non-Extended types. If the previous TupleTypeHandler was ExtendedTupleComparator and the new one was also ExtendedTupleComparator, then we could end up with a misinterpretation of data that could lead to incorrect results, as the handler assumed a different type than the actual type. This has been changed so that ExtendedTupleComparator will always use the inner comparator of a previous ExtendedTupleComparator. For now this will always be the default comparator, but if we ever add another one, then this should properly handle that change.
This PR fixes two issues with creating secondary indexes for Doltgres types. The first deals with handlers, as we were not adding a
nil
handler for the additional hash type, which would cause a panic as the counts were not equal (all non-Extended types should have a matching nil handler).The second issue was due to the reuse of an
ExtendedTupleComparator
. When creating a newExtendedTupleComparator
, we pass in the previousTupleTypeHandler
to handle all non-Extended types. If the previousTupleTypeHandler
wasExtendedTupleComparator
and the new one was alsoExtendedTupleComparator
, then we could end up with a misinterpretation of data that could lead to incorrect results, as the handler assumed a different type than the actual type. This has been changed so thatExtendedTupleComparator
will always use the inner comparator of a previousExtendedTupleComparator
. For now this will always be the default comparator, but if we ever add another one, then this should properly handle that change.