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

DML: DELETE statement failed: Invalid number of query parameters. Cannot find 2 parameter.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.8
    • 1.8
    • general
    • None

    Description

      test.java
            IgniteCache<Long, Organization> orgCache = Ignition.ignite().cache(ORG_CACHE);
      
              orgCache.clear();
      
              for (int z=100; z < 100000; z++) {
                  orgCache.query(new SqlFieldsQuery("insert into Organization (_key, name) values (?, ?)").setArgs(z, "Org " + Integer.toString(z)));
              }
      
              for (int z=100; z < 100000; z++) {
                  if (z > 0 && z % 10 == 0)
                      System.out.println("Delete " + z);
      
                  orgCache.query(new SqlFieldsQuery("delete from Organization where _key >= ?").setArgs(z));
              }
      

      The code above failed with IgniteException

      Exception in thread "main" javax.cache.CacheException: class org.apache.ignite.IgniteException: Invalid number of query parameters. Cannot find 2 parameter.
      	at org.apache.ignite.internal.processors.cache.IgniteCacheProxy.query(IgniteCacheProxy.java:761)
      	at org.apache.ignite.examples.datagrid.CacheQueryExample.initialize(CacheQueryExample.java:336)
      	at org.apache.ignite.examples.datagrid.CacheQueryExample.main(CacheQueryExample.java:110)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:606)
      	at com.intellij.rt.execution.application.AppMain.main(AppMain.java:140)
      Caused by: class org.apache.ignite.IgniteException: Invalid number of query parameters. Cannot find 2 parameter.
      	at org.apache.ignite.internal.processors.query.GridQueryProcessor.queryTwoStep(GridQueryProcessor.java:818)
      	at org.apache.ignite.internal.processors.cache.IgniteCacheProxy.query(IgniteCacheProxy.java:749)
      	... 7 more
      Caused by: class org.apache.ignite.IgniteCheckedException: Invalid number of query parameters. Cannot find 2 parameter.
      	at org.apache.ignite.internal.processors.query.GridQueryProcessor.executeQuery(GridQueryProcessor.java:1789)
      	at org.apache.ignite.internal.processors.query.GridQueryProcessor.queryTwoStep(GridQueryProcessor.java:811)
      	... 8 more
      Caused by: class org.apache.ignite.IgniteException: Invalid number of query parameters. Cannot find 2 parameter.
      	at org.apache.ignite.internal.processors.query.h2.sql.GridSqlQuerySplitter.findParams(GridSqlQuerySplitter.java:634)
      	at org.apache.ignite.internal.processors.query.h2.sql.GridSqlQuerySplitter.findParams(GridSqlQuerySplitter.java:650)
      	at org.apache.ignite.internal.processors.query.h2.sql.GridSqlQuerySplitter.findParams(GridSqlQuerySplitter.java:650)
      	at org.apache.ignite.internal.processors.query.h2.sql.GridSqlQuerySplitter.findParams(GridSqlQuerySplitter.java:604)
      	at org.apache.ignite.internal.processors.query.h2.sql.GridSqlQuerySplitter.split(GridSqlQuerySplitter.java:403)
      	at org.apache.ignite.internal.processors.query.h2.sql.GridSqlQuerySplitter.split(GridSqlQuerySplitter.java:184)
      	at org.apache.ignite.internal.processors.query.h2.IgniteH2Indexing.queryTwoStep(IgniteH2Indexing.java:1277)
      	at org.apache.ignite.internal.processors.query.h2.DmlStatementsProcessor.executeUpdateStatement(DmlStatementsProcessor.java:226)
      	at org.apache.ignite.internal.processors.query.h2.DmlStatementsProcessor.updateSqlFields(DmlStatementsProcessor.java:134)
      	at org.apache.ignite.internal.processors.query.h2.DmlStatementsProcessor.updateSqlFieldsTwoStep(DmlStatementsProcessor.java:160)
      	at org.apache.ignite.internal.processors.query.h2.IgniteH2Indexing.queryTwoStep(IgniteH2Indexing.java:1266)
      	at org.apache.ignite.internal.processors.query.GridQueryProcessor$4.applyx(GridQueryProcessor.java:813)
      	at org.apache.ignite.internal.processors.query.GridQueryProcessor$4.applyx(GridQueryProcessor.java:811)
      	at org.apache.ignite.internal.util.lang.IgniteOutClosureX.apply(IgniteOutClosureX.java:36)
      	at org.apache.ignite.internal.processors.query.GridQueryProcessor.executeQuery(GridQueryProcessor.java:1766)
      	... 9 more
      
      

      Attachments

        Issue Links

          Activity

            People

              skozlov Sergey Kozlov
              skozlov Sergey Kozlov
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: