Uploaded image for project: 'Phoenix'
  1. Phoenix
  2. PHOENIX-921

KeyValue check in MetaDataEndpointImpl#addColumnToTable is not sufficiency

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Not A Problem
    • Affects Version/s: 3.0.0
    • Fix Version/s: 3.0.0
    • Labels:
      None

      Description

      In my using.
      when I create a table with no Index.

      the method MetaDataEndpointImpl#addColumnToTable

      the code like:
      -------
      Integer maxLength = columnSizeKv == null ? null : PDataType.INTEGER.getCodec().decodeInt(columnSizeKv.getBuffer(), columnSizeKv.getValueOffset(), SortOrder.getDefault());
      -------

      didn't check the columnSizeKv length is 0. if 0, the decodeInt will throw exception.

      so I think it will be check like this:

      Integer maxLength = columnSizeKv == null || columnSizeKv .getValue().length == 0 ? null : PDataType.INTEGER.getCodec().decodeInt(columnSizeKv.getBuffer(), columnSizeKv.getValueOffset(), SortOrder.getDefault());

        Attachments

        1. PHOENIX-921.patch
          7 kB
          jay wong

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              jaywong jay wong
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: