[
https://issues.apache.org/jira/browse/DERBY-4187?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12704852#action_12704852
]
Bryan Pendleton commented on DERBY-4187:
----------------------------------------
Hi Eranda, thanks for the updated test.
Here's the section of section of altertable.out where the conversion program
was having
problems, because it doesn't know how to convert the "describe" and "show
indexes"
statements.
In this code, I think that the "describe" and "show indexes" statements were
present only
in order to show that the view and the index were not changed by the statements
which
tried to rename the column in the view or the index.
I think that we can just remove these unconverted sections; it is sufficient
just to test
for the syntax error on the RENAME statements which reference the view and the
index.
ij> rename column renc_vw_1.v2 to v3;
ERROR 42Y62: 'RENAME COLUMN' is not allowed on '"APP"."RENC_VW_1"' because it
is a view.
ij> describe renc_vw_1;
COLUMN_NAME |TYPE_NAME|DEC&|NUM&|COLUM&|COLUMN_DEF|CHAR_OCTE&|IS_NULL&
------------------------------------------------------------------------------
V1 |VARCHAR |NULL|NULL|10 |NULL |20 |YES
V2 |DOUBLE |NULL|2 |52 |NULL |NULL |YES
ij> -- attempt to rename a column in an index, should fail:
create index renc_idx_1 on renc_1 (c, d);
0 rows inserted/updated/deleted
ij> show indexes from renc_1;
TABLE_NAME |COLUMN_NAME |NON_U&|TYPE|ASC&|CARDINA&|PAGES
----------------------------------------------------------------------------
RENC_1 |C |true |3 |A |NULL |NULL
RENC_1 |D |true |3 |A |NULL |NULL
ij> rename column renc_idx_1.d to d_new;
ERROR 42Y55: 'RENAME COLUMN' cannot be performed on 'RENC_IDX_1' because it
does not exist.
ij> show indexes from renc_1;
TABLE_NAME |COLUMN_NAME |NON_U&|TYPE|ASC&|CARDINA&|PAGES
----------------------------------------------------------------------------
RENC_1 |C |true |3 |A |NULL |NULL
RENC_1 |D |true |3 |A |NULL |NULL
> Convert altertable.sql to JUnit
> -------------------------------
>
> Key: DERBY-4187
> URL: https://issues.apache.org/jira/browse/DERBY-4187
> Project: Derby
> Issue Type: Test
> Components: Test
> Affects Versions: 10.4.2.1
> Reporter: Eranda Sooriyabandara
> Priority: Minor
> Fix For: 10.5.1.2
>
> Attachments: AlterTable.diff, AlterTable.java, AlterTableTest.diff,
> AlterTableTest.diff
>
> Original Estimate: 486.08h
> Remaining Estimate: 486.08h
>
> Converting altertable.sql harness test to JUnit
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.