[catalog_manager] KUDU-2671 fix bug in CreatePartitionsForRange()

This patch fixes a bug in PartitionSchema::CreatePartitionsForRange().
The manifestation of the bug was the inability to add an unbounded range
with custom hash schema (e.g. [0, +inf)) by AlterTable due to a conflict
with already existing range (e.g., [-inf, 0)) when if fact there was no
conflict at all.  The root cause was the assumption that PartitionSchema
contained information on the range to be added in its internal map
'hash_schema_idx_by_encoded_range_start_' but that wasn't the case,
so GetHashSchemaForRange() would return the table-wide hash schema for
the new range being added instead of proper range-specific hash schema.
That lead to incorrect updating of range boundaries in
UpdatePartitionBoundaries(), producing wrong results.

This patch also contains a new test scenario that allowed to reproduce
the issue: the new scenario is failing without the fix applied.

Change-Id: I33a2bdea2e71bf4b567664c0166e9fbc07c4b882
Reviewed-on: http://gerrit.cloudera.org:8080/18793
Tested-by: Kudu Jenkins
Reviewed-by: Mahesh Reddy <mreddy@cloudera.com>
Reviewed-by: Abhishek Chennaka <achennaka@cloudera.com>
Reviewed-by: Attila Bukor <abukor@apache.org>
3 files changed