You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2022/10/31 11:15:14 UTC

[GitHub] [shardingsphere] peilinqian opened a new issue, #21868: Use jdbc to connect ss-proxy and execute cursor syntax, return “ ERROR: java.lang.ArrayIndexOutOfBoundsException”

peilinqian opened a new issue, #21868:
URL: https://github.com/apache/shardingsphere/issues/21868

   ## Bug Report
   
   **For English only**, other languages will not accept.
   
   Before report a bug, make sure you have:
   
   - Searched open and closed [GitHub issues](https://github.com/apache/shardingsphere/issues).
   - Read documentation: [ShardingSphere Doc](https://shardingsphere.apache.org/document/current/en/overview).
   
   Please pay attention on issues you submitted, because we maybe need more details. 
   If no response anymore and we cannot reproduce it on current information, we will **close it**.
   
   Please answer these questions before submitting your issue. Thanks!
   
   ### Which version of ShardingSphere did you use?
   we find java version: java8, full_version=1.8.0_282, full_path=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.282.b08-1.el7_9.x86_64/bin/java
   ShardingSphere-5.2.1-SNAPSHOT
   Commit ID: dirty-bcde6f374c4a3a025173fbc9f6d0e66ed686a042
   Commit Message: Fix fetch forward all error in openGauss(#21421) (#21471)
   Branch: bcde6f374c4a3a025173fbc9f6d0e66ed686a042
   Build time: 2022-10-11T19:13:56+0800
   
   ### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
   ShardingSphere-Proxy
   
   ### Expected behavior
   drop table if exists t_broadcast;
   create table t_broadcast(id int,c_id int,a int,b text);
   insert into t_broadcast values (1,1,10,'test1'),(1,2,10,'Test12'),(1,2,null,'test12'),
   (2,1,20,'test21'),(2,2,20,'test22'),(2,3,null,'Test22'),
   (3,3,null,'test3'),(3,3,null,'test3'),(3,1,null,'test31'),(4,4,40,'test4'),(5,5,50,'Test5'),(6,6,60,'test6'),
   (7,4,74,'test74'),(8,5,85,'test85'),(9,5,50,'test95'),(10,6,106,'test106');
   
   --excute SQL by gslq success
   ```
   start transaction;
   cursor cur_test_01 for select id,sum(c_id) from t_broadcast group by id order by 1,2;
   fetch from cur_test_01;
   fetch all from cur_test_01;
   close cur_test_01;
   end;
   ```
   --excute SQL by using JDBC failed
   ```
   String tb_name = "t_broadcast";
   stmt = connection.createStatement();
   stmt.execute("start transaction;");
   stmt.execute("cursor cursor1 for select id,sum(c_id) from " + tb_name + " group by id order by 1,2;");
   ResultSet resultSet = stmt.executeQuery("fetch from cursor1;");
   while (resultSet.next()) {
   	System.out.println(resultSet.getRow());
   	System.out.println(resultSet.getInt(1));
   	System.out.println(resultSet.getInt(2));
   	System.out.println(resultSet.getString(3));
   	System.out.println(resultSet.getString(4));
   }
   ```
   
   ### Actual behavior
   gsql and jdbc 
   
   ```
   Exception in thread "main" org.opengauss.util.PSQLException: [10.190.109.104:63086/7.212.123.28:11000] ERROR: java.lang.ArrayIndexOutOfBoundsException
   	at org.opengauss.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2901)
   	at org.opengauss.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2630)
   	at org.opengauss.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:362)
   	at org.opengauss.jdbc.PgStatement.runQueryExecutor(PgStatement.java:562)
   	at org.opengauss.jdbc.PgStatement.executeInternal(PgStatement.java:539)
   	at org.opengauss.jdbc.PgStatement.execute(PgStatement.java:397)
   	at org.opengauss.jdbc.PgStatement.executeWithFlags(PgStatement.java:339)
   	at org.opengauss.jdbc.PgStatement.executeCachedSql(PgStatement.java:325)
   	at org.opengauss.jdbc.PgStatement.executeWithFlags(PgStatement.java:302)
   	at org.opengauss.jdbc.PgStatement.executeQuery(PgStatement.java:241)
   	at cursor.CursorTest01.main(CursorTest01.java:32)
   ```
   
   ### Reason analyze (If you can)
   
   ### Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc.
   
   ### Example codes for reproduce this issue (such as a github link).
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] RaigorJiang commented on issue #21868: Use jdbc to connect ss-proxy and execute cursor syntax, error occurs probabilistically “ ERROR: java.lang.ArrayIndexOutOfBoundsException”

Posted by "RaigorJiang (via GitHub)" <gi...@apache.org>.
RaigorJiang commented on issue #21868:
URL: https://github.com/apache/shardingsphere/issues/21868#issuecomment-1407550779

   This issue has been inactive for a long time, so I'm closing it now.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] RaigorJiang closed issue #21868: Use jdbc to connect ss-proxy and execute cursor syntax, error occurs probabilistically “ ERROR: java.lang.ArrayIndexOutOfBoundsException”

Posted by "RaigorJiang (via GitHub)" <gi...@apache.org>.
RaigorJiang closed issue #21868: Use jdbc to connect ss-proxy and execute cursor syntax,  error occurs probabilistically “ ERROR: java.lang.ArrayIndexOutOfBoundsException”
URL: https://github.com/apache/shardingsphere/issues/21868


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] strongduanmu commented on issue #21868: Use jdbc to connect ss-proxy and execute cursor syntax, error occurs probabilistically “ ERROR: java.lang.ArrayIndexOutOfBoundsException”

Posted by GitBox <gi...@apache.org>.
strongduanmu commented on issue #21868:
URL: https://github.com/apache/shardingsphere/issues/21868#issuecomment-1297917651

   Hi @peilinqian, thank you for your feedback. Now, cursor only support simple select and order by statement, and not support group by statement.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org