Query dump with more than 30 columns error

Description

If query has more than 30 columns Lucee throws an error when dumping it:
The value [2147483648] is outside the range that can be represented as an int.

<cfscript> q = queryNew("") var numberOfColumns = 31 // 30 works OK, 31 throws error: The value [2147483648] is outside the range that can be represented as an int. for(i=1; i<=numberOfColumns; i++) { queryAddColumn(q, "c#i#", ["x"]) } dump(q) </cfscript>

Environment

None

Attachments

2
  • 15 Apr 2024, 02:44 pm
  • 15 Apr 2024, 07:41 am

Activity

Pothys - MitrahSoft 
16 April 2024 at 10:14

I've checked this issue with the latest Lucee version 6.0.2.8-SNAPSHOT. Now, when we dump a query with more than 30 columns, it doesn’t throw any errors and works fine.
Commit link(6.1) : https://github.com/lucee/Lucee/commit/81d245b94e8a711ba0da625a0e0a56342956278d

Michael Offner 
15 April 2024 at 14:44

fixed in Lucee 6.0.2.8

 

Michael Offner 
15 April 2024 at 08:24

you can simply reproduce the “issue“ with this:

bitAnd(2147483648,1);

Michael Offner 
15 April 2024 at 07:41

problem is this line (823) in Dump.cfc:

return bitand(arguments.meta.data.highlight, arguments.c)>0;

because we have recently changed the function BitAnd from this

public static double call(PageContext pc, double number, double number2) { return (int) number & (int) number2; }

to this

public static double call(PageContext pc, double number, double number2) throws ExpressionException { return Caster.toIntValueLossless(number) & Caster.toIntValueLossless(number2); }

the main difference here is that the new function no longer allow to convert a double to a number if the double is outside the range of an integer, what is the proper behaviour in my opinion.

Lucee 5 also fail with this, you see it in the color of the dump

Fixed

Details

Assignee

Reporter

Priority

Labels

Fix versions

New Issue warning screen

Before you create a new Issue, please post to the mailing list first https://dev.lucee.org

Once the issue has been verified, one of the Lucee team will ask you to file an issue

Affects versions

Created 10 April 2024 at 08:32
Updated 16 May 2024 at 08:15
Resolved 16 April 2024 at 10:14