Uploaded image for project: 'Apache Drill'
  1. Apache Drill
  2. DRILL-6713

Infinite loop when retrieving decimal value with scale = -1

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.14.0
    • Fix Version/s: 1.15.0
    • Component/s: Client - C++
    • Labels:
      None

      Description

       

      The server returns scale value of -1 for this query

      select cast('999999999999999999' as decimal(18,0)) + cast('9999999999999999999999999999999999999' as decimal(38,0)) from (values(1))

       

      The getValueAt() function did not take into account of the possibility of -1 scale and will go into infinite loop of appending 0 to the string buffer.

      https://github.com/apache/drill/blob/1.14.0/contrib/native/client/src/include/drill/recordBatch.hpp#L752

       

      This can be reproduced query submitter.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                vvysotskyi Volodymyr Vysotskyi
                Reporter:
                robertw Rob Wu
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: