Jira (PDB-4269) Integer comparisons in PQL can overflow the Java int type

0 views
Skip to first unread message

Adrian Parreiras Horta (JIRA)

unread,
Feb 19, 2019, 4:43:03 PM2/19/19
to puppe...@googlegroups.com
Adrian Parreiras Horta created an issue
 
PuppetDB / Bug PDB-4269
Integer comparisons in PQL can overflow the Java int type
Issue Type: Bug Bug
Assignee: Unassigned
Created: 2019/02/19 1:42 PM
Labels: maintenance
Priority: Normal Normal
Reporter: Adrian Parreiras Horta

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"

 

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v7.7.1#77002-sha1:e75ca93)
Atlassian logo

Robert Roland (JIRA)

unread,
Feb 19, 2019, 4:48:03 PM2/19/19
to puppe...@googlegroups.com
Robert Roland commented on Bug PDB-4269
 
Re: Integer comparisons in PQL can overflow the Java int type

The bug is in transform.clj - should be using Long. instead of Integer. in transform-integer function. Puppet docs say the Integer datatype holds 64-bit integers: https://puppet.com/docs/puppet/5.3/lang_data_number.html#the-integer-data-type

Austin Boyd (JIRA)

unread,
Dec 5, 2019, 11:32:05 AM12/5/19
to puppe...@googlegroups.com
Austin Boyd updated an issue
 
Change By: Austin Boyd
Zendesk Ticket IDs: 33825
Zendesk Ticket Count: 1

Rob Browning (Jira)

unread,
Aug 5, 2020, 12:28:03 PM8/5/20
to puppe...@googlegroups.com
Rob Browning assigned an issue to Rob Browning
Change By: Rob Browning
Assignee: Rob Browning
This message was sent by Atlassian Jira (v8.5.2#805002-sha1:a66f935)
Atlassian logo

Rob Browning (Jira)

unread,
Aug 10, 2020, 12:13:03 PM8/10/20
to puppe...@googlegroups.com
Rob Browning updated an issue
Change By: Rob Browning
Release Notes: Bug Fix
Release Notes Summary: 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

Rob Browning (Jira)

unread,
Aug 10, 2020, 12:14:03 PM8/10/20
to puppe...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages