You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@openjpa.apache.org by C N Davies <cn...@cndavies.com> on 2009/08/03 21:29:05 UTC

MySQL ignoring BigDecimal precision.

I'm using MySQL and I find that when Open JPA generates the tables it
defaults any BigDecimal columns to Decimal(10,0) ignoring my annotation that
says I want 10,6.  I'm using:

 

                @Column(name="chargerate", precision=10,scale=6,
nullable=false)

 

The manual says there is an issue with Floats and Doubles but doesn't
mention BigDecimals:

 

"Floats and doubles may lose precision when stored in some datastores."

 

I'm using InnoDB tables on MySQL 5.1.32

 

Thanks 

 

Chris

 

 


RE: MySQL ignoring BigDecimal precision.

Posted by C N Davies <cn...@cndavies.com>.
Here it is:

OPENJPA-1224



-----Original Message-----
From: David Beer [mailto:david.m.beer@googlemail.com] 
Sent: Tuesday, 4 August 2009 6:34 AM
To: users@openjpa.apache.org
Subject: Re: MySQL ignoring BigDecimal precision.

Hi

Can you post JRIRA Number once submitted please.

Thanks

David

On Mon, 3 Aug 2009
13:11:24 -0700 (PDT) ljnelson <lj...@gmail.com> wrote:

> 
> For what it's worth this is also reproducible on the H2 platform.
> 
> On Mon, Aug 3, 2009 at 4:10 PM, crispyoz (via Nabble) <
>
ml-user+243560-833017765@n2.nabble.com<ml-user%2B243560-833017765@n2.nabble.
com>
> > wrote:
> 
> > OK sure will do
> >
> > -----Original Message-----
> > From: [hidden
> >
email]<http://n2.nabble.com/user/SendEmail.jtp?type=node&node=3380141&i=0>[m
ailto:[hidden
> >
email]<http://n2.nabble.com/user/SendEmail.jtp?type=node&node=3380141&i=1>]
> >
> > Sent: Tuesday, 4 August 2009 6:02 AM
> > To: [hidden
> >
email]<http://n2.nabble.com/user/SendEmail.jtp?type=node&node=3380141&i=2>
> > Subject: Re: MySQL ignoring BigDecimal precision.
> >
> > Hi Chris,
> >
> > Can you please file a JIRA with a reproducible test case?
> >
> > Thanks,
> >
> > Craig
> >
> > On Aug 3, 2009, at 12:29 PM, C N Davies wrote:
> >
> > > I'm using MySQL and I find that when Open JPA generates the
> > > tables it defaults any BigDecimal columns to Decimal(10,0)
> > > ignoring my annotation that
> > > says I want 10,6.  I'm using:
> > >
> > >
> > >
> > >                @Column(name="chargerate", precision=10,scale=6,
> > > nullable=false)
> > >
> > >
> > >
> > > The manual says there is an issue with Floats and Doubles but
> > > doesn't mention BigDecimals:
> > >
> > >
> > >
> > > "Floats and doubles may lose precision when stored in some
> > > datastores."
> > >
> > >
> > >
> > > I'm using InnoDB tables on MySQL 5.1.32
> > >
> > >
> > >
> > > Thanks
> > >
> > >
> > >
> > > Chris
> > >
> > >
> > >
> > >
> > >
> >
> > Craig L Russell
> > Architect, Sun Java Enterprise System http://db.apache.org/jdo
> > 408 276-5638 mailto:[hidden
> >
email]<http://n2.nabble.com/user/SendEmail.jtp?type=node&node=3380141&i=3>
> > P.S. A good JDO? O, Gasp!
> >
> >
> >
> >
> > ------------------------------
> >  View message @
> >
http://n2.nabble.com/MySQL-ignoring-BigDecimal-precision.-tp3379935p3380141.
html
> > To start a new topic under OpenJPA Users, email
> >
ml-node+208411-553807638@n2.nabble.com<ml-node%2B208411-553807638@n2.nabble.
com>
> > To unsubscribe from OpenJPA Users, click here< (link removed) =>.
> >
> >
> >
> 



-- 
Best Regards

David Beer

http://www.thebeerfamily.com


