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

Pavel Pereslegin resolved IGNITE-19456.
---------------------------------------
    Resolution: Cannot Reproduce

After IGNITE-19305 we cannot drop column, that is used by index.

Currently when we dropping a column
{code:sql}
ALTER TABLE index_test_table_5 DROP COLUMN field_5
{code}

 we have the following expected exception:
{noformat}
Can`t delete column(s). Column FIELD_5 is used by indexes [INDEX_TEST_INDEX_5_1]
{noformat}





> Dropping one column of the composite index makes impossible queries to other 
> columns in the index
> -------------------------------------------------------------------------------------------------
>
>                 Key: IGNITE-19456
>                 URL: https://issues.apache.org/jira/browse/IGNITE-19456
>             Project: Ignite
>          Issue Type: Bug
>          Components: jdbc, sql, thin client
>            Reporter: Igor
>            Priority: Blocker
>              Labels: ignite-3
>
> h1. Steps to reproduce:
> 1. Create table.
> {code:java}
> CREATE TABLE index_test_table_5(id INT PRIMARY KEY, field_1 TINYINT, field_2 
> SMALLINT, field_3 INT, field_4 FLOAT, field_5 VARCHAR){code}
> 2. Create composite index:
> {code:java}
> CREATE INDEX index_test_index_5_1 ON index_test_table_5(field_2, field_3, 
> field_5){code}
> 3. Insert some rows.
> 4. Drop one column of composite index:
> {code:java}
> ALTER TABLE index_test_table_5 DROP COLUMN field_5{code}
> 5. Execute select filtering 2 other columns
> {code:java}
> SELECT * FROM index_test_table_5 WHERE field_2 = 50 AND field_3 = 50{code}
> h1. Expected result:
> The filtered row is returned.
> h1. Actual result:
> An exception:
> {code:java}
> Exception while executing query [query=SELECT * FROM index_test_table_5 WHERE 
> field_2 = 50 AND field_3 = 50]. Error message:Error while applying rule 
> ExposeIndexRule, args 
> [rel#9120:IgniteLogicalTableScan.NONE.[].any(table=[PUBLIC, 
> INDEX_TEST_TABLE_5],filters=AND(=(CAST($t2):INTEGER, 50), =($t3, 
> 50)),requiredColumns={0, 1, 2, 3, 4})]
> java.sql.SQLException: Exception while executing query [query=SELECT * FROM 
> index_test_table_5 WHERE field_2 = 50 AND field_3 = 50]. Error message:Error 
> while applying rule ExposeIndexRule, args 
> [rel#9120:IgniteLogicalTableScan.NONE.[].any(table=[PUBLIC, 
> INDEX_TEST_TABLE_5],filters=AND(=(CAST($t2):INTEGER, 50), =($t3, 
> 50)),requiredColumns={0, 1, 2, 3, 4})]
>     at 
> org.apache.ignite.internal.jdbc.proto.IgniteQueryErrorCode.createJdbcSqlException(IgniteQueryErrorCode.java:57)
>     at 
> org.apache.ignite.internal.jdbc.JdbcStatement.execute0(JdbcStatement.java:148)
>     at 
> org.apache.ignite.internal.jdbc.JdbcStatement.executeQuery(JdbcStatement.java:108)
>  {code}
>  



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

Reply via email to