Ticket #793 (reopened Bug)

Opened 3 months ago

Last modified 4 weeks ago

ORM doesn't support integer values greater than PHP_INT_MAX

Reported by: Inquisitus Owned by: Shadowhand
Priority: major Milestone: 2.2.1
Component: Libraries:ORM Version: SVN HEAD
Keywords: orm unsigned database Cc:

Description

ORM::load_type neglects the value of $column['unsigned'], meaning that any unsigned integer greater than PHP_INT_MAX gets truncated.

Suggested fix involves testing for (float) value > PHP_INT_MAX and returning the value as a string if necessary.

Attachments

orm_unsigned.patch (0.8 kB) - added by Inquisitus 3 months ago.

Change History

Changed 3 months ago by Inquisitus

Changed 2 months ago by Shadowhand

  • status changed from new to closed
  • resolution set to fixed

Fixed in r3429, merged in r3430.

Changed 4 weeks ago by justo

should it matter if the bigint column is signed or unsigned? it looks like even if a bigint signed column's value exceeds PHP_INT_MAX it will be truncated...

Changed 4 weeks ago by justo

  • priority changed from minor to major
  • status changed from closed to reopened
  • resolution deleted
  • summary changed from ORM doesn't support unsigned values to ORM doesn't support integer values greater than PHP_INT_MAX

a big 'roger' -- using orm to insert the value 30604393357 into a mysql (signed) bigint column with this page causes the truncation (to 539622285), but removing the "$columnunsigned?" check does allows it to persist without truncation. reopening, fixing summary, upping to major.

Note: See TracTickets for help on using tickets.