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

Alexander Belyak updated IGNITE-20760:
--------------------------------------
    Description: 
If there are some index, preventing column to be dropped, then error message 
contains all indexes with all columns with the same name. Even if there is 
completely different tables with the same named columns:
{code:java}
drop table tab1;

drop table tab2;

create table tab1(id integer not null primary key, f1 int);
create index tab1_f1 on tab1(f1);

create table tab2(id integer not null primary key, f1 int, f2 int);
create index tab2_f1 on tab2(f1);
create index tab2_f12 on tab2(f1,f2);

alter table tab2 drop column f1;

>> Fail with wrong error message: 
>> [Code: 0, SQL State: 50000]  Failed to validate query. Deleting column 'F1' 
>> used by index(es) [TAB1_F1, TAB2_F1, TAB2_F12], it is not allowed
>> Because it contains TAB1_F1 index

drop index tab2_f12;
drop index tab2_f1;

alter table tab2 drop column f1

>> Success, so the problem only on the error message generation. {code}
 

  was:
If there are some index, preventing column to be dropped, then error message 
contains all indexes with all columns with the same name. Even if there is 
completely different tables with the same named columns:
{code:java}
drop table tab1;
drop table tab2;
create table tab1(id integer not null primary key, f1 int);
create index tab1_f1 on tab1(f1);create table tab2(id integer not null primary 
key, f1 int, f2 int);
create index tab2_f1 on tab2(f1);
create index tab2_f12 on tab2(f1,f2);alter table tab2 drop column f1
>> Fail with wrong error message: 
>> [Code: 0, SQL State: 50000]  Failed to validate query. Deleting column 'F1' 
>> used by index(es) [TAB1_F1, TAB2_F1, TAB2_F12], it is not allowed
>> Because it contains TAB1_F1 indexdrop index tab2_f12;
drop index tab2_f1;alter table tab2 drop column f1
>> Success, so the problem only on the error message generation. {code}


> Drop column error message get indexes by column name only 
> ----------------------------------------------------------
>
>                 Key: IGNITE-20760
>                 URL: https://issues.apache.org/jira/browse/IGNITE-20760
>             Project: Ignite
>          Issue Type: Bug
>          Components: sql
>    Affects Versions: 3.0
>            Reporter: Alexander Belyak
>            Priority: Major
>
> If there are some index, preventing column to be dropped, then error message 
> contains all indexes with all columns with the same name. Even if there is 
> completely different tables with the same named columns:
> {code:java}
> drop table tab1;
> drop table tab2;
> create table tab1(id integer not null primary key, f1 int);
> create index tab1_f1 on tab1(f1);
> create table tab2(id integer not null primary key, f1 int, f2 int);
> create index tab2_f1 on tab2(f1);
> create index tab2_f12 on tab2(f1,f2);
> alter table tab2 drop column f1;
> >> Fail with wrong error message: 
> >> [Code: 0, SQL State: 50000]  Failed to validate query. Deleting column 
> >> 'F1' used by index(es) [TAB1_F1, TAB2_F1, TAB2_F12], it is not allowed
> >> Because it contains TAB1_F1 index
> drop index tab2_f12;
> drop index tab2_f1;
> alter table tab2 drop column f1
> >> Success, so the problem only on the error message generation. {code}
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to