Uploaded image for project: 'Lucene - Core'
  1. Lucene - Core
  2. LUCENE-7389

Validation issue in FieldType#setDimensions?

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: master (7.0), 6.2
    • Component/s: None
    • Labels:
      None
    • Lucene Fields:
      New

      Description

      It compares if the dimensionCount is larger than PointValues.MAX_NUM_BYTES while this constant should be compared to dimensionNumBytes instead?

      So this if statement:

      if (dimensionCount > PointValues.MAX_NUM_BYTES) {
            throw new IllegalArgumentException("dimensionNumBytes must be <= " + PointValues.MAX_NUM_BYTES + "; got " + dimensionNumBytes);
          }
      

      Should be:

      if (dimensionNumBytes > PointValues.MAX_NUM_BYTES) {
            throw new IllegalArgumentException("dimensionNumBytes must be <= " + PointValues.MAX_NUM_BYTES + "; got " + dimensionNumBytes);
          }
      
      1. LUCENE-7383.patch
        2 kB
        Martijn van Groningen

        Activity

        Hide
        mikemccand Michael McCandless added a comment -

        YES!

        Show
        mikemccand Michael McCandless added a comment - YES!
        Hide
        martijn.v.groningen Martijn van Groningen added a comment -

        Attached fix.

        Luckily this validation was also checked (correctly in FieldInfo.java line 178, so there shouldn't be indices with too large dimensions.

        Show
        martijn.v.groningen Martijn van Groningen added a comment - Attached fix. Luckily this validation was also checked (correctly in FieldInfo.java line 178, so there shouldn't be indices with too large dimensions.
        Hide
        mikemccand Michael McCandless added a comment -

        +1

        Maybe remove that addDocument call in the test case, since we now throw the exc (correctly!) on trying to create the point?

        Thanks Martijn van Groningen!

        Show
        mikemccand Michael McCandless added a comment - +1 Maybe remove that addDocument call in the test case, since we now throw the exc (correctly!) on trying to create the point? Thanks Martijn van Groningen !
        Hide
        jpountz Adrien Grand added a comment -

        +1!

        Show
        jpountz Adrien Grand added a comment - +1!
        Hide
        martijn.v.groningen Martijn van Groningen added a comment -

        Thanks Adrien and Mike!

        (accidentally used from issue number in commit message)
        Fixed in master: https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=9b85f68
        and branch_6x: https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=dc54f97

        Show
        martijn.v.groningen Martijn van Groningen added a comment - Thanks Adrien and Mike! (accidentally used from issue number in commit message) Fixed in master: https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=9b85f68 and branch_6x: https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=dc54f97
        Hide
        mikemccand Michael McCandless added a comment -

        Bulk close resolved issues after 6.2.0 release.

        Show
        mikemccand Michael McCandless added a comment - Bulk close resolved issues after 6.2.0 release.

          People

          • Assignee:
            Unassigned
            Reporter:
            martijn.v.groningen Martijn van Groningen
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development