big unsignedInts doesn't work on 32bit

Bug #1075106 reported by David Graf
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Zorba
Fix Released
Undecided
Paul J. Lucas

Bug Description

On a 32Bit machine, the handling of big unsinged ints is broken. Because on 32Bit, max unsigned int is bigger then max long. It doesn't matter if Zorba is compile with bugnum support or not.

Example query:
xs:decimal(xs:unsignedInt(4294967295))

Result without bignum support:
./bin/zorba -q test.xq -f
<?xml version="1.0" encoding="UTF-8"?>
18446744073709551615

Result with bignum support:
./bin/zorba -q test.xq -f
<?xml version="1.0" encoding="UTF-8"?>
-1

I know why it doesn't work with bignum support. Because when constructing the MAPM nummer in the background, the constructor MAPM(long l) is used. This cannot work because max is smaller then max unsigned int. I guess the issue can be fixed by treating unsigned ints similar to unsigned longs.

Why the first example doesn't work, I don't know. But I guess it's something similar.

Related branches

Revision history for this message
Paul J. Lucas (paul-lucas) wrote :

Is there some 32bit machine I can ssh into?

Changed in zorba:
status: New → In Progress
Changed in zorba:
status: In Progress → Fix Committed
Changed in zorba:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.