dynamobi/dynamobi — Issue #557: [FRG-315] FLOAT is treated as a synonym for DOUBLE
Author: dynamobi-build
Created: 2011-12-30 03:35:12+00:00
State: open
Labels: DDL, FRG

[reporter="jroy", created="Thu, 27 Mar 2008 12:19:32 -0500 (GMT-05:00)"]
FLOAT is treated as a synonym for DOUBLE

See comments below and note that FLOAT(n) not implemented is being tracked as a seperate issue.

---------------------

Julian Hyde wrote:

>> John Roy wrote:

>>

>> when I try

>>

>> CREATE TABLE foo(goo FLOAT(4,2));

>>

>> I get an error that type DOUBLE doesn't allow a

>> precision specification.

>>

>> ... should float allow precision specification?

>> ... we are obviously using FLOAT as synonym for DOUBLE

>> - problem?

>

> (Forwarding to farrago-dev.)

>

> According to the SQL:2003 spec, the FLOAT datatype accepts an

optional

> precision. So FLOAT and FLOAT(4) are valid, FLOAT() and FLOAT(4,2)

are not.

>

> Farrago doesn't claim to support FLOAT (see

> http://farrago.sourceforge.net/status.html).

>

> However if you use FLOAT, farrago seems to treat it as a synonym for

DOUBLE,

> as you noted. Please log a bug on http://issues.eigenbase.org if

there is

> not one already.

Here are some notes for logging the bug.

The current behavior of treating it as equivalent to DOUBLE (at an

implementation level) when no precision is specified is actually OK

(SQL:2003 Part 2 Section 6.1):

11) If a is omitted, then an implementation-defined

is implicit.

24) FLOAT specifies the data type approximate numeric, with binary

precision equal to or greater than the value of the specified

. The maximum value of is

implementation-defined.

shall not be greater than this value.

So one thing that's missing is automatically making the implementation

choice between single-precision and double-precision in the case when a

precision is specified (assuming we stick with those as the

implementation options).

But I say "at an implementation level" above since the type descriptor

in the catalog should say FLOAT with a specific precision (i.e. it's

not

just a synonym for REAL or DOUBLE).

JVS