Uploaded image for project: 'PuppetDB'
  1. PuppetDB
  2. PDB-4269

Integer comparisons in PQL can overflow the Java int type

    XMLWordPrintable

    Details

    • Template:
    • Team:
      PuppetDB
    • Zendesk Ticket IDs:
      33825
    • Zendesk Ticket Count:
      1
    • Release Notes:
      Bug Fix
    • Release Notes Summary:
      Hide
      Integers in PQL queries can now range from -9223372036854775808 to 9223372036854775807 (64-bit), matching the Puppet language. Previously they were unintentionally limited to
      range from -2147483648 to 2147483647 (32-bit).

      https://puppet.com/docs/puppet/6.17/lang_data_number.html#lang_data_number_integer_type
      Show
      Integers in PQL queries can now range from -9223372036854775808 to 9223372036854775807 (64-bit), matching the Puppet language. Previously they were unintentionally limited to range from -2147483648 to 2147483647 (32-bit). https://puppet.com/docs/puppet/6.17/lang_data_number.html#lang_data_number_integer_type

      Description

      In the entity part of a PQL query, it is possible to use a value that overflows an unsigned Java int, specifically 2,147,483,647.  For example:

       

      puppet query 'fact_contents[] {path ~> ["mountpoints", "/", "available_bytes"] and value < 2147483648}'
      Error response 400 Bad Request from server: For input string: "2147483648"
      

       

      Turning on debug level logging will reveal an exception in puppetdb.log

      java.lang.NumberFormatException: For input string: "2147483648"

       

        Attachments

          Activity

            People

            Assignee:
            rob.browning Rob Browning
            Reporter:
            adrian.parreiras-horta Adrian Parreiras Horta
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Zendesk Support