#95 ✓resolved
Adam French

bug: integer column coming back wildly inaccurate

Reported by Adam French | December 14th, 2007 @ 12:12 AM


'DataMapper::Adapters::Sql::Commands::LoadCommand should retrieve altered integer columns correctly' FAILED

expected: 6471561394,

got: -2118373198 (using ==)


this is using the sqlite3 adapter.

Comments and changes to this ticket

  • Bjørn Arild Mæland

    Bjørn Arild Mæland December 14th, 2007 @ 02:51 AM

    • Milestone cleared.
    • State changed from “new” to “open”

    That integer is out of range (one too many digits). We can't initialize that huge digits by default. There must be an option to specify integer size, tho.

  • Sam Smoot

    Sam Smoot December 14th, 2007 @ 01:05 PM

    Yes... Coersion's type_cast_integer just needs to rescue for BigNums.

  • Sam Smoot

    Sam Smoot December 27th, 2007 @ 10:20 AM

    • Milestone cleared.

    I'll work on this today. Should be simple. (Hopefully ;-) )

  • Nick Plante

    Nick Plante December 27th, 2007 @ 07:37 PM

    • State changed from “open” to “invalid”

    Maybe this was fixed as a result of some other change, but the expected thing seems to be happening now (the value, exceeding an int(11) or whatever, is stored as the max representable value)

  • Nick Plante

    Nick Plante December 28th, 2007 @ 09:41 AM

    • State changed from “invalid” to “open”

    scratch that, my bad, i see this. will dig into it.

  • Nick Plante

    Nick Plante December 28th, 2007 @ 10:29 AM

    in talking with sam about this, sounds like we should add a validation error if the number is larger than the largest representable number (have to get this value from the underlying schema rep)...

  • Sam Smoot

    Sam Smoot December 28th, 2007 @ 10:01 PM

    • State changed from “open” to “resolved”

    So basically we do what AR does currently.

    Further work will be done at a later point once we auto-generate simple inferred validations from property declarations.

    But that should be a separate ticket. For now, unless I misunderstand the situation, we're in the same boat as AR. And parity seems a good place to close this one out.

    Feel free to open another ticket for the auto-validations...

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

People watching this ticket