Re: MySQL ignoring BigDecimal precision.

Posted by David Beer <da...@googlemail.com>.
Hi

Can you post JRIRA Number once submitted please.

Thanks

David

On Mon, 3 Aug 2009
13:11:24 -0700 (PDT) ljnelson <lj...@gmail.com> wrote:

> 
> For what it's worth this is also reproducible on the H2 platform.
> 
> On Mon, Aug 3, 2009 at 4:10 PM, crispyoz (via Nabble) <
> ml-user+243560-833017765@n2.nabble.com<ml...@n2.nabble.com>
> > wrote:
> 
> > OK sure will do
> >
> > -----Original Message-----
> > From: [hidden
> > email]<http://n2.nabble.com/user/SendEmail.jtp?type=node&node=3380141&i=0>[mailto:[hidden
> > email]<http://n2.nabble.com/user/SendEmail.jtp?type=node&node=3380141&i=1>]
> >
> > Sent: Tuesday, 4 August 2009 6:02 AM
> > To: [hidden
> > email]<http://n2.nabble.com/user/SendEmail.jtp?type=node&node=3380141&i=2>
> > Subject: Re: MySQL ignoring BigDecimal precision.
> >
> > Hi Chris,
> >
> > Can you please file a JIRA with a reproducible test case?
> >
> > Thanks,
> >
> > Craig
> >
> > On Aug 3, 2009, at 12:29 PM, C N Davies wrote:
> >
> > > I'm using MySQL and I find that when Open JPA generates the
> > > tables it defaults any BigDecimal columns to Decimal(10,0)
> > > ignoring my annotation that
> > > says I want 10,6.  I'm using:
> > >
> > >
> > >
> > >                @Column(name="chargerate", precision=10,scale=6,
> > > nullable=false)
> > >
> > >
> > >
> > > The manual says there is an issue with Floats and Doubles but
> > > doesn't mention BigDecimals:
> > >
> > >
> > >
> > > "Floats and doubles may lose precision when stored in some
> > > datastores."
> > >
> > >
> > >
> > > I'm using InnoDB tables on MySQL 5.1.32
> > >
> > >
> > >
> > > Thanks
> > >
> > >
> > >
> > > Chris
> > >
> > >
> > >
> > >
> > >
> >
> > Craig L Russell
> > Architect, Sun Java Enterprise System http://db.apache.org/jdo
> > 408 276-5638 mailto:[hidden
> > email]<http://n2.nabble.com/user/SendEmail.jtp?type=node&node=3380141&i=3>
> > P.S. A good JDO? O, Gasp!
> >
> >
> >
> >
> > ------------------------------
> >  View message @
> > http://n2.nabble.com/MySQL-ignoring-BigDecimal-precision.-tp3379935p3380141.html
> > To start a new topic under OpenJPA Users, email
> > ml-node+208411-553807638@n2.nabble.com<ml...@n2.nabble.com>
> > To unsubscribe from OpenJPA Users, click here< (link removed) =>.
> >
> >
> >
> 



-- 
Best Regards

David Beer

http://www.thebeerfamily.com

Re: MySQL ignoring BigDecimal precision.

Posted by ljnelson <lj...@gmail.com>.
For what it's worth this is also reproducible on the H2 platform.

On Mon, Aug 3, 2009 at 4:10 PM, crispyoz (via Nabble) <
ml-user+243560-833017765@n2.nabble.com<ml...@n2.nabble.com>
> wrote:

> OK sure will do
>
> -----Original Message-----
> From: [hidden email]<http://n2.nabble.com/user/SendEmail.jtp?type=node&node=3380141&i=0>[mailto:[hidden
> email]<http://n2.nabble.com/user/SendEmail.jtp?type=node&node=3380141&i=1>]
>
> Sent: Tuesday, 4 August 2009 6:02 AM
> To: [hidden email]<http://n2.nabble.com/user/SendEmail.jtp?type=node&node=3380141&i=2>
> Subject: Re: MySQL ignoring BigDecimal precision.
>
> Hi Chris,
>
> Can you please file a JIRA with a reproducible test case?
>
> Thanks,
>
> Craig
>
> On Aug 3, 2009, at 12:29 PM, C N Davies wrote:
>
> > I'm using MySQL and I find that when Open JPA generates the tables it
> > defaults any BigDecimal columns to Decimal(10,0) ignoring my
> > annotation that
> > says I want 10,6.  I'm using:
> >
> >
> >
> >                @Column(name="chargerate", precision=10,scale=6,
> > nullable=false)
> >
> >
> >
> > The manual says there is an issue with Floats and Doubles but doesn't
> > mention BigDecimals:
> >
> >
> >
> > "Floats and doubles may lose precision when stored in some
> > datastores."
> >
> >
> >
> > I'm using InnoDB tables on MySQL 5.1.32
> >
> >
> >
> > Thanks
> >
> >
> >
> > Chris
> >
> >
> >
> >
> >
>
> Craig L Russell
> Architect, Sun Java Enterprise System http://db.apache.org/jdo
> 408 276-5638 mailto:[hidden email]<http://n2.nabble.com/user/SendEmail.jtp?type=node&node=3380141&i=3>
> P.S. A good JDO? O, Gasp!
>
>
>
>
> ------------------------------
>  View message @
> http://n2.nabble.com/MySQL-ignoring-BigDecimal-precision.-tp3379935p3380141.html
> To start a new topic under OpenJPA Users, email
> ml-node+208411-553807638@n2.nabble.com<ml...@n2.nabble.com>
> To unsubscribe from OpenJPA Users, click here< (link removed) =>.
>
>
>

-- 
View this message in context: http://n2.nabble.com/MySQL-ignoring-BigDecimal-precision.-tp3379935p3380149.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.

RE: MySQL ignoring BigDecimal precision.

Posted by C N Davies <cn...@cndavies.com>.
OK sure will do

-----Original Message-----
From: Craig.Russell@Sun.COM [mailto:Craig.Russell@Sun.COM] 
Sent: Tuesday, 4 August 2009 6:02 AM
To: users@openjpa.apache.org
Subject: Re: MySQL ignoring BigDecimal precision.

Hi Chris,

Can you please file a JIRA with a reproducible test case?

Thanks,

Craig

On Aug 3, 2009, at 12:29 PM, C N Davies wrote:

> I'm using MySQL and I find that when Open JPA generates the tables it
> defaults any BigDecimal columns to Decimal(10,0) ignoring my  
> annotation that
> says I want 10,6.  I'm using:
>
>
>
>                @Column(name="chargerate", precision=10,scale=6,
> nullable=false)
>
>
>
> The manual says there is an issue with Floats and Doubles but doesn't
> mention BigDecimals:
>
>
>
> "Floats and doubles may lose precision when stored in some  
> datastores."
>
>
>
> I'm using InnoDB tables on MySQL 5.1.32
>
>
>
> Thanks
>
>
>
> Chris
>
>
>
>
>

Craig L Russell
Architect, Sun Java Enterprise System http://db.apache.org/jdo
408 276-5638 mailto:Craig.Russell@sun.com
P.S. A good JDO? O, Gasp!



Re: MySQL ignoring BigDecimal precision.

Posted by Craig L Russell <Cr...@Sun.COM>.
Hi Chris,

Can you please file a JIRA with a reproducible test case?

Thanks,

Craig

On Aug 3, 2009, at 12:29 PM, C N Davies wrote:

> I'm using MySQL and I find that when Open JPA generates the tables it
> defaults any BigDecimal columns to Decimal(10,0) ignoring my  
> annotation that
> says I want 10,6.  I'm using:
>
>
>
>                @Column(name="chargerate", precision=10,scale=6,
> nullable=false)
>
>
>
> The manual says there is an issue with Floats and Doubles but doesn't
> mention BigDecimals:
>
>
>
> "Floats and doubles may lose precision when stored in some  
> datastores."
>
>
>
> I'm using InnoDB tables on MySQL 5.1.32
>
>
>
> Thanks
>
>
>
> Chris
>
>
>
>
>

Craig L Russell
Architect, Sun Java Enterprise System http://db.apache.org/jdo
408 276-5638 mailto:Craig.Russell@sun.com
P.S. A good JDO? O, Gasp!