diff --git a/src/puppetlabs/puppetdb/pql/transform.clj b/src/puppetlabs/puppetdb/pql/transform.clj index c8bd4901dd..b55a5122f8 100644 --- a/src/puppetlabs/puppetdb/pql/transform.clj +++ b/src/puppetlabs/puppetdb/pql/transform.clj @@ -91,10 +91,12 @@ :false false)) (defn transform-integer + ;; 64-bit + ;; https://puppet.com/docs/puppet/5.3/lang_data_number.html#the-integer-data-type ([int] - (Integer. int)) + (Long. int)) ([neg int] - (- (Integer. int)))) + (Long. (str neg int)))) (defn transform-real [& args] diff --git a/test/puppetlabs/puppetdb/pql_test.clj b/test/puppetlabs/puppetdb/pql_test.clj index 2098759fb2..d182303571 100644 --- a/test/puppetlabs/puppetdb/pql_test.clj +++ b/test/puppetlabs/puppetdb/pql_test.clj @@ -24,6 +24,9 @@ ["from" "nodes" ["and" ["=" "a" 1] ["=" "b" 2]]] + (format "nodes { a = %d and b = %d }" Long/MAX_VALUE Long/MIN_VALUE) + ["from" "nodes" + ["and" ["=" "a" Long/MAX_VALUE] ["=" "b" Long/MIN_VALUE]]] "fact_contents {path = [\"foo\",\"bar\"]}" ["from" "fact_contents"