[ 
https://issues.apache.org/jira/browse/DERBY-2605?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12495850
 ] 

James F. Adams commented on DERBY-2605:
---------------------------------------

A B,

I think I prefer your approach.  I am updating my patch.

I have however found a couple of interesting things with the 
precision/scale/maximum width check.

1) Given table foo (x double precision), the check fails for:  create table 
bar(y) as select 2.0 * x from foo with no data
     because dtd.getScale() returns 1 and typeId.getMaximumScale() returns 0.  
The datat ype of column y is double precision.

2) The check fails for:   create table bar as select javaclassname from 
sys.sysaliases with no data
    because dtd.getMaximumWidth() returns 2147483647 and 
typeId.getMaximumMaximumWidth() returns 32700.
    The data type of javaclassname is LONG VARCHAR.  I would expect the maximum 
length to be 32700.  Integer.MAX_VALUE is specified
    as the maximum length of this column in SYSALIASESRowFactory.java.  I do 
not know if this is a bug or was intentional but the resulting
    maximum length certainly exceeds the documented value for a LONG VARCHAR.

I am doing some more investigation.  I should be able to upload an updated 
patch in a couple of days.

> You can create BOOLEAN columns in 10.3
> --------------------------------------
>
>                 Key: DERBY-2605
>                 URL: https://issues.apache.org/jira/browse/DERBY-2605
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.3.0.0
>            Reporter: Rick Hillegas
>         Assigned To: James F. Adams
>         Attachments: d2605_inc_v1.patch, d2605_v1.patch, d2605_v1.stat
>
>
> The work on DERBY-64 seems to have opened up a wormhole by which you can 
> create user tables with BOOLEAN columns. The following script shows how to do 
> this:
> drop table foo;
> create table foo
> as select systemalias from sys.sysaliases with no data;
> rename column foo.systemalias to boolcol;
> alter table foo
>   alter column boolcol null;
> select c.columndatatype
> from sys.syscolumns c, sys.systables t
> where t.tableid=c.referenceid
> and t.tablename='FOO';
> insert into foo( boolcol )
> values
> ( 0 ),
> ( 1 ),
> ( cast (null as int) )
> ;
> select * from foo;

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to