
Float should not require scale
Reported by Mayo Jordanov | July 20th, 2008 @ 07:26 PM
Currently, DM requires all floating point numbers to specify scale, but scale should not be required for floating point numbers.
Generally, floating point numbers don't have scale, as the scale changes depending on the number. (eg. If precision is 15, scale will be (precision - integral). If precision = 4 and number is 1.123, scale is 3; if precision = 4 and number is 123.4, scale = 1). The SQL/ANSI 92 standard does not specify scale for floating point numbers either (for the above reason).
The scale parameter is however required, as MySQL allows scale to be specified on floating point numbers.
The attached patches should solve the issue. Modifies type map not to require scale, and modifies validations to be able to handle case where scale is not specified.
Dan, if you don't have time to push this in, let me know, I can always push, just want somebody to review this before committing. Doesn't seem to break any specs locally.
Thanks!
Comments and changes to this ticket
-
Mayo Jordanov July 20th, 2008 @ 07:27 PM
- no changes were found...
-
Dan Kubb (dkubb) July 20th, 2008 @ 11:17 PM
- State changed from new to open
Mayo, looks good to me. Feel free to push it.
After you apply these patches, make sure you install dm-core, and then run dm-more's rake ci:spec_all specs to make sure nothing was broken elsewhere by these changes. In general, everytime dm-core is modified, this should be done.
-
-
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.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »