List:General Discussion« Previous MessageNext Message »
From:Michael Widenius Date:November 11 1999 11:46am
Subject:Re: Problem with simple CREATE
View as plain text  
>>>>> "Bob" == Bob Kline <bkline@stripped> writes:

Bob> On Thu, 21 Oct 1999, David D.W. Downey wrote:
>> 
>> OK, Looks like I need to read more carefully. Thanks for the tip
>> off. In the same thread, why is it if I switch from using decimal to
>> float it works fine? Why do i NOT have to declare the decimals or
>> whole # space using float?
>> 

Bob> You shouldn't have to specify precision for FLOAT or DECIMAL, according
Bob> to the standard.  The fact that you have to specify it for DECIMAL in
Bob> MySQL is a bug (see my earlier response to you in this thread).  You
Bob> probably shouldn't use the version of FLOAT which specifies "precision"
Bob> in MySQL, because MySQL interprets FLOAT(8) differently than the
Bob> standard does (the standard says that FLOAT(p) specifies the precision
Bob> in bits, but MySQL interprets p as the number of bytes to be used for
Bob> the storage of the entire value).  You probably shouldn't switch between
Bob> FLOAT and DECIMAL without careful thought about the use to which the
Bob> column in question will be put.  There are significant tradeoffs to be
Bob> considered (e.g., accuracy, space usage).

Bob> I've submitted a patch for the entire section in the manual on numeric
Bob> types to correct some of the errors and gaps, but it won't be applied
Bob> until at least after Monty returns from vacation and has had a chance to
Bob> review (and amend) it.

Thanks Bob for pointing this out.  I just did the following change for 
the next mysqld version:

Changed DECIMAL(X) to be DECIMAL(X,0) and DECIMAL to be DECIMAL(10,0)

Regards,
Monty
Thread
Problem with simple CREATEDavid D.W. Downey21 Oct
  • Re: Problem with simple CREATEJay J21 Oct
  • Re: Problem with simple CREATEBob Kline21 Oct
Re: Problem with simple CREATEDavid D.W. Downey21 Oct
  • Re: Problem with simple CREATEBob Kline21 Oct
    • Re: Problem with simple CREATEMichael Widenius11 Nov
Re: Problem with simple CREATEDavid D.W. Downey21 Oct
  • Re: Problem with simple CREATEBob Kline21 Oct