[ 
https://issues.apache.org/jira/browse/DERBY-6956?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Rick Hillegas updated DERBY-6956:
---------------------------------
    Attachment: derby-6956-01-aa-removeSpuriousCheck.diff

Attaching derby-6956-01-aa-removeSpuriousCheck.diff. This patch removes the 
offending extra check for maximum width. Tests passed cleanly against this 
patch.

Thanks for digging into the code, Bryan. I think that the extra check is just a 
mistake. The datatype rejected by CREATE TABLE AS SELECT is exactly the same 
datatype which was used by CREATE TABLE. The remaining checks for DECIMAL look 
adequate to me.

I am inclined to commit this patch.


> Create table as Select cannot copy Decimal columns
> --------------------------------------------------
>
>                 Key: DERBY-6956
>                 URL: https://issues.apache.org/jira/browse/DERBY-6956
>             Project: Derby
>          Issue Type: Bug
>          Components: JDBC, SQL
>    Affects Versions: 10.13.1.1
>         Environment: Windows 7, DataGrip
>            Reporter: Murat Cengiz
>              Labels: newbie
>         Attachments: derby-6956-01-aa-removeSpuriousCheck.diff
>
>
> I create a test table with the following query:
> CREATE TABLE "DERBYTEST" ("STRINGCOLUMN" varchar(255), "INTEGERCOLUMN" 
> integer, "SHORTCOLUMN" varchar(255), "LONGCOLUMN" bigint, "DOUBLECOLUMN" 
> double, "FLOATCOLUMN" double, "DECIMALCOLUMN" decimal(31, 6), "BOOLEANCOLUMN" 
> smallint, "DATECOLUMN" timestamp, "DATETIMECOLUMN" timestamp, "ID" integer, 
> "LASTMODTIME" timestamp, PRIMARY KEY ("ID"))
> this query completes successfully
> I later try to copy the table with the following query:
> CREATE TABLE "DERBYTEST_TEMP" AS SELECT * FROM DERBYTEST WITH NO DATA
> This throws the following exception:
> [42X71][30000] Invalid data type 'DECIMAL(31, 6)' for column 'DECIMALCOLUMN'
> Everything works perfectly fine if I remove the decimal column.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to