Uploaded image for project: 'Ignite'
  1. Ignite
  2. IGNITE-5533

CREATE INDEX failed if table has been re-created

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Critical
    • Resolution: Fixed
    • None
    • 2.1
    • sql
    • None

    Description

      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

      [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)
      
      repoducer.java
                  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);
                  }
      

      Attachments

        Issue Links

          Activity

            People

              al.psc Alexander Paschenko
              skozlov Sergey Kozlov
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: