Sergey Kozlov created IGNITE-5533: ------------------------------------- Summary: CREATE INDEX failed if table has been re-creted Key: IGNITE-5533 URL: https://issues.apache.org/jira/browse/IGNITE-5533 Project: Ignite Issue Type: Bug Components: sql Affects Versions: 2.1 Reporter: Sergey Kozlov Fix For: 2.1
The brief scenario: create table t1 - ok insert t1 - ok create index t1 - ok drop table t1 - ok create table t1 - ok insert t1 - ok create index t1 - fail {noformat} [21:13:46,190][SEVERE][sql-connector-#239%null%][JdbcRequestHandler] Failed to execute SQL query [reqId=25, req=JdbcQueryExecuteRequest [schemaName=nu ll, pageSize=1024, maxRows=0, sqlQry=create index on "PUBLIC".t1 (b desc), args=[]]] class org.apache.ignite.internal.processors.query.IgniteSQLException: Schema change operation failed: Failed to execute SQL statement on internal H2 d atabase: CREATE INDEX "t1_b_desc_idx" ON "PUBLIC"."T1" ("B" DESC, "_KEY" ASC) at org.apache.ignite.internal.processors.query.h2.ddl.DdlStatementsProcessor.convert(DdlStatementsProcessor.java:277) at org.apache.ignite.internal.processors.query.h2.ddl.DdlStatementsProcessor.runDdlStatement(DdlStatementsProcessor.java:221) at org.apache.ignite.internal.processors.query.h2.IgniteH2Indexing.queryDistributedSqlFields(IgniteH2Indexing.java:1331) at org.apache.ignite.internal.processors.query.GridQueryProcessor$6.applyx(GridQueryProcessor.java:1856) at org.apache.ignite.internal.processors.query.GridQueryProcessor$6.applyx(GridQueryProcessor.java:1852) at org.apache.ignite.internal.util.lang.IgniteOutClosureX.apply(IgniteOutClosureX.java:36) at org.apache.ignite.internal.processors.query.GridQueryProcessor.executeQuery(GridQueryProcessor.java:2293) at org.apache.ignite.internal.processors.query.GridQueryProcessor.querySqlFieldsNoCache(GridQueryProcessor.java:1860) at org.apache.ignite.internal.processors.odbc.jdbc.JdbcRequestHandler.executeQuery(JdbcRequestHandler.java:188) at org.apache.ignite.internal.processors.odbc.jdbc.JdbcRequestHandler.handle(JdbcRequestHandler.java:122) at org.apache.ignite.internal.processors.odbc.SqlListenerNioListener.onMessage(SqlListenerNioListener.java:152) at org.apache.ignite.internal.processors.odbc.SqlListenerNioListener.onMessage(SqlListenerNioListener.java:44) at org.apache.ignite.internal.util.nio.GridNioFilterChain$TailFilter.onMessageReceived(GridNioFilterChain.java:279) at org.apache.ignite.internal.util.nio.GridNioFilterAdapter.proceedMessageReceived(GridNioFilterAdapter.java:109) at org.apache.ignite.internal.util.nio.GridNioAsyncNotifyFilter$3.body(GridNioAsyncNotifyFilter.java:97) at org.apache.ignite.internal.util.worker.GridWorker.run(GridWorker.java:110) at org.apache.ignite.internal.util.worker.GridWorkerPool$1.run(GridWorkerPool.java:70) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:745) {noformat} {code:title=repoducer.java|borderStyle=solid} Connection conn = DriverManager.getConnection("jdbc:ignite:thin://127.0.0.1"); Statement stmt = conn.createStatement(); for (int i=0; i < 2; i++) { String t = Integer.toString(1); print(t); stmt.execute("drop table if exists \"PUBLIC\".t" + t); stmt.execute("create table \"PUBLIC\".t" + t + " (a int primary key, b varchar(30))"); for (int j=1; j < 10; j++) { String s = Integer.toString(j); stmt.execute("insert into \"PUBLIC\".t" + t + " (a,b) values (" + s + ", '" + s + "')"); } stmt.execute("create index on \"PUBLIC\".t" + t + " (b desc)"); stmt.execute("drop table \"PUBLIC\".t" + t); } {code} -- This message was sent by Atlassian JIRA (v6.4.14#64029)