peilinqian opened a new issue, #21421:
URL: https://github.com/apache/shardingsphere/issues/21421
### Which version of ShardingSphere did you use?
we find java version: java8, full_version=1.8.0_282
ShardingSphere-5.1.3-SNAPSHOT
Commit ID: 9dd0d3990c849d50c17c6dc7c92ec2d4ce0ad7e5
Commit Message: Implements openGauss version function by calcite (#19327)
Branch: 9dd0d3990c849d50c17c6dc7c92ec2d4ce0ad7e5
Build time: 2022-07-19T10:45:21+0800
### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
ShardingSphere-Proxy
### Expected behavior
Fetch forward is none and returns normal;
### Actual behavior
Fetch forward is none and returns “ERROR: Index: 0”
```
test_db=> start transaction;
START TRANSACTION
test_db=> cursor cur_test_01 for select * from t_ssdb order by 1;
DECLARE CURSOR
test_db=> ----without forward
test_db=> fetch from cur_test_01;
id | c_id | a | b
----+------+----+-------
1 | 1 | 10 | test1
(1 row)
test_db=> ----forward without count
test_db=> fetch forward from cur_test_01;
id | c_id | a | b
----+------+----+--------
1 | 2 | 10 | Test12
(1 row)
test_db=> ----forward with count
test_db=> fetch forward 2 from cur_test_01;
id | c_id | a | b
----+------+----+--------
1 | 2 | | test12
2 | 2 | 20 | test22
(2 rows)
test_db=> ----forward with all
test_db=> fetch forward all from cur_test_01;
id | c_id | a | b
----+------+-----+---------
2 | 1 | 20 | test21
2 | 3 | | Test22
3 | 3 | | test3
3 | 3 | | test3
3 | 1 | | 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
(12 rows)
test_db=> ----forward next is none
test_db=> fetch forward cur_test_01;
ERROR: Index: 0
test_db=> close cur_test_01;
CLOSE CURSOR
test_db=> end;
COMMIT
```
### Reason analyze (If you can)
### Steps to reproduce the behavior, such as: SQL to execute, sharding rule
configuration, when exception occur etc.
```
--create table
drop table if exists t_ssdb;
create table t_ssdb(id int,c_id int,a int,b text);
insert into t_ssdb 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');
start transaction;
cursor cur_test_01 for select * from t_ssdb order by 1;
----without forward
fetch from cur_test_01;
----forward without count
fetch forward from cur_test_01;
----forward with count
fetch forward 2 from cur_test_01;
----forward with all
fetch forward all from cur_test_01;
----forward next is none
fetch forward cur_test_01;
close cur_test_01;
end;
```
### Example codes for reproduce this issue (such as a github link).
```
rules:
- !SHARDING
tables:
t_ssdb:
actualDataNodes: ds_${0..1}.t_ssdb
databaseStrategy:
standard:
shardingAlgorithmName: ds_database_inline
shardingColumn: id
defaultTableStrategy:
none:
defaultDatabaseStrategy:
none:
shardingAlgorithms:
ds_database_inline:
type: INLINE
props:
algorithm-expression: ds_${id % 2}
allow-range-query-with-inline-sharding: true
```
--
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:
[email protected]
For queries about this service, please contact Infrastructure at:
[email protected]